
Paperless-ngx
io.github.tobee89由 GitHub 帳號 tobee89 發布v0.1.1更新於 Oct 24, 2026
MCP server for Paperless-ngx 3.x — full REST API coverage, schema-aware, token-frugal.
概覽
讓助理透過 REST API 在 Paperless-ngx 3.x 執行個體中搜尋、讀取、上傳、標記與管理文件。
- 可以做什麼
- 把 Paperless-ngx 3.x 的 REST API(版本 10)包裝成 MCP 工具,92 個已記錄端點不是提供為工具,就是在程式碼中註明排除原因。工具集依文件、中繼資料、自訂欄位、檢視、分享、工作流程、系統、郵件與管理分組。清單回應在伺服器端裁剪,預設不傳回完整 OCR 文字,文件內文由另一個分頁工具取得。triage_inbox、find_document、audit_sharing 等提示引導常見文件流程。
- 適用情境
- 適合讓助理操作自架的 Paperless-ngx 文件庫:搜尋與閱讀文件、設定標籤、通信對象與文件類型、上傳檔案,或檢視分享連結。僅支援 Paperless-ngx 3.x,不支援 2.x。
- 執行需求
- 需要本機 Node.js 執行環境,透過 npx 執行 npm 套件 mcp-paperless-ngx,並能連線到 Paperless-ngx 執行個體。必填:PAPERLESS_URL 與 API 權杖 PAPERLESS_TOKEN(PAPERLESS_API_KEY 亦可)。選用變數涵蓋工具集、唯讀模式、額外請求標頭、下載目錄、分頁大小、逾時、公開 URL 與 API 版本。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Paperless-ngx,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-paperless-ngx
A Model Context Protocol server for
Paperless-ngx 3.x
Full REST API coverage, schema-aware, token-frugal.
[License: MIT] [Node 20+] [Paperless-ngx 3.x] [REST API v10] [Endpoint coverage 92/92] [Glama quality score]
Built against REST API version 10, with three things it does differently:
- Accounted coverage. Every one of the 92 documented endpoints is either exposed as a tool or
listed in
src/tools/coverage.tswith a written reason for leaving it out. A test enforces this, so a Paperless release that adds an endpoint fails CI instead of quietly going unsupported. - Token discipline. A Paperless document carries its full OCR text. Naive wrappers return it by
default and a single search can exhaust the model's context. Here, list results are trimmed
server-side via
?fields=, the text lives behind its own paginated tool, and no list endpoint hands the raw API response through — a test enforces that. See Context cost. - Scoped surface. 99 tools would drown a model's tool list. Toolsets let you expose only what a
given client needs, and
--read-onlyremoves every write path entirely.
Paperless-ngx 2.x is not supported: API version 10 introduced endpoints (nested tags, document
versions, share_link_bundles, the split PDF operations) that this server assumes exist.
Quick start
Claude Code
Claude Desktop, Cursor, Cline, and other MCP clients
Getting an API token
Paperless web UI → your username (top right) → My Profile → the circular arrow button next to the API token field.
Configuration
CLI flags --url, --token, --public-url, --toolsets and --read-only override the
environment. --check verifies connectivity, --list-tools prints the enabled tools.
Toolsets
mail and admin are off by default because most sessions never need them and every extra tool
costs context on every request. Enable them explicitly:
Context cost
Wrapping an API for a language model has a cost the API itself does not: everything the model sees is paid for on every request. Two places where that bites, and what this server does about them.
Responses. Three shapes are expensive in Paperless and easy to return by accident:
Tool definitions. These are the larger and less obvious cost: names, descriptions and JSON schemas ship with every request, whether or not any tool is called.
There is no way to make that free — it is the price of a tool the model can use without guessing.
But it is worth being deliberate: if your sessions only ever search and file documents, running
PAPERLESS_TOOLSETS=documents,metadata saves more context than any response-trimming does.
Safety
The server exposes destructive operations, because a document manager without them is not much of a manager. It does not try to guess when they are appropriate — that judgment belongs to the client and the user. What it does instead:
- Destructive tools are annotated
destructiveHint: true, so MCP clients can require confirmation. - Tool descriptions state plainly what cannot be undone (
empty_trash,delete_custom_field,delete_originals) and ask for confirmation before the call. --read-onlyremoves every write tool from the list, rather than refusing them at call time.- Bulk endpoints support an "apply to everything matching this filter" mode. This server does not expose it: bulk tools take explicit ID lists, so a wrong filter cannot silently affect the entire archive.
create_share_linkproduces a publicly reachable URL. Its description says so, and theaudit_sharingprompt exists to review what is already exposed.
Credential-adjacent endpoints (token generation, TOTP enrolment, disabling someone's second factor)
are deliberately not exposed. See EXCLUDED_ENDPOINTS for the full list and the reasoning.
Prompts
Registered as slash commands in clients that support MCP prompts:
Testing
Three layers, because they catch different things:
npm test checks this server's own reasoning: endpoint coverage, enum values
against the schema, that no list tool leaks raw API objects, that read-only mode
really removes writes.
smoke-test.mjs checks the assumptions it makes about Paperless. It calls every
read-only tool against a real instance, resolving IDs from list calls instead of
hard-coding them, and prints response sizes so expensive tools stay visible. It
writes nothing.
write-test.mjs covers the rest: upload and consumption, updating every field
type, notes, bulk tag edits, share links, rotation, and a trash round trip.
It only touches objects it creates itself. Everything it makes is named with a
zz-mcp-testprefix and deleted again at the end, and it never modifies a document it did not upload. If a run is interrupted, leftovers with that prefix are safe to delete. Prefer a test instance if you have one.
Keeping up with Paperless
sync-schema.mjs regenerates schema/endpoints.json from your own instance's OpenAPI document.
The test suite then reports any endpoint that is neither exposed nor explicitly excluded. That is
the whole maintenance loop: point it at a newer Paperless and the test tells you what changed.
Development
Prior art
Several MCP servers for Paperless-ngx exist, and the two most active both work against 3.x:
cubinet-code/paperless-ngx-mcp adapts
between 2.x and 3.x automatically, and baruchiro/paperless-mcp
lets you choose the API version (PAPERLESS_API_VERSION, default 9). If you need to support
both majors from one install, use one of those.
This server takes the opposite trade: it assumes API version 10 and nothing older. That is what
lets it reach the endpoints 3.x introduced — nested tags, document versions, share_link_bundles,
the standalone PDF operations — and lets a test assert that all 92 documented endpoints are
accounted for. It also trims list responses server-side via ?fields=, so OCR text does not ride
along by default.
License
MIT. See LICENSE.
Built by eichner.cloud — self-hosted, and rather attached to it.
來源:README.md,提交 b95069c
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分