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:
- Documents:
doc_open,doc_info,doc_inspect,doc_save,doc_close,doc_set_info,doc_protect,doc_reduce. - Text and images:
text_extract(reading order),text_find,page_renderandrender_preview, which return a PNG the model can look at. - Pages:
page_rotate,page_delete,page_move,page_duplicate,page_extract,doc_combine,doc_split. - Comments:
comment_add(highlight a phrase just by naming it withfind),comment_reply,comment_set_status,comment_list. - Forms:
form_fields,form_fill,form_reset,form_add_field. - Redaction:
redact_mark,redact_apply. - Commands:
command_list,command_runandcommand_batchreach the same commands as the app’s menus.
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
- “Open
contract.pdf, highlight every mention of ‘termination’ and add a note asking legal to review page 4.” - “List the form fields in
application.pdf, fill in name, date and address fromdetails.json, and save a copy.” - “Combine every PDF in
invoices/into one file, sorted by name, then split it every 10 pages.”
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 argumentsFAQ
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.