rendoc
← Back to blog

Generate PDFs with AI: MCP Server for Claude, Cursor, and More

6 min readrendoc team
mcpaiclaudetutorial

AI coding assistants like Claude, Cursor, and Windsurf are changing how developers build software. But when your AI assistant needs to generate a PDF — an invoice, a report, a contract — it hits a wall. It can write the code, but it cannot run Puppeteer, spin up Chrome, or manage PDF rendering infrastructure on your behalf.

The Model Context Protocol (MCP) changes that. MCP lets AI assistants call external tools directly, turning "write code that generates a PDF" into "generate the PDF right now." rendoc ships an MCP server that gives any MCP-compatible AI assistant the ability to create PDFs in seconds.

What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI models interact with external services through a structured tool interface. Instead of the AI writing code for you to copy and run, MCP lets the AI call tools directly — read files, query databases, or in this case, generate PDFs.

Think of it as giving your AI assistant hands. Without MCP, it can only describe what to do. With MCP, it can do it.

Setup: 2 Minutes to AI-Powered PDFs

The rendoc MCP server works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible client. Here is how to set it up:

Step 1: Get an API Key

Sign up at rendoc.dev and create an API key from your dashboard. The free tier gives you 100 documents per month.

Step 2: Configure Your AI Client

For Claude Desktop, add this to your configuration file:

{
  "mcpServers": {
    "rendoc": {
      "command": "npx",
      "args": ["-y", "@rendoc/mcp-server"],
      "env": {
        "RENDOC_API_KEY": "your-api-key-here"
      }
    }
  }
}

For Claude Code, add the same block to your .claude/settings.json:

{
  "mcpServers": {
    "rendoc": {
      "command": "npx",
      "args": ["-y", "@rendoc/mcp-server"],
      "env": {
        "RENDOC_API_KEY": "your-api-key-here"
      }
    }
  }
}

That is it. No Docker, no Chrome, no infrastructure. Your AI assistant now has PDF generation as a native capability.

What Can the AI Do Now?

Once connected, your AI assistant gets access to these tools:

ToolWhat It Does
generate_documentCreate a PDF from HTML markup or a saved template with data
list_templatesBrowse available templates by category
preview_templateInspect a template's markup, schema, and sample data
get_documentCheck status and get download URL for a generated PDF
create_templateSave a new reusable template
get_usageCheck monthly API usage and remaining quota

Real-World Examples

Generate an Invoice on the Fly

Just tell your AI assistant:

Generate a PDF invoice for Acme Corp, 3 units of "Widget Pro" at $49.99 each, due in 30 days.

The AI uses the generate_document tool, passes the data to rendoc, and returns a download link — all without you writing a single line of code.

Build a Template, Then Generate from It

Create a professional invoice template with company logo placeholder, line items table, subtotal, tax, and total. Then generate a sample PDF with test data.

The AI will use create_template to save the template, then immediately call generate_document with sample data. Two tool calls, one conversation.

Batch Document Generation

I have a list of 20 clients. Generate a personalized welcome letter PDF for each one using the "welcome-letter" template.

The AI lists your templates, picks the right one, and generates 20 documents in sequence — each with personalized data.

Using the rendoc SDK Directly

If you prefer to integrate rendoc in your own code (outside of AI tools), the official SDKs make it just as simple:

JavaScript / TypeScript

import { Rendoc } from "@rendoc/sdk";

const client = new Rendoc({ apiKey: process.env.RENDOC_API_KEY });

const doc = await client.documents.generate({
  markup: "<h1>Hello {{name}}</h1><p>Your order is confirmed.</p>",
  data: { name: "Jane" },
  filename: "confirmation.pdf",
});

console.log(doc.downloadUrl);

Python

from rendoc import Rendoc

client = Rendoc(api_key="your-api-key")

doc = client.documents.generate(
    markup="<h1>Hello {{name}}</h1><p>Your order is confirmed.</p>",
    data={"name": "Jane"},
    filename="confirmation.pdf",
)

print(doc.download_url)

Why Not Just Use Puppeteer?

You absolutely can. Puppeteer is great for local development and full control. But in the context of AI assistants, the comparison breaks down:

  • AI assistants cannot run Puppeteer — they do not have a browser or a filesystem. MCP tools bridge that gap.
  • Puppeteer requires Chrome/Chromium installed, which complicates deployment on serverless platforms.
  • An API call is 50-200ms. Spinning up a headless browser is 2-5 seconds.
  • rendoc handles paper sizes, fonts, and edge cases that trip up raw Puppeteer setups.

For a deeper comparison of self-hosted vs API approaches, see our HTML to PDF: Self-Hosted vs API guide.

OpenAPI Spec for Custom Integrations

rendoc publishes a complete OpenAPI 3.1 specification. Use it to auto-generate clients in any language, import into Postman, or feed into your own AI tooling pipeline. The spec covers every endpoint: document generation, template management, API keys, and usage tracking.

Getting Started

The fastest path from zero to AI-powered PDF generation:

  1. Create a free account (100 docs/month, no credit card)
  2. Generate an API key from your dashboard
  3. Add the MCP server config to your AI client (see setup above)
  4. Ask your AI assistant to generate a PDF

That is the entire setup. Four steps, two minutes, and your AI assistant can generate professional PDFs whenever you need them.

Generate PDFs without the headaches

rendoc turns your templates into pixel-perfect PDFs with a single API call. Free tier included.