pdf-mcp

作者 jztan已验证

MCP server that lets Claude Code and other AI agents work through large PDFs, and whole folders of them, without overflowing context: hybrid semantic + keyword search, selective page reading, tables, images, OCR, chart data, and multi-column/CJK layouts.

116
Stars
8
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/jztan/pdf-mcp

快速入门

使用 pdf-mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

pdf-mcp

PyPI version Python 3.10+ License: MIT GitHub Issues CI codecov Downloads

Surgical PDF access for AI agents: search, read, and extract without flooding context.

An MCP server that lets Claude Code and other AI agents search a PDF 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.

mcp-name: io.github.jztan/pdf-mcp

Try it in your browser

See what your AI agent sees →

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?

Without pdf-mcp With pdf-mcp

Large PDFs Context overflow Chunked reading

Token budgeting Guess and overflow Estimated tokens before reading

Finding content Load everything Hybrid search (BM25 keyword + semantic)

Tables Lost in raw text Extracted and inlined per page

Charts Trapped in the plot image Extracted as (x, y) data tables

Multi-column PDFs Columns interleaved in extracted text Column-aware reading order, built in

Vertical scripts (Japanese) Columns scrambled / glyph soup Geometric reorder of vertical text (tategaki / 縦書き); CJK keyword search works on unspaced Japanese/Chinese/Korean text via a char-split FTS index

Images Ignored Extracted as PNG files

Repeated access Re-parse every time SQLite cache

Scanned PDFs No text extracted OCR via Tesseract, parallelized across pages (pdf_read_pages(ocr=True))

Visual content Must describe in words Render page as image (pdf_render_pages)

Hidden / injected text Silently ingested as if a human vetted it Flagged as untrusted: hidden-text detection (content_trust=True)

Folders of PDFs One document at a time Corpus tools: warm, triage, and search across a whole folder

Tool design Single monolithic tool 13 specialized tools

Features

  • Hybrid search: find relevant pages with a question, not a page range. Combines BM25 keyword and semantic search via Reciprocal Rank Fusion

  • Corpus search: point the server at a folder of PDFs: warm them into the cache, get per-document triage cards, and search across all documents at once with ranked, document-attributed hits

  • Paginated reading: fetch only the pages your agent needs; large documents don't blow your context window

  • OCR: scanned and image-based PDFs are fully readable and searchable via Tesseract, parallelized across pages for ~2–3x faster extraction on typical scans

  • Structured extraction: tables, embedded images, and table of contents returned as structured data, not text soup

  • Chart data extraction: pull exact (x, y) tables from vector charts, read from the plot geometry rather than guessed from the image; declines with a rendered image when a chart can't be read reliably

  • Vertical-script reading order: Japanese tategaki (縦書き) reconstructed from glyph geometry into correct top-to-bottom, right-to-left order; article segmentation for dense magazine layouts; mojibake filtered

  • Persistent cache: SQLite-backed; re-reads are instant and survive server restarts

  • Secure URL fetching: HTTPS-only with SSRF protection; local network ranges are blocked

  • Content-trust / hidden-text detection: flags text a human reader can't see (invisible render mode, sub-point fonts, transparent or white-on-white fill, off-page) so an agent treats it as untrusted rather than vetted. Flag-only: nothing is stripped

Contents

Installation

pip install pdf-mcp

Semantic search is included by default (hybrid auto search is built on it; ~67 MB embedding model download on first use). The former [semantic] and [cjk] extras remain as no-op aliases. Platform note: the bundled onnxruntime has no wheels for Intel macOS on Python 3.14+ or Alpine/musl; use Python ≤ 3.13 there.

Correct reading order on multi-column PDFs is built in and needs no extra. The former [multicolumn] extra remains as a no-op alias, so existing install instructions keep working.

Japanese/Chinese/Korean PDFs work out of the box: keyword search uses a char-split FTS index that matches unspaced CJK terms, and semantic CJK search is covered by the default install.

For OCR on scanned PDFs (requires system Tesseract):

# macOS
brew install tesseract

# Ubuntu/Debian
apt install tesseract-ocr

# On Windows, download the installer from:
# https://github.com/UB-Mannheim/tesseract/wiki
# Then add the install directory to your PATH.

Quick Start

Choose your MCP client below to get started:

claude mcp add pdf-mcp -- pdf-mcp

Or add to ~/.claude.json:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Restart Claude Desktop after updating the config.

Requires VS Code 1.101+ with GitHub Copilot.

CLI:

code --add-mcp '{"name":"pdf-mcp","command":"pdf-mcp"}'

Command Palette:

  • Open Command Palette (Cmd/Ctrl+Shift+P)

  • Run MCP: Open User Configuration (global) or MCP: Open Workspace Folder Configuration (project-specific)

  • Add the configuration:

{
  "servers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}
  • Save. VS Code will automatically load the server.

Manual: Create .vscode/mcp.json in your workspace:

{
  "servers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}
codex mcp add pdf-mcp -- pdf-mcp

Or configure manually in ~/.codex/config.toml:

[mcp_servers.pdf-mcp]
command = "pdf-mcp"

Create or edit .kiro/settings/mcp.json in your workspace:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "pdf-mcp",
      "args": [],
      "disabled": false
    }
  }
}

Save and restart Kiro.

Most MCP clients use a standard configuration format:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}

With uvx (for isolated environments):

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "uvx",
      "args": ["pdf-mcp"]
    }
  }
}

Verify Installation

pdf-mcp --help

Tools

The typical pattern: call pdf_info first to plan, then pdf_search to locate; its paragraph excerpts are often enough to answer directly. Use pdf_read_pages or pdf_read_all when you need deeper context. For a folder of PDFs, start with pdf_corpus_overview to triage, then pdf_corpus_search to search across documents.

Tool What it does

pdf_info Page count, metadata, TOC summary, scanned-page detection. Call first. Pass content_trust=True for a content_trust block (suspicious, hidden_text_runs, hidden_chars, injection_in_hidden, pages_flagged, signals); add detail=True for per-span spans.

pdf_get_toc Full table of contents for documents with >50 bookmarks

pdf_corpus_warm Warm a folder (or list) of PDFs into the cache, text and optional embeddings, within a time budget. Returns per-doc status plus unprocessed/skipped.

pdf_corpus_overview Per-document triage cards for a folder: title, page count, top TOC entries, text coverage. Auto-warms within the budget.

pdf_corpus_search Search across a folder of PDFs (keyword, semantic, or hybrid), returning ranked hits with document and page provenance, excerpts, and coverage.

pdf_read_pages Read specific pages or ranges; OCR-on-demand; embedded images + tables, each with source bbox + clip coordinates. Always returns hidden_text_detected (response level) and per-page hidden_text; `hidden_text_detected:

常见问题

What is pdf-mcp?

pdf-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by jztan. MCP server that lets Claude Code and other AI agents work through large PDFs, and whole folders of them, without overflowing context: hybrid semantic + keyword search, selective page reading, tables, images, OCR, chart data, and multi-column/CJK layouts. It has 116 GitHub stars.

Is pdf-mcp safe to use?

Yes. pdf-mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install pdf-mcp?

Clone the repository with "git clone https://github.com/jztan/pdf-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is pdf-mcp written in?

pdf-mcp is primarily written in Python. It is open-source under jztan on GitHub, so you can review or fork the full source.

Are there alternatives to pdf-mcp?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh pdf-mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情