Install
Claude Code (recommended)
claude mcp add --transport http a2pdf https://a2pdf.com/mcp
Or for older Claude Code releases that only support SSE:
claude mcp add --transport sse a2pdf https://a2pdf.com/mcp/sse
Claude Desktop / Cursor / Windsurf / VS Code MCP
Add this to your mcpServers config:
"a2pdf": {
"url": "https://a2pdf.com/mcp",
"transport": "streamable-http"
}
Hermes (YAML)
mcp_servers:
a2pdf:
url: "https://a2pdf.com/mcp"
Cline / OpenClaw / others (SSE)
{"url":"https://a2pdf.com/mcp/sse"}
Tools
convert_to_pdf
Primary tool — converts any supported input to a PDF and returns a one-time download URL valid for 10 minutes.
{
"name": "convert_to_pdf",
"arguments": {
"text": "# My document\n\nHello **world**.",
"theme": "clean",
"paper_size": "letter"
}
}
Accepts exactly one of:
text— pasted markdown, HTML, or plain textfile_base64— base64-encoded file bytes (DOCX, JPG, PNG, etc.) — needsfilenamefor format detectionupload_id— returned byPOST /mcp/upload(preferred for files > 2 MB)url— any http:// or https:// URL
Options:
format— md, html, txt, docx, jpg, png, url, auto (default)theme— clean (default), academic, business, darkpaper_size— a4, letter (default), legalpreserve_source— boolean, honored only for HTML and URL inputs
preview_html
Render an input to themed HTML without producing a PDF. Returns the HTML string. Useful when iterating on themes or content before committing to a final render.
list_themes
Returns the four themes with one-line descriptions. Call once and cache.
Large files — out-of-band upload
Tool calls have a 2 MB inline cap to protect the agent's token budget. For larger files, upload first:
curl -F [email protected] https://a2pdf.com/mcp/upload
# → {"id":"abc...","filename":"input.docx","bytes":123456,"expires_in_seconds":600}
Then call convert_to_pdf with upload_id: "abc..." and no file_base64. IDs are single-use and expire after 10 minutes.
Transports
- Streamable HTTP (recommended): one URL, one POST per request.
POST /mcp. Stateless. Used by current Claude clients, Hermes, modern MCP clients. - SSE (legacy):
GET /mcp/sseopens the stream,POST /mcp/messages?sessionId=Xsends requests. Used by Cline, older Claude Code releases, OpenClaw.
Endpoints reference
POST /mcp Streamable HTTP transport
GET /mcp/sse Legacy SSE session opener
POST /mcp/messages?sessionId=X Legacy SSE replies
POST /mcp/upload Out-of-band file upload (multipart, field: file)
GET /mcp/download/{id} One-time PDF download (10-min TTL)
Sister sites with MCP
- md2doc.com/mcp — Markdown → Word (DOCX). Same dual-transport pattern.
- t0md.com/mcp — Document → Markdown. The reverse direction of a2pdf.