
Benspdf
io.github.benbergner由 GitHub 帳號 benbergner 發布v0.3.0更新於 Oct 24, 2026
Read PDFs locally: text, pages, metadata, scan detection, layout, permissions, render, OCR.
概覽
在本機讀取與檢查 PDF 檔案——文字、頁數、中繼資料、版面、權限、算圖與 OCR——不需上傳。
- 可以做什麼
- BensPDF 透過 MCP 提供 PDF 工具:計算頁數、讀取文件屬性、逐頁擷取文字、查看頁面尺寸與頁面框、檢查加密與列印/複製/編輯權限、將頁面算繪成圖片,以及對掃描檔做 OCR,並可加上可搜尋的文字層。它也能產生臨時測試 PDF、用匯出工具把結果存到磁碟,並列出或刪除暫存產物。新檔案先放進暫存資料夾,以短 id 表示,其他工具可直接用該 id 取代路徑。
- 適用情境
- 適合讓助理回答本機 PDF 的相關問題,例如頁數、內容、中繼資料,或判斷檔案是否為需要 OCR 的掃描檔。也適合在決定如何處理文件前檢查權限,或將頁面算繪成圖片。
- 執行需求
- 以 stdio 本機程序執行,透過 uvx benspdf-mcp 啟動,因此需要 uv(首次執行會取得合適的 Python)。OCR 需要另外安裝 tesseract 系統程式,僅在呼叫 pdf_ocr 時檢查。未宣告帳號、API 金鑰或標頭。暫存資料夾預設為 ~/.benstools/work,可用 BENSTOOLS_WORKSPACE 更改。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Benspdf,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
BensPDF
PDF tools for AI agents. Your files never leave your machine.
[PyPI] [Python versions] [License] [MCP registry]
Install in one click
Ben's PDF tools for AI agents, exposed over the Model Context Protocol (MCP).
[!NOTE] Your PDFs are read on your own machine and never uploaded. With a hosted model your questions still reach that model; pair the tools with a local Ollama model and nothing leaves the machine at all.
Works with Claude Desktop, Claude Code, VS Code, Kiro, Cursor, the ChatGPT desktop app, and any other MCP client. The one-click buttons above need uv; for every other client, or to do it by hand, see Setup.
Tools
Every tool but one needs nothing beyond the package. pdf_ocr uses
tesseract, a system program rather
than a Python package, and only looks for it when you actually call it — so
install it if and when you want OCR (brew install tesseract, sudo apt install tesseract-ocr, or winget install UB-Mannheim.TesseractOCR), and everything else
works either way.
Where results go
When a tool makes a new PDF, it goes into a scratch folder instead of your own
folders, and you get back a short id like art_a1b2c3d4.pdf. Tools accept those
ids anywhere they accept a file path, so several steps can be chained together.
Results carry the artifact's path as well as its id, so you can open a rendered
page or an intermediate file straight away without exporting it first.
export is the only tool that writes into your folders, so nothing shows up
until you ask for it. Each time the server starts it clears out scratch files
older than 7 days. Set BENSTOOLS_WORKSPACE to put the scratch folder somewhere
other than ~/.benstools/work.
Setup
Install uv
once, then point your client at uvx benspdf-mcp and uv fetches the package,
plus a suitable Python, on first run.
On macOS, brew install uv works too.
Add the server to your client with one of the configs below, then restart the server from your client's UI. Once connected, just ask in plain language:
How many pages are in ~/Downloads/report.pdf?
Claude Desktop
Edit claude_desktop_config.json, which lives at
~/Library/Application Support/Claude/ on macOS and %APPDATA%\Claude\ on
Windows. You can also open it from Settings → Developer → Edit Config.
Claude Code
One command, no config file. Add --scope user to enable it everywhere rather
than just the current project.
Check it connected with claude mcp list.
VS Code
.vscode/mcp.json in your workspace, or the same file in your user profile.
Note VS Code uses servers rather than mcpServers, and wants an explicit
type.
Kiro
.kiro/settings/mcp.json in your workspace, or ~/.kiro/settings/mcp.json to
enable it everywhere. autoApprove skips the confirmation prompt for tools you
trust.
Cursor
The button at the top does this for you. By hand, it's ~/.cursor/mcp.json to
enable it everywhere, or .cursor/mcp.json in a project.
Windsurf
~/.codeium/windsurf/mcp_config.json. You can also reach it from Cascade:
Settings → Cascade → Manage MCPs → View raw config, which is worth using
since the path has moved between versions.
Continue
~/.continue/config.yaml, or a .yaml file under .continue/mcpServers/ in a
project. Continue is the one client here that doesn't take the JSON shape above:
its config is YAML, and mcpServers is a list rather than an object keyed by name.
ChatGPT desktop app, Codex CLI, Codex IDE extension
All three are Codex clients and share one config file, ~/.codex/config.toml,
so adding the server once covers all of them. Note this one is TOML, not JSON.
Any other MCP client
Almost every client uses the same JSON as Claude Desktop above — an mcpServers
object, with command set to uvx and args to ["benspdf-mcp"]. Some want an
explicit "type": "stdio"; adding it is harmless where it isn't required.
If a client just asks for a command to run, it's:
Fully offline with Ollama
The clients above keep your PDFs local, but they answer using a hosted model. Pair the tools with a local model instead and nothing leaves your machine.
You'll need Ollama with a model pulled, plus this package:
Then run the bundled CLI:
python -m benspdf.cli does the same thing, handy from a source checkout.
Reference
Each tool's own description tells your client what it does and when to use it, so in normal use there is nothing to look up. If you want the detail — every field a tool returns, and the reasoning behind the answers it gives — see the tool reference.
To work on the code, see CONTRIBUTING.md.
License
Apache 2.0
來源:README.md,提交 b446478
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分