
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 分