HTML to PDF from Claude and LLM agents (MCP)
pdfrender ships a built-in MCP server: agents call the render_html_to_pdf tool to produce real PDFs. Setup for Claude Code and any MCP client.
| MCP endpoint | https://api.pdfrender.dev/mcp/ (HTTP transport) |
|---|---|
| Tool | render_html_to_pdf — returns { pdf_base64, pages }; input capped at 256 KB |
| Auth | X-API-Key header optional — anonymous works at the per-IP rate limit; same credits as REST |
A PDF is something no LLM can produce locally — pdfrender exposes its renderer as a Model Context Protocol server, so agents generate documents as a tool call. Add it to Claude Code:
claude mcp add --transport http pdfrender https://api.pdfrender.dev/mcp/ \
--header "X-API-Key: YOUR_KEY"
Or in a generic MCP client configuration:
{
"mcpServers": {
"pdfrender": {
"type": "http",
"url": "https://api.pdfrender.dev/mcp/",
"headers": { "X-API-Key": "YOUR_KEY" }
}
}
}
The agent then calls render_html_to_pdf(html) and receives
{"pdf_base64": "…", "pages": N} — decode the base64 and write the file.
Tool vs REST
The tool mirrors the REST policy — anonymous calls work at the
per-IP limit, a key raises it, one call costs one credit — but caps input at
256 KB (base64 megabytes inside tool results are hostile to agent context
windows). For bigger documents have the agent call
POST /v1/render instead. The same rendering
rules apply: HTML + CSS, data: URIs, no JavaScript.
Try it free
Try it free — 100 renders a month, no card — the free tier covers an agent's occasional document easily.