Apache-2.0 PDFium + PDF.js
Powered by Chromium PDFium WASM and PDF.js with zero AGPL or GPL dependencies in the extraction or rendering pipeline.
Search a PDF locally, then retrieve the cited text, table slice, or figure crop. Each citation identifies the physical page and source bounds so you can check the evidence.
Works with your existing agent stack
Every tool response is designed to keep context windows small, citations traceable to an exact document generation, and numbers auditable.
Cited Retrieval
pdf_search builds a local inverted index and runs BM25, phrase, semantic, or hybrid queries across pages within a strict token budget. Each hit returns a compact excerpt with pageId, canonical elementId, and displayed-page bbox coordinates in points.
extractionFingerprint so stale citations fail closed.search_text_coverage_incomplete warnings so agents never mistake skipped pages for missing facts.{
"documentId": "doc_01j8k9m2p4",
"extractionFingerprint": "fp_41_a9f3c20e",
"textCoverage": { "status": "complete", "indexedPages": 48 },
"hits": [
{
"page": 12,
"pageId": "page:12",
"elementId": "table:12:1",
"score": 11.42,
"bbox": [48, 162, 540, 318],
"excerpt": "Consolidated revenue (in millions): FY2025 $42.5"
}
]
}
pdf-decompiler crop or pdf_render_page using the table sourceBbox.Structured Tables & Visual Proof
Standard text extractors strip surrounding unit captions and merge columns across multi-column pages. pdf_get_element slices rows and columns while preserving tableContext: the verbatim preceding title, unit notes like (in millions) or (in thousands), canonical headers, and a union sourceBbox.
When a dense financial statement or diagram requires visual confirmation, pass sourceBbox directly to pdf_render_page to clip a bounded PNG or JPEG via Chromium PDFium WASM without rendering the entire document.
Claim Verification
Before presenting a dollar figure, percentage, or date, agents call pdf_verify_claim with the claim string and 1 to 12 cited elementIds. Stage 1 runs offline in 0 to 1 ms on CPU to check years, currencies, accounting negatives like (15.0), table unit scales (with per-share/EPS exemption), and derived arithmetic.
Optional Stage 2 semantic scoring supports TypeSafe AI Jev, gemini-decisions, and openai-compat. Every result emits a domain-separated HMAC-SHA256 attestation verified offline via verifyAttestation(), pdf-decompiler gate, or the Stop Hook.
{
"verdict": "supported",
"stage": "deterministic",
"latencyMs": 0.4,
"checks": {
"years": "matched",
"currency": "USD",
"scale": "millions",
"arithmetic": "exact"
},
"attestation": {
"keyId": "local-hmac-v1",
"claimSha256": "8c1f9a04e2...",
"elementIds": ["table:12:1"],
"hmacSha256": "3b7d41c89e..."
}
}
Designed for local CPU execution, strict workspace boundaries, and predictable token accounting.
Powered by Chromium PDFium WASM and PDF.js with zero AGPL or GPL dependencies in the extraction or rendering pipeline.
Triggers Tesseract CLI by default for scanned or unmapped-font pages, or opt into pure-Node ONNX PP-OCRv5 with SHA-256-pinned models.
Requires explicit --allow-root paths, enforces monotonic MCP roots/list confinement, and blocks IPv4/IPv6 SSRF via DNS pinning.
One npm package provides a one-shot terminal CLI, an Agent Skill, and a schema-versioned 10-tool stdio MCP server for Node.js 22 and 24.
Rank across 2 to 8 open documents with shared BM25 statistics via pdf_search_documents, or scan up to 32 PDFs in an allowed directory.
Compact structured mode cuts token volume by roughly 50%, while signed pagination cursors keep large page reads and table slices bounded.
One package (pdf-decompiler) ships the CLI, the 10-tool stdio MCP server, and an Agent Skill. Select your client below.
# Inspect structure, outline, and table counts
npx -y pdf-decompiler inspect report.pdf
# Cited BM25 search (one excerpt per page)
npx -y pdf-decompiler search report.pdf "Revenue" --page
# Read target pages as compact cited Markdown
npx -y pdf-decompiler read report.pdf --pages 1-2 --markdown --compact
# Render a clipped visual proof crop
npx -y pdf-decompiler crop report.pdf 1 --bbox 40,40,400,250 --out proof.png
# Verify a factual claim locally against a cited element
npx -y pdf-decompiler verify report.pdf --claim "FY2025 revenue was $42.5 million" --elements table:12:1 --provider auto
claude mcp add pdf-decompiler -- npx -y pdf-decompiler mcp --allow-root ./pdfs
codex mcp add pdf-decompiler -- npx -y pdf-decompiler mcp --allow-root ./pdfs
{
"mcpServers": {
"pdf-decompiler": {
"command": "npx",
"args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]
}
}
}
{
"servers": {
"pdf-decompiler": {
"type": "stdio",
"command": "npx",
"args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "${workspaceFolder}/pdfs"]
}
}
}
{
"mcpServers": {
"pdf-decompiler": {
"command": "npx",
"args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]
}
}
}
Need Windsurf, Antigravity, pdf-decompiler setup, or pdf-decompiler doctor? See the full MCP Setup Guide.
Reproduce where citations support an answer and where the source check breaks down.
On 24 held-out SciEGQA papers, Decompiler's top citation localized 1 compact region. A caption-linked PyMuPDF baseline localized 11. Manual review found cases where a caption answered the question and cases where a tight crop lost the caption.
On 24 FinDVer claims with annotated evidence supplied, the offline check accepted 3 of 12 true claims and 9 of 12 false claims. A separate test on a fictional report exposed wrong-row and wrong-year matches. Both experiments are reproducible.
Reproduce a citation and crop with the offline sample report demo. Browse the historical extraction results.
Use citation bounding boxes to inspect the text, table or figure. The local claim gate screens for numeric and lexical matches and can flag unit, year and sign mismatches. Check the cited source for the correct row, year and entity.
No. Extraction, indexing, search, rendering, OCR, and Stage 1 claim verification run locally on CPU. Filesystem access is deny-by-default unless you specify --allow-root, HTTPS fetches use DNS-pinned SSRF guards and require explicit opt-in, and Stage 2 remote verification stays disabled unless explicitly requested.
PDF Decompiler packages search, bounded retrieval and generation-bound citations as an MCP workflow. PyMuPDF provides native text, geometry and rendering APIs that can be used to build evidence retrieval pipelines. The research evaluation compares these approaches on scientific papers.
Yes. Pages with scanned images or unmapped fonts automatically trigger local OCR via Tesseract CLI by default. You can also opt into pure-Node CPU PP-OCRv5 by installing onnxruntime-node and running npx -y pdf-decompiler ocr install.
Any standard stdio MCP client works with the 10-tool server (schema version 4.0.0), including Claude Code, Claude Desktop, OpenAI Codex, VS Code, Cursor, Windsurf, and Antigravity. Run npx -y pdf-decompiler setup --client <name> or check the MCP Setup Guide.
Connect the 10-tool stdio MCP server to your workspace or inspect the Apache-2.0 source code directly on GitHub.