Skip to content

Use pagenull from AI agents

An AI assistant or agent can call pagenull like any other client: to turn HTML it wrote into a PDF, screenshot a page, or check a receipt. There are two ways in: the MCP server, or the OpenAPI spec.

MCP server

@pagenull/mcp is a small MCP server that runs on your machine and calls the pagenull API with your own key. It needs Node.js 18 or later. Add it to your client:

Claude Desktop

claude_desktop_config.json (Settings → Developer → Edit Config)
{
  "mcpServers": {
    "pagenull": {
      "command": "npx",
      "args": [
        "-y",
        "@pagenull/mcp"
      ],
      "env": {
        "PAGENULL_API_KEY": "pm_live_…"
      }
    }
  }
}

Claude Code

Terminal
claude mcp add pagenull -e PAGENULL_API_KEY=pm_live_… -- npx -y @pagenull/mcp

Cursor

~/.cursor/mcp.json, or .cursor/mcp.json in a project
{
  "mcpServers": {
    "pagenull": {
      "command": "npx",
      "args": [
        "-y",
        "@pagenull/mcp"
      ],
      "env": {
        "PAGENULL_API_KEY": "pm_live_…"
      }
    }
  }
}

VS Code

.vscode/mcp.json (VS Code asks for the key once and keeps it out of the file)
{
  "inputs": [
    {
      "type": "promptString",
      "id": "pagenull-key",
      "description": "pagenull API key",
      "password": true
    }
  ],
  "servers": {
    "pagenull": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@pagenull/mcp"
      ],
      "env": {
        "PAGENULL_API_KEY": "${input:pagenull-key}"
      }
    }
  }
}

On Windows, if the client can’t find npx, use "command": "cmd" with "args": ["/c", "npx", "-y", "@pagenull/mcp"].

Tools

render_pdfHTML or a public URL to PDF, with format, margins, landscape, backgrounds, page numbers and test modePOST /v1/pdf
screenshotHTML or a public URL to PNG or JPEGPOST /v1/screenshot
list_templatesyour saved templates and the built-in onesGET /v1/templates
render_templatea template plus JSON data to PDFPOST /v1/templates/{id}/render
verify_receiptcheck a receipt's signature with the published key, and that a file matches itGET /.well-known/pagenull-keys.json
get_usagethis month's renders, limit and rate limitGET /v1/usage

Each tool is one API call. Errors come back with the API’s own code and message, so the assistant can fix the request and try again.

OpenAPI for function calling

The whole API is described in an OpenAPI 3.1 document at /openapi.json (or /openapi.yaml). Most agent frameworks and code generators can turn it into tools or a client. It’s built from the same code that checks your requests, so the fields, limits and error codes in it are the real ones. Point the tools at https://api.pagenull.dev with your key in Authorization: Bearer.

For language models reading the site, /llms.txt has a summary with links, and /llms-full.txt the API reference as plain text.

What comes back

  • The PDF or image comes back in the response itself; for an agent, that means base64 in the tool result. There are no stored files and no download links: pagenull keeps nothing after the response is sent.
  • With the MCP server, save_to writes the file to a path on your machine instead, and the result carries only the facts: render id, receipt, page count, warnings and quota. Use it for large files.
  • Every render carries a signed receipt. The verify_receipt tool, or /verify, checks it.

Privacy with an AI assistant in the loop

  • pagenull itself renders in the EU and stores nothing, no matter who calls it: a person, a script or an agent.
  • When the calls go through an AI assistant, the HTML it sends, and the base64 PDF it gets back unless you use save_to, also pass through that AI provider. The provider’s own data policy applies to them, and the provider is often outside the EU.
  • With the local MCP server and save_to, the PDF goes from pagenull straight to your disk and never reaches the AI provider. The HTML still does, because the assistant writes it.

So pagenull’s part of the flow is EU-hosted and stores nothing; the assistant’s part follows its own terms. For documents with personal data, check those terms too, or call the API directly from your own code.