Skip to content

Using the Papermill MCP Server

Design templates and generate PDFs directly from Claude or any MCP-compatible agent. We'll assume Claude here, but other agents are similar.

What you can do

  • List available templates
  • Generate a PDF using an existing template. For example, ask an agent to research a topic and use Papermill to typeset the resulting report.
  • Validate press documents.
  • Create and update templates using AI. This is very helpful for accelerating template creation.
  • Discover what content flows and data a template accepts.
  • Discover what components are available within a template.
  • Render documents to thumbnail images rather than PDF, for use by your agent.

Installation

Set the $PAPERMILL_API_KEY environmental variable in your shell if you haven't already:

shell
export PAPERMILL_API_KEY="your-actual-key-here"

You can create a new API Key from your Papermill settings.

Add MCP to Claude:

claude mcp add papermill https://mcp.papermill.io --transport http --scope user --header 'x-api-key: ${PAPERMILL_API_KEY}'

Verify the install:

claude mcp list

claude mcp get papermill

Tools

  • create_template - create a new template
  • update_template - update an existing template
  • list_templates - list all templates available via Papermill
  • get_template - retrieve a template
  • get_template_data - get the data available within a template
  • get_template_components - get the available components within a template
  • get_template_flows - list the flows a template uses
  • generate_pdf - generate a pdf document using a given template
  • generate_thumbnails - generate a document but produce thumbnails instead of a full pdf
  • validate_press - validate a press file
  • list_patterns - a tool for agents to learn idiomatic press

Example Prompts

Please list all available Papermill templates
Create a new template called "Plain Report". For now, make it simply show a body flow across multiple A4 pages.
Generate a plain report PDF containing a description of the Press language.
Design a new template called "Manchester Flyer". Take some inspiration from all things Manchester to design it graphically. It should be designed for tourist information.

Limitations

We don't recommend using the Papermill MCP server to "one-shot" documents in production workflows. Models are not reliable enough yet, and are liable to make mistakes in layout and/or lack visual consistency across a sequence of documents.

Instead, for automation use the MCP server to generate documents based on existing templates, and separately for AI-assisted template design.

Whilst we're continuously improving our documentation and MCP, foundation models are still limited in their design abilities. In particular, they are liable to size frames incorrectly and fail to use advanced features. It's important to review templates created by AI. In our experience, most errors are minor and can be quickly correct. However, getting models to use Papermill's more advanced features may take some prompting.