Open editor
For developers

PdfCraft MCP: a PDF engine your agent can drive

Every PdfCraft engine feature is reachable without the interface, through one table of tools described with JSON Schema. The pdfcraft-cli command-line tool serves that table as an MCP server, so an AI agent can open a PDF, find a phrase, highlight it, fill in a form and save, in the same engine the app uses.

MCP needs pdfcraft-cli on your computer. The browser editor on this site can’t be driven by an agent; to ask questions about a PDF in the browser, use Chat with PDF.

Get the CLI

The 0.6.0 release ships pdfcraft-cli for macOS (pdfcraft-cli-0.6.0-macos-universal.zip, signed and notarized) and Linux on x86_64, ARM64 and RISC-V. On other systems, build it from source with cargo build --release -p pdfcraft-cli. The MCP server is included by default; --no-default-features leaves it out.

Set up with Claude Code

Make a working folder for the agent, then register the server:

mkdir -p "$PWD/pdfs"
claude mcp add pdfcraft -- /path/to/pdfcraft-cli mcp --root "$PWD/pdfs"

Or add it to your agent’s MCP configuration (.mcp.json in a project for Claude Code):

{
  "mcpServers": {
    "pdfcraft": {
      "command": "pdfcraft-cli",
      "args": ["mcp", "--root", "/path/to/your/pdfs"]
    }
  }
}

Add --compact for agents with a small context budget: the tool list shrinks to about ten core tools plus tool_search and tool_call, which find and run every other tool. Every tool still works.

What the agent gets

Over a hundred tools; pdfcraft-cli tools prints the current set with their schemas. They include:

Edits stay in memory and can be undone until doc_save. Saving to the same file appends an incremental update, so the original bytes are preserved, and the write is atomic. Pages and positions are 1-based, and rectangles are PDF points from the top-left of the displayed page. The server also exposes open documents as read-only resources: info, text and page images.

Prompts to try

Without MCP: the CLI on its own

pdfcraft-cli info  form.pdf                       # structure as JSON
pdfcraft-cli text  paper.pdf --page 3             # reading-order text
pdfcraft-cli edit  in.pdf --rotate 1,2:90 --delete 5 --title "Q3" --out out.pdf
pdfcraft-cli combine report.pdf appendix.pdf --out combined.pdf
pdfcraft-cli split   report.pdf --every 10 --out-dir parts/
pdfcraft-cli run text_find doc=1 query=invoice    # any tool, key=value arguments

FAQ

Can an AI agent control the browser version on this site?

No. The MCP server is part of pdfcraft-cli and runs a headless PdfCraft engine on your computer. The web build has no agent channel. For questions about a PDF in the browser, use the Chat with PDF panel; for agent automation, use the CLI.

Which agents work with it?

Any MCP client that can launch a local stdio server: Claude Code, Claude Desktop, Cursor, VS Code agents and others. They all take the same command and arguments.

Does it open a network port?

No. The server runs only while an agent launches pdfcraft-cli mcp, talks over stdin and stdout, and stops when the agent disconnects. PdfCraft never starts it on its own.

Can the agent read or change files anywhere on my disk?

Not with --root. That flag confines every file the agent reads or writes to one folder; paths outside it are refused with the same message whether or not they exist, so the agent can’t probe the rest of the disk. Point it at a dedicated working folder.

Source: the PdfCraft README, MCP conventions and automation guide. Flags and tools can change between releases; check pdfcraft-cli --help and pdfcraft-cli tools.