mcp-paperless-ngx
Provides integration with Paperless-ngx, enabling AI agents to search, manage, and organize documents, tags, correspondents, document types, custom fields, views, sharing, and workflows. Includes read-only and write operations, bulk editing, and prompts for triage and audit.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-paperless-ngxsearch my documents for 'tax return'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
npx -y mcp-paperless-ngx --check # verify connectivity, then exitClaude Code
claude mcp add paperless --scope user \
--env PAPERLESS_URL=https://paperless.example.com \
--env PAPERLESS_TOKEN=your-api-token \
-- npx -y mcp-paperless-ngxClaude Desktop, Cursor, Cline, and other MCP clients
{
"mcpServers": {
"paperless": {
"command": "npx",
"args": ["-y", "mcp-paperless-ngx"],
"env": {
"PAPERLESS_URL": "https://paperless.example.com",
"PAPERLESS_TOKEN": "your-api-token"
}
}
}
}Getting an API token
Paperless web UI → your username (top right) → My Profile → the circular arrow button next to the API token field.
Related MCP server: paperlessngx-mcp
Configuration
Variable | Required | Default | Purpose |
| yes | — | Base URL the server talks to. |
| yes | — | API token. |
| no |
| URL used when building links for the user, if the instance is reachable under a different name from outside. |
| no | see below | Comma-separated toolsets, or |
| no |
| Expose only tools that cannot change anything. |
| no | — | Extra request headers, as JSON ( |
| no | system temp | Where downloaded files are written. |
| no |
| Hard ceiling on list page sizes, whatever the model asks for. |
| no |
| Request timeout. |
| no |
| REST API version sent in the |
CLI flags --url, --token, --public-url, --toolsets and --read-only override the
environment. --check verifies connectivity, --list-tools prints the enabled tools.
Toolsets
Toolset | Default | Contents |
| on | Search, read, update, delete, upload, download, notes, bulk and PDF operations |
| on | Tags, correspondents, document types, storage paths |
| on | Custom field definitions |
| on | Saved views |
| on | Share links and share link bundles |
| on | Automation rules, triggers, actions |
| on | Global search, statistics, status, tasks, trash |
| off | IMAP accounts, mail rules, processed mail |
| off | Users, groups, profile, configuration, logs (read-only) |
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:
PAPERLESS_TOOLSETS=documents,metadata,system,mail
PAPERLESS_TOOLSETS=allContext 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:
Source | Problem | Handling |
Document lists | Every document carries its full OCR text in |
|
| Returns hydrated | Documents are summarised, other types reduced to id + name |
Workflows, mail rules, groups, tasks | 27–34 fields per object, nested trigger/action definitions inline | Summarised to identifying fields; nested lists collapse to counts. |
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.
Toolsets | Tools | Approximate cost per request |
| 99 | ~20,500 tokens |
default | 85 | ~18,500 tokens |
| 49 | ~12,900 tokens |
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:
Prompt | What it does |
| Walks untriaged documents, proposes metadata preferring existing entries, applies nothing until the user approves. |
| Locates a document from a vague description, searching cheaply before searching broadly. |
| Reviews every public share link and flags the ones that never expire. |
Testing
Three layers, because they catch different things:
npm test # logic — no network
PAPERLESS_URL=… PAPERLESS_TOKEN=… \
node scripts/smoke-test.mjs # all 55 read-only tools, live
PAPERLESS_URL=… PAPERLESS_TOKEN=… \
node scripts/write-test.mjs # writes, live — see the warningnpm 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
PAPERLESS_URL=… PAPERLESS_TOKEN=… node scripts/sync-schema.mjs
npm testsync-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
npm install
npm start # run from source
npm run build # compile to build/
npm test # unit tests + coverage checks
npm run inspect # build, then open the MCP inspectorPrior art
Several MCP servers for Paperless already exist, most notably cubinet-code/paperless-ngx-mcp, and also nloui/paperless-mcp and barryw/PaperlessMCP. They target the 2.x API. If you run Paperless-ngx 2.x, use one of those; this one assumes 3.x.
License
MIT. See LICENSE.
This server cannot be installed
Maintenance
Related MCP Servers
- AlicenseCqualityAmaintenanceAn MCP (Model Context Protocol) server for interacting with a Paperless-NGX API server. This server provides tools for managing documents, tags, correspondents, and document types in your Paperless-NGX instance.23363137TypeScriptISC
- FlicenseAqualityBmaintenanceA privacy-first MCP server for Paperless-ngx that lets an LLM agent search, organize, tag, and reference documents without exposing full text unless explicitly requested.13
- FlicenseAqualityCmaintenanceMCP server for Paperless-ngx document management. Enables AI models to search, retrieve, update documents and manage metadata.7
- AlicenseNot gradedqualityAmaintenanceA read-only and write MCP server for Paperless-ngx, enabling document listing, metadata retrieval, and creation of tags, correspondents, document types, and sorting workflows via natural language.MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tobee89/mcp-paperless-ngx'
If you have feedback or need assistance with the MCP directory API, please join our Discord server