paperless-ngx MCP server
An MCP server that puts a paperless-ngx document archive in reach of an AI assistant: search, read, file, upload — with ids resolved to names and destructive actions gated behind confirm: true.
Search & read —
paperless_search_documents(full-text query syntax plus filters likecreated_after,tags_all,title_contains,more_like_id, custom-field queries, pagination, highlights) andpaperless_get_document(metadata, extracted text, notes, custom fields).Fetch files —
paperless_download_documentwrites the original, archived OCR PDF, preview or thumbnail intoPAPERLESS_DOWNLOAD_DIR(confined, symlink-resolved).Add documents —
paperless_upload_documentconsumes a file fromPAPERLESS_UPLOAD_DIRS, optionally pollingwait_secondsfor the resulting document id.Edit metadata —
paperless_update_document(title, dates, correspondent, type, tags, custom fields, clear-* flags) andpaperless_bulk_edit_documents(one operation across many docs;deleteneeds confirmation).Filing help —
paperless_get_document_suggestionsreturns what paperless' own matching would file a document as.Notes —
paperless_document_noteslists, adds or deletes free-text notes on a document.Taxonomy —
paperless_list_objects(tags, correspondents, document types, storage paths, custom fields, saved views, users, groups, mail accounts, mail rules, workflows, share links), plus create / update / delete counterpart tools; name → id in one call.System & tasks —
paperless_get_statistics,paperless_get_system_status,paperless_list_tasks(follow up on uploads by task id).Escape hatch —
paperless_api_requestreaches any REST endpoint the tools above don't cover.Resources —
paperless://taxonomyandpaperless://statistics.Guardrails —
PAPERLESS_READ_ONLYblocks modifications outright; destructive tools requireconfirm: true; output is truncated by default; runs over stdio or http (with bearer auth and DNS-rebinding host/origin allowlists when exposed).
Provides tools for interacting with a Paperless-ngx document archive, including full-text search, retrieving and downloading documents, uploading new documents, updating metadata, bulk editing, managing tags, correspondents, document types, and other taxonomy objects, as well as viewing statistics and system status.
Click on "Deploy 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., "@paperless-ngx MCP server find invoices from ACME Corp from last month"
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.
paperless-ngx MCP server
An MCP server that puts a paperless-ngx document archive in reach of an AI assistant: full-text search, reading documents, filing them, and uploading new ones.
It talks to the paperless-ngx REST API over HTTP, so it works against any reachable instance — local, LAN, or remote behind a reverse proxy.
Why the tools look the way they do
The paperless API refers to tags, correspondents, document types and storage paths by numeric id, and returns bare ids on every document. That is awkward for a model. So this server:
resolves ids to names in all output, so a search result reads
"correspondent": "ACME Corp"rather than"correspondent": 7;exposes a
paperless_list_objectstool (and apaperless://taxonomyresource) for going the other way, name → id, in a single call;takes friendly filter names (
created_after,tags_all,title_contains) and translates them into the API'screated__gte/tags__id__all/title__icontainsform;truncates document text and raw responses by default, so one call cannot swamp the context;
requires an explicit
confirm: trueon anything destructive.
Related MCP server: paperless-mcp
Two ways to run it
MCP has two transports, and which one you want depends on how the client reaches the server:
stdio (default) — the client spawns the server as a subprocess and talks over stdin/stdout. This is what Claude Code and Claude Desktop do, and what you want in almost all cases.
http — one long-lived server listening on a port, which several clients can connect to.
Set MCP_TRANSPORT=stdio or MCP_TRANSPORT=http.
Setup
First get an API token from the paperless web UI: user menu → My Profile → the circular arrow next to API Token.
Nothing to clone or build — npx fetches the package on demand.
Claude Code, as a plugin (recommended)
claude plugin marketplace add patrickcylai/paperless-ngx-mcp
claude plugin install paperless-ngx@patrickcylai-pluginsClaude Code then prompts for your URL and token, and for the two directories described under what it can touch on your disk. The token is masked on entry and kept in your OS keychain rather than written to a settings file, which is the main reason to prefer this over the command below — that one leaves the token in your shell history.
The plugin runs the published npm package, so it needs nothing cloned or built.
To set everything up front instead of answering prompts:
claude plugin install paperless-ngx@patrickcylai-plugins \
--config url=https://paperless.example.com \
--config token=your-token \
--config read_only=trueChange any of it later with /plugin configure paperless-ngx@patrickcylai-plugins. Leave
download_dir and upload_dirs empty to accept the defaults. The plugin authenticates with a token
only; for username/password use one of the forms below.
Claude Code, as a plain MCP server
claude mcp add paperless -e PAPERLESS_URL=https://paperless.example.com -e PAPERLESS_TOKEN=your-token -- npx -y @patrickcylai/paperless-ngx-mcpNote that this writes the token into your shell history.
Claude Desktop / other MCP clients
Add to the client's MCP config (claude_desktop_config.json for Claude Desktop):
{
"mcpServers": {
"paperless": {
"command": "npx",
"args": ["-y", "@patrickcylai/paperless-ngx-mcp"],
"env": {
"PAPERLESS_URL": "https://paperless.example.com",
"PAPERLESS_TOKEN": "your-token"
}
}
}
}If the server fails to start with spawn npx ENOENT (or env: node: No such file or directory),
the client cannot find Node on its PATH. This is common when Node comes from a version manager such
as nvm, fnm or Volta, since a GUI app launched from the Dock or Finder does not run your shell profile.
Give the absolute path to npx — which npx prints it — and put the same directory on the server's
PATH so that npx can find node in turn:
"command": "/Users/me/.nvm/versions/node/v24.19.0/bin/npx",
"args": ["-y", "@patrickcylai/paperless-ngx-mcp"],
"env": {
"PATH": "/Users/me/.nvm/versions/node/v24.19.0/bin:/usr/bin:/bin",
…
}That path names one Node version, so update it if you uninstall that version. Recent Claude Desktop
builds pick up your login shell's PATH themselves, so you may not need this at all.
From source
npm install
npm run buildThen point the client at node /absolute/path/to/paperless-ngx-mcp/dist/index.js instead of the
npx command above.
Running as an HTTP service
Only needed if you want one long-lived server rather than a per-client subprocess:
MCP_TRANSPORT=http PAPERLESS_URL=https://paperless.example.com PAPERLESS_TOKEN=your-token npx -y @patrickcylai/paperless-ngx-mcpIt listens on 127.0.0.1:8765, with the MCP endpoint at /mcp and a liveness probe at /healthz:
curl -s http://127.0.0.1:8765/healthzPoint an HTTP-capable client at it:
claude mcp add --transport http paperless http://127.0.0.1:8765/mcpIf you expose the port
It binds loopback only by default. Before binding anything wider, set a bearer token — otherwise anyone who can reach the port can read and modify your archive. The server warns on stderr when it binds a non-loopback address without one.
openssl rand -hex 32Set that as MCP_AUTH_TOKEN, and add MCP_ALLOWED_HOSTS for the hostname you'll use — Host and
Origin are checked against a localhost-only allowlist by default, which blocks DNS rebinding.
Clients then need to send Authorization: Bearer <token>. /healthz stays unauthenticated.
Configuration
Variable | Required | Default | Meaning |
| yes | — | Base URL of the install. A trailing |
| yes* | — | API token. Takes precedence over username/password. |
| yes* | — | Basic-auth alternative to a token. |
| no |
| When set, every tool that would modify the archive refuses to run — no request is even sent. |
| no |
| The only directory |
| no |
| Comma-separated list of directories |
| no | server default | Pin the API version ( |
| no |
| Per-request timeout. |
* One of the two credential forms is required.
Transport settings (the HTTP ones are ignored under stdio):
Variable | Default | Meaning |
|
|
|
|
| Interface to bind. Set a bearer token before widening this. |
|
| Port to listen on. |
|
| Path the MCP endpoint is mounted at. |
| — | When set, requests must send |
| localhost | Comma-separated |
| localhost | Comma-separated |
Start with PAPERLESS_READ_ONLY=1 if you want to let an assistant explore the archive before giving
it permission to change anything. It governs the archive, not the local filesystem — downloads still
write files, within the boundary described next.
What it can touch on your disk
Two tools reach the local filesystem, and both are confined:
paperless_download_documentwrites only insidePAPERLESS_DOWNLOAD_DIR. Adest_pathis taken as relative to that directory; an absolute one has to be under it. Anything else is refused.paperless_upload_documentreads only from the directories inPAPERLESS_UPLOAD_DIRS, which defaults to just the download directory. Point it at your scans folder to upload from there:PAPERLESS_UPLOAD_DIRS=/home/me/Documents/scans,/home/me/Downloads
Both checks resolve symlinks, so a link inside an allowed directory cannot lead out of it, and the
download directory is created 0700 and rejected outright if it is itself a symlink.
This matters because document text is untrusted input. An archive fed by a scanner or a mail rule
contains whatever a sender put in it, that text reaches the model, and a model can be talked into
calling a tool. The confinement is what keeps "read my documents" from becoming "write to my
~/.ssh/authorized_keys" — so widen these two settings deliberately, not by reflex.
If your instance uses a self-signed certificate, run the server with
NODE_TLS_REJECT_UNAUTHORIZED=0 — bearing in mind that this disables certificate checking for the
whole process.
Tools
Documents
Tool | Does |
| Full-text search plus structured filters, paginated, with highlights. |
| One document: metadata, extracted text, notes, custom field values. |
| Write the original / archived PDF / thumbnail into |
| Upload a file from |
| Change title, dates, correspondent, type, tags, custom fields. |
| One operation across many documents; |
| What paperless' own matching would file the document as. |
| List, add or delete notes on a document. |
Taxonomy
Tool | Does |
| List tags, correspondents, document types, storage paths, custom fields, saved views, users, groups, mail accounts, mail rules, workflows, share links. |
| Create a tag, correspondent, document type, storage path or custom field. |
| Rename or reconfigure one of the above. |
| Delete them; requires confirmation. |
System
Tool | Does |
| Document counts, inbox size, file-type breakdown. |
| Version, database/index/Redis health, what this server is connected to. |
| Background tasks — use it to follow up on an upload. |
| Escape hatch to any REST endpoint the tools above do not cover. |
Resources
paperless://taxonomy— every tag, correspondent, type, storage path and custom field with its id.paperless://statistics— the same payload as the statistics tool.
Search syntax
paperless_search_documents' query parameter goes to the full-text index and supports paperless'
advanced syntax:
shopname AND (product1 OR product2)
type:invoice tag:unpaid
correspondent:university certificate
created:[2005 to 2009]
added:yesterday
produ*name
custom_fields.name:"Contract Number" custom_fields.value:1312
notes.note:reminderDate keywords: today, yesterday, "previous week", "this month", "previous month",
"this year", "previous year", "previous quarter". Matching is word-order-independent and
accent-insensitive, and separators are stripped at index time, so 1312 finds A-1312/B.
For plain substring matching use title_contains / content_contains instead, and to find documents
resembling one you already have, use more_like_id.
Custom fields have their own filter, passed through verbatim as custom_field_query:
["due", "range", ["2024-08-01", "2024-09-01"]]
["customer", "exact", "bob"]
["OR", [["address", "isnull", true], ["address", "exact", ""]]]Development
npm run dev # run straight from TypeScript source
npm test # unit tests + end-to-end tests against a stub paperless API
npm run typecheck # tsc --noEmit
npm run build # emit dist/The end-to-end suite starts a stub HTTP server that mimics the paperless API and drives the real server over both transports with raw JSON-RPC, so it covers the wire protocol, query translation, multipart uploads, error handling, read-only enforcement, bearer auth, the DNS-rebinding checks and the filesystem confinement.
Anything not covered by a dedicated tool is reachable through paperless_api_request. Your own
instance publishes its full, version-matched schema at <paperless-url>/api/schema/view/.
The Claude Code plugin lives in plugin/: plugin/.claude-plugin/plugin.json
declares the settings users are prompted for, and plugin/.mcp.json runs the
published package. .claude-plugin/marketplace.json makes this
repository its own marketplace, listing the plugin by relative path.
That relative path is deliberate. An npm plugin source also works, and avoids re-resolving the
package each session, but only the Claude Code CLI accepts one — the Claude Desktop and claude.ai
sync paths take github, url, git-subdir or a relative path, and reject a marketplace whose
entry uses anything else. A relative path is the only form that installs everywhere.
Validate both manifests with claude plugin validate ./plugin and claude plugin validate .. To
exercise the plugin without publishing, add the repository as a local marketplace:
claude plugin marketplace add /path/to/paperless-ngx-mcp.
License
MIT
Available Tools
16 toolspaperless_api_requestRaw API requestADestructive
Escape hatch for any paperless-ngx REST endpoint the other tools do not cover — workflows, share links, mail rules, trash, document merge/rotate/edit_pdf, permissions, and so on. path is relative to /api/, e.g. documents/12/history, trash, share_links. Trailing slashes are added automatically. Browse the full schema for your server at <paperless-url>/api/schema/view/. Prefer the purpose-built tools when one fits; they return smaller, name-resolved output.
Inputs: path (required), body, query, method, +1 more.
paperless_bulk_edit_documentsBulk edit documentsADestructive
Apply one operation to many documents at once. Supply only the parameters the chosen method needs. Runs asynchronously on the server. delete moves documents to the trash and requires confirm: true.
Inputs: method (required), document_ids (required), tag_id, confirm, +7 more.
paperless_create_objectCreate a tag, correspondent or typeA
Create a tag, correspondent, document type, storage path or custom field. Matching algorithm: 0 none, 1 any word, 2 all words, 3 exact, 4 regex, 5 fuzzy, 6 auto (trained classifier). Storage paths need a path template such as {{ created_year }}/{{ correspondent }}/{{ title }}. Custom fields need a data_type (string, url, date, boolean, integer, float, monetary, documentlink, select).
Inputs: name (required), type (required), path, match, +6 more.
paperless_delete_objectsDelete tags, correspondents or typesADestructive
Permanently delete tags, correspondents, document types or storage paths. Documents themselves are not deleted, but they lose the association. Requires confirm: true.
Inputs: ids (required), type (required), confirm.
paperless_document_notesDocument notesADestructive
List, add or delete the free-text notes attached to a document.
Inputs: id (required), note, action, note_id.
paperless_download_documentDownload document fileAIdempotent
Save a document’s file to local disk and return the path. Use kind: "original" for the file as uploaded, "archive" for the OCR’d PDF paperless generated, "thumbnail" for a small preview image. Read the extracted text with paperless_get_document instead when you only need the words. Writes are confined to PAPERLESS_DOWNLOAD_DIR.
Inputs: id (required), kind, version, dest_path.
paperless_get_documentGet documentARead-only
Fetch one document by id: metadata with names resolved, plus its extracted text, notes and custom field values. Use this after paperless_search_documents to read a document’s contents.
Inputs: id (required), version, include_content, include_metadata, +1 more.
paperless_get_document_suggestionsGet filing suggestionsARead-only
Ask paperless what it would file a document as, based on its trained matching. Returns suggested correspondents, tags, document types, storage paths and dates. Useful before paperless_update_document.
Inputs: id (required).
paperless_get_statisticsLibrary statisticsARead-only
Totals for the whole library: document count, documents in the inbox, characters indexed, counts of tags/correspondents/document types, and a breakdown by file type. A good first call to see how big the library is before searching it.
Inputs: no named parameters.
paperless_get_system_statusSystem statusARead-only
Health of the paperless-ngx install: version, database and index status, Redis/Celery connectivity, plus the API version this server is talking to. Use this to check connectivity and diagnose failures.
Inputs: no named parameters.
paperless_list_objectsList tags, correspondents and other objectsARead-only
List the objects documents are filed under, with their ids and document counts. Call this first when you need an id for a tag, correspondent, document type, storage path or custom field — the document tools take ids, not names. Also reaches saved views, users, groups, mail accounts, mail rules, workflows and share links.
Inputs: type (required), page, ordering, all_pages, +2 more.
paperless_list_tasksList background tasksARead-only
Inspect paperless’ background tasks — document consumption, index rebuilds, and so on. Use this to follow up on an upload: pass the task_id returned by paperless_upload_document to see whether consumption succeeded and which document it produced.
Inputs: page, status, task_id, page_size, +1 more.
paperless_search_documentsSearch documentsARead-only
Find documents in paperless-ngx. Combine full-text search with structured filters.
query uses the full-text index and supports the advanced syntax: invoice AND (acme OR globex), type:invoice tag:unpaid, correspondent:university, created:[2005 to 2009], added:yesterday, produ*name, custom_fields.name:"Contract Number", custom_fields.value:policy, notes.note:reminder. Date keywords: today, yesterday, "previous week", "this month", "previous month", "this year", "previous year", "previous quarter". Matching is word-order-independent and accent-insensitive.
Use title_contains/content_contains instead for plain substring matching, or more_like_id to find documents similar to a known one. Tag/correspondent/type filters take ids — get them from paperless_list_objects. Returns names resolved, not raw ids.
Inputs: page, query, ordering, tags_all, +21 more.
paperless_update_documentUpdate documentAIdempotent
Change one document’s metadata. Only the fields you pass are touched. tag_ids replaces the whole tag set, while add_tag_ids/remove_tag_ids adjust it relative to what is already there. Pass clear_correspondent/clear_document_type/clear_storage_path to unset a field.
Inputs: id (required), title, content, created, +12 more.
paperless_update_objectUpdate a tag, correspondent or typeAIdempotent
Rename or reconfigure an existing tag, correspondent, document type, storage path or custom field. Only the fields you pass are changed.
Inputs: id (required), type (required), name, path, +7 more.
paperless_upload_documentUpload documentA
Upload a local file into paperless-ngx for consumption (OCR, tagging, filing). The file must live in one of the directories this server is allowed to read (PAPERLESS_UPLOAD_DIRS). Returns the consumption task id; consumption is asynchronous, so set wait_seconds to poll until it finishes and get back the created document id. Any field left unset is filled in by paperless’ own matching rules.
Inputs: file_path (required), title, created, tag_ids, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource or action: search, get, download, upload, update, bulk edit, notes, object CRUD, stats, status, and tasks. The api_request escape hatch intentionally overlaps but explicitly directs agents to prefer purpose-built tools. No two tools appear interchangeable.
Almost all tools follow a clear paperless_verb_noun pattern, making the set easy to scan. Minor deviations include paperless_document_notes, which lacks an action verb, and paperless_api_request, which is noun-like, plus mixed singular/plural object forms.
At 16 tools the set sits just above the ideal 3-15 range, but the breadth is justified by paperless-ngx's domain: documents, objects, notes, tasks, stats, and system health. Each tool covers a distinct responsibility with no redundant entries.
Document lifecycle coverage is strong: search, read, download, upload, update, bulk delete, notes, and suggestions are all present, and object CRUD is covered. However, several secondary areas like trash, permissions, workflows, and document editing are only reachable through the generic api_request escape hatch rather than first-class tools.
Maintenance
Related MCP Connectors
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.
Related MCP Servers
- 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 gradedqualityCmaintenanceA 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
- AlicenseAqualityBmaintenanceA read-only MCP server for your paperless-ngx document archive that lets an AI assistant search documents by full text, tags, correspondents, and dates, and read the text of any document.72MIT