
PDF Triage
io.github.vishalmeena2211由 GitHub 账号 vishalmeena2211 发布v0.1.2更新于 Oct 24, 2026
Read local PDFs without uploading. Classifies first, flags untrustworthy text, bounds output.
概览
让助手在不上传文件的情况下读取本地 PDF,先对文件分类并标记不可靠的文本提取结果。
- 可以做什么
- 以 stdio 方式在本地运行,提供四个只读工具:pdf_classify 报告文档类型、置信度、页数和需要 OCR 的页面;pdf_extract 将 PDF 转为 Markdown;pdf_search 返回带页码的文本片段;pdf_tables 只返回管道表格。当检测到编码问题或扫描页时,每条响应都会在正文之前给出可信度警告,输出默认截断并说明如何分页读取。
- 适用场景
- 适合助手需要读取必须留在本机的 PDF,以及希望在信任文本之前先确认提取是否真的成功。先分类的流程适用于不熟悉或很长的文档,用一次低成本检查避免把上下文浪费在扫描件或乱码文件上。
- 运行要求
- 需要 Node.js 20 或更高版本;通过 npx 以 pdf-triage-mcp 运行,或使用本地构建。必须提供至少一个 --root 目录(绝对路径,可重复)。可选环境变量 PDF_TRIAGE_LOG_LEVEL、PDF_TRIAGE_MAX_CHARS、PDF_TRIAGE_MAX_FILE_BYTES 用于调整日志与限制。无需账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 PDF Triage,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
pdf-triage-mcp
[npm] [CI] [MCP Registry] [License: MIT]
An MCP server that lets any AI tool read local PDFs — without uploading them, without an OCR bill, and without silently handing back garbage.
Built on @firecrawl/pdf-inspector (Rust, no ML models, no external services).
Table of contents
- Why this exists
- Install
- Connect it to your AI tool — 12 clients
- Tools
- Configuration
- Engine fallback
- Known limitations
- Development
Why this exists
Most PDF tooling has the same failure mode: it returns confident text regardless of whether extraction actually worked. Broken CID fonts, substitution-cipher encodings, scanned pages with no text layer — you get plausible-looking output and find out downstream, if at all.
pdf-inspector is unusually good at knowing when it failed. It emits U+FFFD rather than guessing at an unmapped CID, runs substitution-cipher detection over its own output, and reclassifies a document as scanned when extracted text drops below 50% alphanumeric. But it stops at reporting those findings on a result object — and most wrappers throw them away.
This server acts on them. Every response carries the trust signals, above the content, where the model reads them first:
Three design rules follow:
- Classify before extracting.
pdf_classifycosts ~20ms and tells you whether extraction is worth attempting at all. - Bound every output. A 300-page PDF is easily 500k tokens. Everything truncates by default and tells you how to page through instead.
- Confine every path. A model that has just read an untrusted document must not be talkable into reading
~/.ssh/id_rsa. Enforced in code, not left to the model's judgement.
Install
Nothing to install. Every config below runs the published package straight from npm:
Your MCP client runs that for you — you only need to paste the config. Confirm it works first:
Requires Node 20+. Available on npm as pdf-triage-mcp and in the MCP Registry as io.github.vishalmeena2211/pdf-triage-mcp.
From source instead (for development)
Then substitute "command": "node", "args": ["/absolute/path/to/dist/index.js", ...] for the npx invocation in any config below.
Connect it to your AI tool
Every config below is complete as written except for one value:
/Users/me/Documents— replace with the directory the server may read. This is the only thing you must change.
Use an absolute path; ~ is not expanded by most clients. Repeat --root for multiple directories.
PATH gotcha, applies to every GUI client below. Desktop apps launch servers with a minimal environment, so bare
npxoften fails to resolve even though it works in your terminal. If the server won't start, substitute the absolute path — find it withwhich npx(commonly/opt/homebrew/bin/npxon Apple Silicon,/usr/local/bin/npxon Intel macOS).
Why
-y? It skips npx's install confirmation prompt. Without it, a first run can hang waiting for input that an MCP client cannot provide — the server appears to start and then silently times out.
1. Claude Desktop
Config file
Verify: Fully quit and relaunch Claude Desktop (not just close the window). A tools icon appears near the chat input — click it and confirm the four pdf_* tools are listed.
Logs: ~/Library/Logs/Claude/mcp*.log (macOS), %APPDATA%\Claude\logs\mcp*.log (Windows).
2. Claude Code
CLI — the easiest route. The -- separator is mandatory; everything after it is the server command.
Or edit .mcp.json at the project root directly:
Verify: claude mcp list → look for ✔ Connected. Project-scoped servers need approval on first use — run /mcp inside a session.
3. Cursor
Config file: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). Project wins on conflict.
Verify: Cursor hot-reloads — no restart. Open Cursor Settings → Tools & MCP and look for a green dot next to pdf-triage.
4. Windsurf
Config file: ~/.codeium/windsurf/mcp_config.json (macOS/Linux), %USERPROFILE%\.codeium\windsurf\mcp_config.json (Windows).
Not created on first launch — create it yourself if missing.
Verify: Windsurf watches the file and hot-reloads on save. Tools appear in Cascade on the next chat session.
5. VS Code + GitHub Copilot
The key is
servers, notmcpServers. This is the most common mistake when copying a config from Claude Desktop.
Config file: .vscode/mcp.json (workspace), or Command Palette → MCP: Open User Configuration (global).
CLI alternative:
Verify: MCP tools only work in Agent mode — switch from Ask/Edit to Agent in Copilot Chat, then click Configure Tools and confirm the pdf_* tools appear. Restart VS Code after first adding the file.
6. Zed
The key is
context_servers, notmcpServers, andcommandis a nested object rather than a string.
Config file: ~/.config/zed/settings.json (macOS/Linux), %APPDATA%\Zed\settings.json (Windows). Command Palette → zed: open settings.
If your Zed version rejects that, it predates the nested form — try command, args and env flat at the top level of the server object instead.
Verify: Agent Panel (Cmd+Shift+A) → gear icon → MCP Servers. Green dot means connected.
7. Cline (VS Code extension)
Config file — separate from VS Code's own:
autoApprove runs the listed read-only tools without a confirmation prompt.
Easier route: Cline panel → MCP servers icon → Edit MCP Settings opens this file directly.
Verify: Panel refreshes automatically; green dot next to the server.
8. Continue.dev
Config file: ~/.continue/config.yaml (global) or .continue/config.yaml (project). YAML is current; config.json is deprecated.
mcpServershere is a list, not an object — and YAML needs spaces, never tabs.
Verify: Reloads automatically on save. Switch Continue to Agent mode — MCP tools are unavailable in other modes.
9. Google Gemini CLI
CLI:
Or edit ~/.gemini/settings.json (global) / .gemini/settings.json (project):
Verify: Run /mcp inside a gemini session — servers show CONNECTED with their tool list. Or gemini mcp list from the shell.
10. OpenAI Codex CLI
Config file: ~/.codex/config.toml (global) or .codex/config.toml (project).
TOML, and the key is
mcp_servers— snake_case, nevermcpServers.
Verify: codex doctor --json validates the config syntax. Note that it validates syntax only — it does not confirm the server actually spawned.
Known upstream issue: several Codex CLI versions have a bug where stdio servers validate cleanly but silently fail to start, showing
Tools: nonein the TUI (#3441, #26810). That is a Codex runtime bug, not a config error.
11. JetBrains AI Assistant / Junie
AI Assistant — configured through the IDE, no file to edit:
- Settings → Tools → AI Assistant → Model Context Protocol (MCP)
- Add → transport STDIO
- Paste:
- OK → Apply
Junie uses a file instead — ~/.junie/mcp/mcp.json (global) or .junie/mcp/mcp.json (project), same JSON shape.
Verify: Check the Status column in the MCP settings panel; click it to list the server's tools.
12. LM Studio
Config file: ~/.lmstudio/mcp.json (macOS/Linux), %USERPROFILE%\.lmstudio\mcp.json (Windows).
Easier via the app: right sidebar → Program tab → Install → Edit mcp.json.
Verify: Auto-reloads on save; tools appear in the Program panel. LM Studio shows a confirmation dialog the first time a model calls a tool.
Cheat sheet
The three that differ: VS Code (servers), Zed (context_servers + nested command), Codex (TOML mcp_servers). Everything else takes the Claude Desktop format verbatim.
Tools
Full parameter reference: docs/TOOLS.md.
The intended flow on an unfamiliar document:
Configuration
Environment equivalents: PDF_TRIAGE_ROOTS (separated by the platform PATH delimiter — : on macOS/Linux, ; on Windows), PDF_TRIAGE_MAX_CHARS, PDF_TRIAGE_MAX_FILE_BYTES, PDF_TRIAGE_LOG_LEVEL. Flags win over environment.
Roots are a security boundary, not a convenience. Grant the narrowest directory that works. Paths are resolved through symlinks before checking, so a link inside a root pointing outside it is rejected rather than followed.
Engine fallback
Upstream ships prebuilt native binaries for exactly three targets: linux-x64-gnu, darwin-arm64, win32-x64-msvc. No musl build, no Linux ARM64 build (upstream #216) — so it fails to load on Alpine containers, Graviton instances, and most edge runtimes.
This server prefers native and falls back to WASM, which runs anywhere. Capability differences are surfaced, never faked:
Check which engine you got: pdf_classify reports it, and the server logs engine selected at startup.
Known limitations
Inherited from upstream. Worth reading before you trust output:
- RTL scripts are broken. Arabic and Hebrew return in visual order, reversed and unusable, while being reported as
text_basedwith high confidence (#212). This server detects and escalates it — the one upstream failure mode we actively guard. - No xref recovery. Malformed PDFs that
pypdfandpdfiumsilently repair will throw (#228). - Japanese CIDFontType0 (CFF) subset fonts can decode to unrelated glyphs (#208).
- Multi-column reading order may emit in raster order on some layouts despite columns being detected (#219).
- Images are not PDFs. A scanned JPEG has no text layer; the server rejects non-PDF input rather than pretending otherwise.
Development
The TypeScript config runs every strictness flag including exactOptionalPropertyTypes and noUncheckedIndexedAccess. Upstream responses are validated with Zod at the boundary rather than cast — see docs/ARCHITECTURE.md for why.
Debug a client connection:
Troubleshooting: docs/TROUBLESHOOTING.md.
Roadmap
-
pdf_regions— bbox-scoped extraction for hybrid model pipelines - Positioned-item tool exposing
{page, bbox}for visual citation UX - Integration tests asserting native and WASM produce identical normalized shapes
- Optional OCR adapter interface, closing the routing loop end to end
License
MIT
来源:README.md,提交 d653691
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分