A PDF MCP server for AI agents.
One tool for each thing an agent does with a PDF: read it, search it, change it, redact it. Add it to Claude Code in one line.
An MCP server gives an agent tools it can call without writing code. nupdf's is the same binary as its command line: every command is one tool, and every result is the command's JSON report.
Add it
$ cargo install --locked nupdf-cli $ claude mcp add nupdf -- nupdf mcp
For a whole project, check in a .mcp.json. Other MCP clients take the same command and arguments.
{
"mcpServers": {
"nupdf": { "command": "nupdf", "args": ["mcp"] }
}
}
What the agent gets
- One tool per command.
info,extract,search,tables,render,forms,merge,split,redact,verify,diffand the rest, each taking one file or many. - Structured results. Each call returns the report as text and as
structuredContent. A failure is a tool error carrying nupdf's error report, with a stable code. - An address for every span of text. Search returns ids like
p3.b2.l4.s1:5-12, and other tools accept them. - Budgets.
max_charsstops at a whole block and returns a cursor to continue from. - Limits. Every call is bounded: 300 seconds and 8 MB of report by default. A cancelled call stops.
- It keeps serving. A panic on one file is caught and reported; the server does not die with it.
How it did in the agent eval
Thirty graded tasks, five runs each, one small-model agent a run, each allowed its own tool only. The three MCP servers in it are nupdf's, PDF Oxide's and pymupdf4llm-mcp.
Tokens and wall time are medians over passed runs. The two other servers cannot write a PDF, so they skip the tasks that need one. Tasks, graders and every run
Prefer a skill?
The same commands work as a Claude Code skill, where the agent runs the CLI from its shell.
$ mkdir -p ~/.claude/skills/nupdf $ nupdf guide --skill > ~/.claude/skills/nupdf/SKILL.md
In the eval, agents running the CLI from a shell solved as many tasks as those using the server, and used more tokens: a median 14,578 a task against 8,988.