Use case
Let Your AI Agent Generate PDFs — Built for MCP and Agentic Workflows
Most PDF tools were built for a human clicking buttons in a UI. This one wasn't.
The PDF Generation API is designed so that an AI agent — not just a developer reading docs — can discover what it does and use it correctly on the first try. Predictable REST endpoints, structured JSON input and output, a full OpenAPI specification, and a native MCP server mean an agent can call it as a tool without a human writing custom integration code for each workflow.
MCP client config
{
"mcpServers": {
"pdfapi": {
"command": "npx",
"args": ["-y", "@aranswill/mcp-server"]
}
}
}Why this matters for agent builders
Self-describing via OpenAPI
An agent (or an agent framework) can read the OpenAPI spec and understand available operations, required parameters, and response shapes — without you hand-writing a tool description and hoping the model infers the right schema.
MCP server included
If you're building on Claude, Cursor, or any MCP-compatible client, this API is available as an MCP tool directly — connect it and your agent can generate an invoice, receipt, or report PDF as a step in a larger workflow without you writing glue code.
Structured in, structured out
No markup for the agent to get wrong. It passes a JSON object matching a documented schema (invoice, receipt, or report) and gets a binary PDF back — a clean, low-ambiguity interface that's easy for a model to use correctly and easy for you to validate.
Typed schemas reduce hallucinated fields
Because each template has a fixed, documented JSON schema, there's a concrete contract for the agent to follow rather than open-ended "generate a PDF that looks like an invoice" prompting.
Example: an agent-driven invoicing flow
- 1Agent receives a task: "Generate and send an invoice for this order."
- 2Agent pulls order data from your system (via another tool call).
- 3Agent maps that data into the invoice schema.
- 4Agent calls the PDF Generation API's MCP tool with the JSON payload.
- 5Agent receives the PDF and passes it to an email-sending tool.
No step in that chain requires a human to have pre-built a custom function for "generate this specific invoice" — the schema and MCP server make the tool directly usable.
Getting started with MCP
Published on npm as @aranswill/mcp-server — no install step required, just point your MCP client at it.
Claude Desktop
Add an entry under mcpServers in your claude_desktop_config.json, then restart Claude Desktop.
Cursor
Add the same config under Cursor Settings → MCP, or in your project's .cursor/mcp.json, then reload the MCP panel.
Pricing
Free tier: 200 calls/month, no credit card required — enough to prototype an agent workflow end to end. Paid tiers start at $29/month for production volume.
View pricingFrequently asked questions
What is MCP and why does it matter for a PDF API?
MCP (Model Context Protocol) is a standard that lets AI agents and assistants discover and call external tools directly. A PDF API with a native MCP server can be plugged into an agent's toolset without custom integration code.
Can I use this without an AI agent, just as a normal REST API?
Yes — the MCP server and OpenAPI spec are additional interfaces on top of the same underlying REST API. Standard curl/HTTP requests work exactly as documented on the main API page.
Which AI tools/clients support this via MCP?
Any MCP-compatible client — Claude Desktop, Cursor, and others — can connect via npx @aranswill/mcp-server. The server is published on npm and listed in the official MCP registry as io.github.amranswill/pdfapi-mcp-server, as well as on mcpservers.org.
Does the agent need to know the JSON schema in advance?
No — the OpenAPI spec and MCP tool definitions describe the required fields, so a capable agent can construct a valid request from the tool description and schema alone.