Generate PDFs from your AI agent
The PDFgen MCP server lets Claude and other AI agents turn HTML, Markdown, or a saved template into a PDF — and hand back a link. No rendering code, no headless browser. Just add it to your MCP client.
Generate an invoice PDF for Acme Corp — $2,400, and give me the link.
Works with Claude Desktop, Cursor, and any MCP-compatible client.
Add it in 30 seconds
Drop this into your claude_desktop_config.json, swap in your API key, and restart. It runs via npx — nothing to install or host.
{"mcpServers": {"pdfgen": {"command": "npx","args": ["-y", "@pdfgen/mcp"],"env": {"PDFGEN_API_KEY": "pdfg_live_xxx"}}}}
Or run it against any MCP client:
PDFGEN_API_KEY=pdfg_live_xxx npx -y @pdfgen/mcp
Three tools, zero glue code
Your agent gets exactly what it needs to create and reuse documents.
generate_pdfGenerate a PDF from HTML, Markdown, or a saved template (with data for Handlebars tokens). Returns a hosted, expiring link.
list_templatesList the saved templates on your PDFgen account so the agent can pick one to render.
create_templateCreate a reusable template from HTML and get back a template_id to render later.
How it works
Ask your agent
Tell Claude what document you need — an invoice, a certificate, a report.
It calls a tool
The agent calls generate_pdf with your HTML, Markdown, or a saved template_id and data.
You get a link
PDFgen renders the PDF and the agent returns a hosted link — no infrastructure on your side.
Frequently asked questions
- What is the PDFgen MCP server?
- It's a Model Context Protocol server that exposes the PDFgen API as tools, so AI agents like Claude can generate PDFs from HTML, Markdown, or a saved template and get back a link — without you writing any rendering code.
- How do I install it?
- Add the config below to your MCP client (e.g. Claude Desktop) with your PDFgen API key. It runs via npx, so there's nothing to install or host yourself.
- Do I need an API key?
- Yes — grab one free from the Developer section of your PDFgen dashboard and put it in the PDFGEN_API_KEY environment variable.
- Which clients work?
- Any MCP client. Claude Desktop is the most common; the server speaks MCP over stdio, so editors and agent frameworks that support MCP work too.