
Pdf Mcp
io.github.jztan由 GitHub 帳號 jztan 發布v3.7.0更新於 Nov 7, 2026
Agentic RAG over one PDF or a whole folder: hybrid search, selective page reads, tables, OCR.
概覽
本機 MCP 伺服器,讓 AI 助理搜尋、閱讀並擷取單一 PDF 或整個資料夾中 PDF 的內容,只回傳真正相關的頁面。
- 可以做什麼
- 檢視文件資訊:頁數、中繼資料、目錄摘要、掃描頁偵測
- 以關鍵字與語意混合搜尋,回傳段落摘錄與來源座標
- 讀取指定頁面或範圍、整份文件,並將頁面轉成圖片供視覺模型使用
- 擷取表格、內嵌圖片、圖表資料點,並對掃描頁做 OCR
- 對整個資料夾做概覽與跨文件搜尋,並預先暖機到快取
- 檢視與清除本機快取,並回報目前啟用的選用功能
- 適用情境
- 適合需要針對長篇 PDF、報告或掃描文件回答問題、又不想把全文塞進上下文的情況;也適合把整個 PDF 資料夾當成可搜尋的知識庫,而不必建立匯入流程。
- 執行需求
- 以本機程序執行:可用 Claude Desktop 擴充套件,或以 uv、pipx 安裝 pdf-mcp 指令(Python 3.11 至 3.14)。首次啟動會下載約 250 MB 元件。OCR 需另裝 Tesseract;選用的 CUDA 向量化需 NVIDIA 顯示卡。快取可透過 PDF_MCP_CACHE_DIR、PDF_MCP_CACHE_MAX_MB、PDF_MCP_CACHE_TTL 設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pdf Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
pdf-mcp
[PyPI version] [Python 3.11 to 3.14] [License: MIT] [GitHub Issues] [CI] [codecov] [Downloads]
Agentic RAG over your PDFs, one file or a whole folder, as a single MCP tool.
The agent decides when to search; pdf-mcp does the retrieval and hands back excerpts. It is an MCP server that lets Claude Code and other AI agents search one PDF or a whole folder by meaning or keyword, read only the pages that matter, and cleanly pull out tables, images, and scanned text, even from multi-column and Japanese layouts, with optional CUDA acceleration for warming large corpora.
mcp-name: io.github.jztan/pdf-mcp
Try it in your browser
Drop in any PDF, or a whole folder of them, and watch an agent triage the corpus, search across every document at once, and read only the pages that matter, using a fraction of the tokens. 100% client-side, no install required.
Why pdf-mcp?
Installation
Claude Desktop: nothing to install first
- Download pdf-mcp.mcpb.
- In Claude Desktop, open Settings > Extensions, drag the file onto that page, and click Install.
- Ask Claude about a PDF by its location, for example "Use pdf-mcp to summarize C:\Users\me\Downloads\report.pdf", or about a whole folder.
The first start downloads pdf-mcp's components (about 250 MB) and can take a few minutes; later starts take seconds. OCR for scanned pages is included: the first scanned page downloads an English-only Tesseract (about 14 MB). Needs Windows 10 or later, or macOS 13 or later (14 on Apple Silicon), and works in Claude Desktop's Chat. Updating, uninstalling and other details are in docs/clients.md.
Claude Code and other MCP clients
Needs Python 3.11 to 3.14. On 3.15 the installer falls back to a very old
release, because a dependency has no 3.15 build yet. Install the pdf-mcp
command with uv or
pipx:
pip install pdf-mcp works inside a virtual environment; Homebrew's Python
and recent Debian and Ubuntu refuse a system-wide pip install.
Then add it to your client. For Claude Code:
For VS Code, Cursor, Codex CLI, Kiro or any other MCP client, see docs/clients.md. Then ask your agent to read a PDF.
Search, the corpus tools, tables and multi-column and CJK reading order work out of the box. For non-English documents, see language support. OCR on scanned pages also needs Tesseract:
Optional: CUDA embedding on an NVIDIA card warms large folders one to two orders of magnitude faster; see docs/configuration.md.
From Python
pdf-mcp's tools are also plain Python functions, so you can import them and hand a PDF to the Anthropic SDK without running a server. Two runnable scripts, for a question and for a whole document: examples/.
Why this exists, and what broke along the way: Claude's 100-page PDF limit and how I got around it
Tools
13 specialized tools rather than one monolithic one. Typical pattern:
pdf_info to plan, pdf_search to locate (its paragraph excerpts often
answer the question outright), pdf_read_pages when you need more. For a
folder, pdf_corpus_overview to triage, then pdf_corpus_search.
Text returned by any of these is untrusted content extracted from a PDF.
pdf_info(content_trust=True) reports hidden text a human reader cannot
see, and the read tools flag it per page.
Example prompts:
Full reference, every parameter and response shape: docs/tool-reference.md. Embedding model selection: docs/embedding-models.md.
Example Workflow
For a large document (e.g., a 200-page annual report):
Remote / HTTP transport
STDIO is the default and is what every example above uses. pdf-mcp-http
serves the same tools over HTTP, for clients that cannot spawn a process
(the Anthropic API MCP connector, claude.ai custom connectors) and for a
warm corpus shared by several clients.
Paths resolve on the server, so an HTTP agent reads what is already there:
files under an allow-listed root, or a URL the server fetches. It cannot
hand over a file from its own machine. It is single-tenant and fails
closed: with no auth token and no [paths] allow list, the process exits
rather than serving an open endpoint.
Docker images are published to GHCR for amd64 and arm64, with everything baked in, so every tool works on the first request:
Read docs/remote-access.md for the trust boundary and threat model before deploying, and docs/configuration.md for setup, client config, and token rotation.
Configuration
pdf-mcp works out of the box. To restrict which paths and URL hosts the server may touch, tune cache and worker settings, or add your own content-trust phrases, see docs/configuration.md.
Roadmap
See ROADMAP.md for planned features and release history.
Contributing
Contributions are welcome. See docs/contributing.md for setup, checks, the coherence eval harness, and quality-loop guidelines.
Contributors
Thank you to everyone who has helped improve this project through code, reviews, testing, and feature requests:
@Summer907 · @ebbsanchez · @VooDisss · @DerDennisOP · @deepdmk · @TheSOV · @janLo · @bbulkow · @HillsCloud · @phinnphace
[Contributors]Per-release contributor credits are listed in the Changelog.
Security
Found a vulnerability? See SECURITY.md for the threat model, reporting channel, and expected response timeline. Please do not open a public GitHub issue for unpatched security reports.
License
MIT. See LICENSE.
Links
Blog posts
The story behind the releases. Building pdf-mcp keeps surprising me: benchmarks that go the wrong way, formats that break everything, features I had to remove. I write about that thinking in The Dispatch. Come along if that's your kind of thing.
Background, benchmarks, and design notes from building pdf-mcp:
Getting started
- How I Built pdf-mcp: The problem with large PDFs in AI agents and a working solution
- How to Send PDFs Over 100 Pages to Claude's API: Measuring the real page and token ceilings on the Claude API, and the two ways around them: search the PDF on disk for questions, window the text and render only the picture pages for whole-document tasks
- How Claude Code Actually Reads PDFs: How AI agents use pdf-mcp tools to read and navigate PDF documents
- How AI Agents Should Read PDFs: 5 Patterns That Survived Production: Five production-tested patterns for how agents should navigate PDFs at scale
Corpus & multi-document search
- A Knowledge Base Is Just a Folder: Turning a folder of PDFs into an agent knowledge base with the corpus tools, no ingestion pipeline or vector store
- Cross-Document Retrieval for AI Agents Without a Vector Database: Why BM25 scores don't merge across per-document indexes but ranks do, and how two-stage RRF puts a gold document in the top 3 on 84.8% of 184 graded queries over a 100-PDF corpus
- How Amazon Bedrock Helped Me Make My RAG Better: Benchmarking pdf_corpus_search against Bedrock Knowledge Bases at an equal 2,000-token budget for four cents surfaced two bugs eight months of self-testing missed: an excerpt picker discarding answers from pages it had already retrieved, and one embedding per page hiding short answers
- Does a PDF Search Tool Still Matter for AI Agents?: Claude Code with and without pdf-mcp on 53 multi-paper questions over 120 papers: answer quality tied, but the search tool read 7.5 pages per question instead of 187 and answered in 25 seconds instead of 92
Search & retrieval
- Semantic vs Keyword Search for AI Agents: Benchmarks and a dual-search routing pattern: FTS5 for exact identifiers, embeddings for natural language
- Hybrid Search vs Query Routing for AI Agents: Why pdf-mcp uses hybrid RRF instead of query routing: benchmarks showing RRF wins across query types
- Section Chunking vs Page Chunking for AI Agents: Why section-aware search delivers full section content in one call while page-mode costs 2–6 extra tool calls per query
- Section-Level RAG: Why BM25 Beat Hybrid Search in My Benchmark: Why pdf-mcp's section-grain search is BM25-only: hybrid RRF caused a 33% lexical regression at section grain, so granularity decides the search technique
- How One Search Change Eliminated an Entire Agent Step: Switching pdf_search from fixed-width snippets to paragraph excerpts turned it from a pivot tool into a terminal tool: 97% vs 80% answer containment across a 30-query benchmark
Engineering & security
- MCP Server Security: 8 Vulnerabilities: What we found when we audited an MCP server for security holes
- Your LLM Is Free QA for Your MCP Server: Four Payload UX bugs in pdf-mcp that schema tests missed but Claude Desktop surfaced during real use
- Why Multi-Column PDFs Scramble Reading Order in RAG: Fixing two-column extraction (0.564 → 0.816 fidelity), the title-page author-grid regression it caused, and the aggregate metric that stayed blind to both
- How I Fixed Vertical Japanese PDF Extraction: Tategaki pages extract scrambled because reading order is geometric, not stored; rebuilding it from glyph positions (columns right to left, characters top to bottom), with no OCR and no new dependency
- My AI Agent Stopped Using My Own PDF Tool: The 72 DPI Bug: Phone scans silently downsampled to 72 DPI to fit the response byte budget made handwriting unreadable, so the agent routed around pdf_render_pages; the fix spends JPEG quality before resolution and makes the response say when a render is illegible and which clips to retry
- Extract Chart Data From PDFs: An MCP Tool That Won't Guess: Reading exact chart values straight from a PDF's vector geometry, then handing the ambiguous judgment calls back to the LLM instead of guessing
來源:README.md,提交 47fb2fd
工具
0版本歷史
6- v3.7.0最新Nov 7, 2026
- v3.6.0Oct 31, 2026
- v3.5.0Oct 3, 2026
- v3.4.0Sep 26, 2026
- v3.3.0Sep 19, 2026
- v3.2.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
