Skip to content

Setup guide · Framework

Formfeed in LangChain and LangGraph

MultiServerMCPClient connects to one or more MCP servers and returns LangChain tools. Hand them to create_agent or bind them to a node in your LangGraph graph.

  1. Create a test key

    Sign in to the app, open API keys and create a key in the test environment. Test renders are not metered, which is what you want while an agent is still learning your templates. Switch to a live key when it goes to production.

  2. Install the packages

    Shell
    pip install langchain langchain-anthropic langchain-mcp-adapters
  3. Add the Formfeed server

    Each server is one entry with a transport: stdio for the local package, streamable_http for a URL.

    agent.pyPython
    import asyncio
    import os
    
    from langchain.agents import create_agent
    from langchain_mcp_adapters.client import MultiServerMCPClient
    
    client = MultiServerMCPClient(
        {
            "formfeed": {
                "transport": "stdio",
                "command": "npx",
                "args": ["-y", "@formfeed/mcp"],
                "env": {"FORMFEED_API_KEY": os.environ["FORMFEED_API_KEY"]},
            }
        }
    )
    
    
    async def main() -> None:
        tools = await client.get_tools()
        agent = create_agent("anthropic:claude-opus-5-5", tools)
        prompt = "Render invoice 2026-0042 for Olvarest GmbH and return the link."
        result = await agent.ainvoke({"messages": [{"role": "user", "content": prompt}]})
        print(result["messages"][-1].content)
    
    
    asyncio.run(main())
    agent.pyPython
    client = MultiServerMCPClient(
        {
            "formfeed": {
                "transport": "streamable_http",
                "url": "https://mcp.formfeed.dev/mcp",
                "headers": {"Authorization": f"Bearer {os.environ['FORMFEED_API_KEY']}"},
            }
        }
    )

    Signed-in use instead of a key: connect to https://mcp.formfeed.dev/mcp without a header, and the client opens the Formfeed sign-in, where you choose the workspace the agent works in. A signed-in agent always renders live and counts units; free test renders need a test key. A self-hosted endpoint (npx -y @formfeed/mcp --http) takes API keys only.

  4. Check the connection

    Print [t.name for t in tools]: you should see the eight Formfeed tools.

Try it

  • Invoice

    “Render invoice 2026-0042 for Olvarest GmbH: 8 hours of consulting at €120 and 20 hours of implementation at €110. Use the German invoice template.”

  • Validation

    “Check whether orders/2026-0042.json fits the invoice-de template before you render anything.”

  • Ad-hoc HTML

    “Turn these meeting notes into a one-page PDF. No template, plain HTML is fine.”

Tips

  • In LangGraph, put validate_template in front of render as its own node so a failed validation routes back to the model instead of spending a unit.
  • The langchain-mcp-adapters repository is no longer maintained. LangChain 1.4 brought its own MCP client in beta, pip install "langchain[mcp]" with from langchain.mcp import MCPAdapter: it infers each server’s transport instead of reading a transport key, takes headers through a fastmcp StreamableHttpTransport and lists the tools with list_tools().

The eight tools

list_templates
Templates of the workspace with slug, kind (PDF, image, Word or PowerPoint), engine and published version; filter by kind, engine, tag or search text.
free
get_template_schema
The JSON Schema of the data a template expects, with the sample data it was designed with. A template without a stored schema gets one inferred from its sample data: a guide, not a contract.
free
validate_template
Checks a template with the data without rendering: syntax, variables missing from the data, errors that only happen with this data, and the data against the template’s stored schema. Ad-hoc HTML is checked offline.
free
check_invoice
Checks the _invoice block of an e-invoice offline, as the API does before it renders one: the fields EN 16931 asks for, the totals to the cent, VAT categories and code lists, and the rules of France. Names every field and rule it breaks.
free
render
Renders a template or raw HTML to PDF, PNG, JPG or WebP (Word and PowerPoint templates also to DOCX or PPTX) and returns the download URL, page count and units. With einvoice, the PDF becomes a ZUGFeRD / Factur-X e-invoice with the validator’s report, for one unit more (live from the Starter plan).
1 unit, PDFs per 5 pages
convert_to_pdf
Converts a Word, Excel, PowerPoint, OpenDocument, RTF or HTML document of up to 20 MB, or the render of a Word or PowerPoint template, to PDF and returns the download URL; the document is not kept. The local server also reads a file by its path. Starter plan and above.
like a PDF
get_render
Status, download URL and error of a render: for renders the agent queued with wait: false, and for a fresh link once the old one has expired.
free
get_workspace
The workspace and organisation the server works in, the plan, the environment and the units of the period: how many renders are left.
free

Configuration reference: LangChain — LangChain and LangGraph (checked 17 October 2026)

Other setup guides

Automation

Start rendering today

The free plan includes 100 units a month and free test renders. Change plans when you need more.