Repository avatar
AI Tools
v0.1.0
active

pagedpdf

io.github.codynaut/pagedpdf

Turn HTML into a PDF file from Claude, Cursor or any MCP client, using the PagedPDF API.

Documentation

PagedPDF MCP server

Lets Claude, Cursor, VS Code and other MCP clients turn HTML into a PDF file. The agent writes the HTML, calls html_to_pdf, and gets back the path of the saved PDF along with the page count and anything that failed to load.

It uses the PagedPDF API, which prints with current Chrome and fixes the usual print problems by default: table rows stay whole, table headers repeat on every page, and page numbers take one footer option. You don't install Chrome or Puppeteer.

Get a key

The free plan makes 50 PDFs a month with no card and no watermark. Get a key at pagedpdf.com/docs.

Install

Claude Code

claude mcp add pagedpdf -e PAGEDPDF_KEY=your_key -- npx -y pagedpdf-mcp

Claude Desktop

Add this to claude_desktop_config.json, then restart Claude:

{
  "mcpServers": {
    "pagedpdf": {
      "command": "npx",
      "args": ["-y", "pagedpdf-mcp"],
      "env": { "PAGEDPDF_KEY": "your_key" }
    }
  }
}

Cursor

Use the same JSON in .cursor/mcp.json in your project, or in ~/.cursor/mcp.json for every project.

VS Code

Add this to .vscode/mcp.json:

{
  "servers": {
    "pagedpdf": {
      "command": "npx",
      "args": ["-y", "pagedpdf-mcp"],
      "env": { "PAGEDPDF_KEY": "your_key" }
    }
  }
}

On Windows, if the server doesn't start, change the command to "cmd" and the args to ["/c", "npx", "-y", "pagedpdf-mcp"].

Tools

html_to_pdf

InputWhat it does
htmlThe HTML document. Use this or html_file.
html_filePath to a local .html file, instead of html.
output_pathWhere to save the PDF. Defaults to a new file in your Downloads folder.
base_urlRelative image and font URLs resolve against this.
formatA3, A4 (default), A5, Legal, Letter or Tabloid.
landscapeTurns the page sideways.
marginOne length such as "15mm", 0, or an object with top, right, bottom and left.
header, footerPlain text on every page. {page} and {pages} become the page number and total.
javascriptRuns the page's scripts first. Off by default, so pages that build their content with JavaScript need it.
table_fixesKeeps table rows whole and repeats headers. On by default.

check_usage

Checks that the key works and shows how many documents it has made this month.

Things to ask for

  • "Make a PDF invoice for order 1042 with 'Page 1 of N' in the footer and save it as invoice-1042.pdf."
  • "Turn report.html into a landscape Letter PDF."
  • "Print this table so the rows don't split across pages."

Good to know

  • The key stays in the server's environment, so the model never sees it.
  • Your HTML is sent to api.pagedpdf.com to be printed. The privacy page says what's stored.
  • The full API docs are at pagedpdf.com/docs.

License

MIT

NPM
pagedpdf-mcp
Install Command
npm install pagedpdf-mcp