
Sezzlee PDF
io.github.sezzlee由 GitHub 帳號 sezzlee 發布v0.1.2更新於 Oct 24, 2026
Extract text from local PDF documents with optional pluggable OCR. Read-only, no network.
概覽
唯讀的本機 MCP 伺服器,讓助理在沙箱目錄內列出、描述、讀取與搜尋 PDF 文件,可選擇接入 OCR。
- 可以做什麼
- 在沙箱根目錄下列出可讀取的 PDF 候選檔案,支援子目錄、樣式比對與結果數量上限
- 描述文件:頁數、文件類型、各頁是否需要 OCR 以及伺服器能力
- 以 Markdown 讀取指定頁面,頁碼從 1 開始,支援游標續讀
- 對擷取出的文字做字面搜尋,回傳頁碼與符合內容的上下文
- 回報搜尋涵蓋範圍,標出仍需 OCR 的頁面
- 適用情境
- 適合助理需要根據本機 PDF 集合(例如報告、論文、掃描檔)回答問題,又不希望把檔案上傳到外部服務的情況。它著重唯讀的文件查閱與文字搜尋,而非編輯或格式轉換。
- 執行需求
- 透過 npx 從 npm 套件 @sezzlee/pdf-mcp 以 stdio 在本機執行,必須以參數提供 PDF 來源根目錄路徑。OCR 預設關閉,需以 --ocr 指定提供光柵化器與辨識提供者的模組。平台支援範圍較窄:缺少對應二進位檔的主機會在啟動時以結束碼 3 停止。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sezzlee PDF,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@sezzlee/pdf-mcp
A read-only, sandboxed MCP server for local PDF documents. It builds on @sezzlee/file-core,
which supplies sandbox path resolution, the response budget, the error envelope, cursors and the
document cache. Text extraction uses @firecrawl/pdf-inspector. The server never reaches the
network: OCR is optional, and when it is enabled, the connection decision belongs entirely to
whoever supplies the two injected ports.
Quick start
To enable OCR, point --ocr at a module whose default export is an OcrBinding (see
Configuration and OCR):
Tools
If the file path is already known, describe_document is optional: read_pages and
find_in_document work from filePath alone.
Configuration
CLI (sezzlee-pdf <pdf-source-root> [--ocr <module>]):
Programmatic (createPdfMcpServer(root, options)):
OCR
The server does not perform OCR; it supports it. Two ports are injected — neither the raster library nor the model client is a dependency of this package.
The server does exactly this: it renders the pages the text layer could not answer, recognizes
the resulting images, substitutes the result for that page, and marks it source: "ocr".
Programmatic binding:
CLI binding — a module whose default export matches OcrBinding, loaded with --ocr <module>
(see examples/ollama-binding.ts in this package for a working example built from
@sezzlee/pdf-raster-pdfjs and @sezzlee/ocr-ollama):
OCR rules
ocr: truewith no provider bound is an error (ocr_unavailable), never a silent fall back to the text layer. Otherwise an agent that asked for OCR could mistake "nobody transcribed this document" for "no match".describe_document→capabilities.ocrreports whether one is bound.- An empty transcription does not count as an answer. If the provider returns empty text, the
page stays
needsOcr— "the model returned nothing" is not the same as "this page is blank". - An unrequested page is ignored. The ports may reorder, skip, or invent pages; results are matched to the page number that was requested, so a provider cannot overwrite a page the text layer already trusted.
- Bytes leave the process. Binding a provider means those pages' pixels go somewhere else. OCR therefore defaults to off and is requested explicitly on every call.
- A page is not re-transcribed on every call. Transcriptions are cached by document fingerprint plus page number. The cache is not a progress log: a search sends only the pages after the cursor to OCR and carries coverage forward in the cursor, so even a large document is eventually walked to the end from cache.
- An expired job does not release its slot. Neither the engine nor an injected port can cancel work that has already started; the slot stays held until the work actually finishes. A provider that never returns can only be recovered by restarting the server — reclaiming the slot on a timer would only postpone the limit.
Rules
- Every page number on the public surface is 1-based. The underlying library returns some
fields 0-based and others 1-based within the same result object. The whole conversion lives in
src/engine/, and lint bans importing@firecrawl/pdf-inspectoroutside that folder — a second import site would reintroduce the bug (measured on 1.23.0:PageMarkdownResult.pageis 0-based, siblingpagesNeedingOcris 1-based). - Page selection is validated before it reaches the library. An out-of-range index otherwise
comes back as a phantom page marked
needsOcr; a negative index wraps through u32. Both would look like a real page to the agent. describe_documentnever builds its OCR page list from the classifier.classifyPdfmarks every page of a document that contains a single scanned page. The list comes from the per-page extraction instead.classificationConfidenceis confidence in the classifier's own verdict, not in any extracted text's accuracy.- An unreadable page is never presented as an empty one. A scanned page returns
needsOcr: true;emptyistrueonly for a page the engine trusted and found genuinely blank. - Search coverage is reported on every response. When any page needs OCR,
coverageCompleteisfalse, and an empty match list is not proof the query is absent from the whole document. - A document is extracted once, in full; the response is paginated. Measurement showed that
requesting a single page cuts extraction cost by a third, not 200-fold — the fixed cost
dominates. Cursor identity depends on document content and OCR mode, not page size. An explicit
pagesselection is preserved across a cursor: it carries forward the rest of that selection and never wanders into unselected pages. A cursor resuming inside a page carries that page's text fingerprint; if the text changed since transcription, the response isstale_cursorrather than silently skipping content. - The server never reaches the network.
fetch,node:http,node:netand their siblings are lint-banned insidesrc/, and the ban is repeated in every layer's override — a later oxlint override replacesno-restricted-importsrather than merging with it, so a single top-level ban would not apply everywhere. - Platform support is narrow. The engine ships no
darwin-x64binary and its wasm fallback is unpublished. On an unsupported host the server stops at startup with a one-line message (exit code 3).
Development
Tests: pnpm turbo run test --filter=@sezzlee/pdf-mcp (Vitest). A live-Ollama suite
(test/ocr-live.spec.ts) is skipped unless SEZZLEE_PDF_OCR_URL is set; it also reads
SEZZLEE_PDF_OCR_MODEL (default deepseek-ocr:3b). Everything else in test/ocr.spec.ts runs
against fake ports; the live suite only proves the two real adapters compose.
來源:packages/servers/pdf-mcp/README.md,提交 37f6849
工具
0版本歷史
1- v0.1.2最新Oct 11, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
