pdfmux — Claude Code MCP server: PDF extraction and setup
Extracts PDF content into Markdown and checks for pages an extractor may have missed. Use it to prepare documents for RAG or audit another parser’s output.
claude mcp add pdfmux -e GEMINI_API_KEY=<GEMINI_API_KEY> -- uvx pdfmuxWhat pdfmux does
pdfmux processes PDFs page by page, checks the extracted text, and flags pages that were skipped. It can also compare another extraction engine’s output with the source document, so an empty result on a page does not pass unnoticed. That check is useful when you need to audit an existing PDF pipeline.
For Claude Code, the MCP command runs uvx pdfmux and passes GEMINI_API_KEY; have a Gemini key ready for this configuration. The package requires Python 3.11 or later. Scanned pages need the package’s ocr option, since they can otherwise produce empty text. The server also lists Codex, Cursor, GitHub Copilot, Windsurf, Cline, and Zed as supported platforms.
What it helps with
- extract PDF text as Markdown
- spot pages omitted by an extractor
- audit another parser’s output against the source PDF
- prepare extracted text for RAG
Example prompts for the agent
- Extract
report.pdfand check whether any pages were missed. - Compare the extraction of
invoice.pdfwith its source and flag empty pages. - Audit my parser’s output for missing pages in
report.pdf.
How to install pdfmux
Platform CLI
claude mcp add pdfmux -e GEMINI_API_KEY=<GEMINI_API_KEY> -- uvx pdfmuxReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from pdfmux <command>
Platform CLI
codex mcp add pdfmux --env GEMINI_API_KEY=<GEMINI_API_KEY> -- uvx pdfmuxReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from pdfmux <command>
Config file
{
"mcpServers": {
"pdfmux": {
"command": "uvx",
"args": [
"pdfmux"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from pdfmux <command>
Config file
{
"servers": {
"pdfmux": {
"type": "stdio",
"command": "uvx",
"args": [
"pdfmux"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from pdfmux <command>
Platform CLI
gemini mcp add -e GEMINI_API_KEY=<GEMINI_API_KEY> pdfmux uvx pdfmuxReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from pdfmux <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about pdfmux
How do I install pdfmux in Claude Code?
Run claude mcp add pdfmux -e GEMINI_API_KEY=<GEMINI_API_KEY> -- uvx pdfmux, replacing the placeholder with your Gemini key.
What does pdfmux do?
It extracts PDF content and checks for pages that were dropped. It can also audit output from other extraction engines against the original PDF.
What is required to process scanned PDFs?
Install the package with its ocr option; otherwise scanned pages can yield empty text. pdfmux requires Python 3.11 or later.