Repository avatar
Search & Data Extraction
v0.3.2
active

mcp-server-paperless

io.github.gardenbaum/mcp-server-paperless

Search, read, file, tag and upload documents in paperless-ngx 3.x

Documentation

mcp-server-paperless

Talk to your paperless-ngx archive.
Claude, Cursor, VS Code and every other MCP client can find, read, file, upload and organise your documents, by name, and nothing final happens without your yes.

PyPI Downloads CI E2E full suite paperless-ngx 3.x Python 3.14+ License: MIT GitHub stars

Install in VS Code Install in Cursor Claude Code

Quick start · What you can ask · Comparison · Toolsets · Safety · Documentation

Terminal recording: the server finds three electricity bills by the name of the sender, files a new scan from the inbox like the others, and refuses to delete a correspondent for good until the call is repeated with confirm=true. Questions, the yes and tool calls are scripted, the answers are real, shortened, and the documents are invented.

Version 0.3.2 against a real paperless-ngx 3.4.2 with invented documents. The questions, the yes and the tool calls are scripted, the answers are the server's own, shortened (how it is recorded).

claude mcp add paperless --env PAPERLESS_URL=https://paperless.example.org \
    --env PAPERLESS_TOKEN=your-api-token -- uvx mcp-server-paperless@latest

mcp-server-paperless is a Model Context Protocol server for paperless-ngx 3.x, built on FastMCP 4. It gives Claude Code, Claude Desktop, claude.ai, Cursor, VS Code and any other MCP client 87 tools in 13 toolsets that cover most of what the Paperless API can do, from a search to saved views, mail rules and workflows. It starts small and careful: 19 tools by default, names instead of ids, and a confirmation step before anything that cannot be undone.

flowchart LR
    A["Claude Code · Claude Desktop<br>Cursor · VS Code"] -- stdio --> S
    B["claude.ai<br>connector"] -- "HTTPS + OIDC" --> S
    C["Other MCP<br>clients"] -- "HTTP + bearer token" --> S
    S(["mcp-server-paperless"]) -- "REST API v10" --> P[("paperless-ngx 3.x")]

What you can ask

  • "What is in my inbox? Suggest a correspondent, type and tags for each document and file them once I agree."
  • "Find last year's electricity bills and add up what I paid."
  • "Upload this PDF as an invoice from ACME and tag it tax-2026."
  • "Which documents mention the rental deposit? Show me the paragraph."
  • "Merge the three scans of the contract into one document and rotate page 2."
  • "Give me a link to my insurance policy that expires in a week."
  • "Set up a mail rule that files the invoices from billing@example.org."
  • "Find duplicate and unused tags and propose how to clean them up."
  • "Which documents have no document type yet? Then run my saved view To do."

An example of how that goes (illustrative):

You: What is still in my inbox?

Claude: Three documents. Here is how I would file them:

DocumentCorrespondentTypeTags
Electricity bill, MarchCity PowerInvoiceutilities, tax-2026
Policy updateNorthwind InsuranceLetterinsurance
Receipt, hardware storenew: Brick & BoltReceipthousehold

"Brick & Bolt" does not exist yet as a correspondent; I would create it. Shall I apply this?

You: Yes, and tag the policy update tax-2026 too.

Four built-in prompts start such tasks from the client's prompt menu: triage_inbox, find_document, annual_review and cleanup_taxonomy. Each one proposes its changes and waits for your yes before it writes.

Why this one

There are already several MCP servers for paperless-ngx. This one is a new build, made for people who want all of the following in one server:

  • 🗂️ Much more than search. Besides finding, reading and filing documents it handles notes, custom fields, saved views, file versions, the trash, PDF operations, share links, mail rules, workflows, permissions and user administration: most of what paperless-ngx 3.x can do.
  • 🏷️ Names instead of numbers. You say "invoices from ACME tagged tax-2026" and the server finds the matching ids itself. If a name does not exist or fits more than one entry, it says so and lists the candidates instead of guessing.
  • 🛡️ Nothing final without your yes. Before a tool deletes, overwrites, publishes or shares anything, it reports what would happen and waits for your confirmation. Changes to many documents at once can be previewed first.
  • 🪶 Small to start with. Only 19 tools by default out of the 87, so the assistant starts with the essentials and you decide what else it may do. Search results are short lists and long documents are read piece by piece, so a conversation does not fill up with text it does not need.
  • 🧪 Tested against a real Paperless. More than 600 tests run against a real paperless-ngx after every change and every night, on top of more than 4,500 faster tests. Every week the whole suite also runs against the newest Paperless release.
  • 🔐 Safe to reach from outside. Over the network the server does not start without authentication. Claude Code signs in with a token, claude.ai through your own identity provider, and the container image runs without root rights.

How it compares

Some other paperless-ngx MCP servers, as their code stood on 23 November 2026 (read from their sources, not run; ❌ means not found; open an issue if something is wrong or has changed):

Tools by default / in totalToolsets and read-only modeNames instead of idsConfirms what is finalRuns saved viewsNotices misread full-text syntaxHTTPTested on a real Paperless
mcp-server-paperless19 / 87✅ opt-in✅ tags, types, people, views✅ with a preview✅✅bearer, OIDC3.4.2 after every merge, newest 3.x weekly
OrellBuehler/paperless-mcp123 / 126✅ all on by default❌hints only❌❌bearer, OAuth❌
freeformz/paperless-ngx-mcp123 / 123❌❌❌❌❌stdio only❌
cubinet-code/paperless-ngx-mcp109 / 109❌in results✅❌❌no auth3.2.1 on every change
tobee89/mcp-paperless-ngx85 / 99✅ 7 of 9 on by default❌hints only❌❌stdio onlyby hand
pvliesdonk/paperless-mcp50 / 52tool allow list❌hints only❌❌bearer, OIDCnot in CI
baruchiro/paperless-mcp47 / 47❌in results✅❌❌bearer2.20 and newest on every change
barryw/PaperlessMCP44 / 44❌❌✅ with a preview❌❌no auth❌
nloui/paperless-mcp16 / 16❌❌❌❌❌no auth❌

Others exist; tb1337 and chaosbit-dev also run saved views.

More tools is not better by itself: every tool a client loads costs context in every conversation. This server keeps the default small and lets you switch on the rest.

Quick start

You need a Paperless API token: in Paperless open your profile menu, "My Profile", and create an API auth token. The server acts as that user and sees and changes only what that user may.

Claude Code

With uv installed, one command, no clone:

claude mcp add paperless \
    --env PAPERLESS_URL=https://paperless.example.org \
    --env PAPERLESS_TOKEN=your-api-token \
    -- uvx mcp-server-paperless@latest

Add --scope user to have it in every project. Then ask Claude for an overview of your Paperless instance. @latest makes uvx check for a new release at every start; to stay on one, name its version instead (mcp-server-paperless@0.2.0).

Or as a plugin, which asks for seven options (only the URL and the token are required), so the token is in no command and Claude Code keeps it in its credential store. In a session (Claude Code 2.1.275 or later):

/plugin install mcp-server-paperless --marketplace gardenbaum/mcp-server-paperless

From your shell, followed by /plugin configure mcp-server-paperless@gardenbaum in a session and a restart of Claude Code:

claude plugin marketplace add gardenbaum/mcp-server-paperless
claude plugin install mcp-server-paperless@gardenbaum

The plugin also brings four skills (inbox triage, finding a document, annual review, taxonomy cleanup) that Claude can pick by itself. The plugin runs a fixed release of the package (its dependencies are resolved at install). For the next one, refresh the marketplace first, then restart Claude Code or run /reload-plugins:

claude plugin marketplace update gardenbaum
claude plugin update mcp-server-paperless@gardenbaum

Remove an entry you added with claude mcp add (claude mcp remove paperless), or every tool appears twice.

[!WARNING] The package is mcp-server-paperless. The PyPI project paperless-mcp is a different server by someone else; uvx paperless-mcp would run it with your Paperless token.

Claude Desktop

Add the server to claude_desktop_config.json (Settings, Developer, Edit Config) and restart:

{
  "mcpServers": {
    "paperless": {
      "command": "uvx",
      "args": ["mcp-server-paperless@latest"],
      "env": {
        "PAPERLESS_URL": "https://paperless.example.org",
        "PAPERLESS_TOKEN": "your-api-token"
      }
    }
  }
}

If Claude Desktop cannot find uvx, give its full path (which uvx). Other MCP clients that start a stdio server (Windsurf, Zed, Cline, Continue, ...) take the same command, arguments and environment.

VS Code

Install in VS Code: VS Code asks for the Paperless URL and the API token and keeps the token as a secret. By hand, add the server to .vscode/mcp.json with the same uvx command as for Claude Desktop.

Cursor

Install in Cursor, then replace the placeholder URL and token in the server settings (~/.cursor/mcp.json). The repository is also a Cursor plugin for teams that set the two values in the Cursor dashboard.

Container, for remote clients

The image serves MCP over Streamable HTTP and does not start without authentication:

export MCP_TOKEN="$(openssl rand -hex 32)"
docker run -d --name mcp-server-paperless -p 127.0.0.1:8001:8000 \
    -e PAPERLESS_URL=https://paperless.example.org \
    -e PAPERLESS_TOKEN=your-api-token \
    -e PAPERLESS_MCP_HTTP_AUTH_TOKENS="$MCP_TOKEN" \
    -e PAPERLESS_MCP_HTTP_ALLOWED_HOSTS=localhost \
    ghcr.io/gardenbaum/mcp-server-paperless:0.3.0

claude mcp add --transport http paperless http://127.0.0.1:8001/mcp \
    --header "Authorization: Bearer $MCP_TOKEN"

Run in a container has the compose file next to Paperless and the reverse proxy setup, Run over HTTP the details of the transport.

claude.ai

claude.ai custom connectors sign in with OAuth. Put the HTTP server behind your identity provider (Authentik, Keycloak, Google, Auth0 or any other OpenID Connect provider) with five environment variables: Connect claude.ai.

Toolsets

The 87 tools are grouped into toolsets, and only two are on by default, so the model is not handed tools you never use. Switch more on with PAPERLESS_MCP_TOOLSETS=core,ai,pdf,trash or all.

ToolsetToolsDefaultWhat it is for
core17onSearch, read, download, file and upload documents; run saved views; notes; tags, correspondents, types, storage paths and custom fields; background tasks
ai2onAsk Paperless AI about your documents and get its filing suggestions (offered only while Paperless AI is enabled)
bulk2Change many documents or taxonomy items in one step, with a dry run first
pdf7Rotate, merge, split, delete pages, edit PDFs, remove passwords, reprocess
versions5The file versions of a document: list, upload, label, delete, merge documents as versions
trash3List the trash, restore from it, empty it
views5Saved views: list, create, change and delete them (running them is in core)
sharing8Public share links and bundles, and sending documents by e-mail
permissions3Owners and view and change rights of documents and taxonomy; list users and groups
mail13Mail accounts and rules for the mail import, and what it processed
workflows5The workflows Paperless runs by itself: triggers and actions
admin16Users, groups, application configuration, logs, tasks, bulk download
raw1A read-only escape hatch: GET any path of the Paperless API the other tools do not cover

Every tool with its kind and a one-line description is in the tool reference; what to know before switching a toolset on is in Configuration.

How it keeps your archive safe

An assistant that can file your documents can also delete them. The server is built so that this takes more than a misunderstanding:

  • Confirmation before anything final. Tools that delete, overwrite, publish or grant access change nothing when called without confirm=true. They answer with what would happen (which documents, who gains access, what cannot be undone), so the client shows it to you first.
  • Dry runs for bulk edits. bulk_edit_documents and bulk_edit_taxonomy preview how many objects would change before they ask for confirmation.
  • The trash first. Deleting a document moves it to the Paperless trash, from where it can be restored. Emptying the trash is a separate tool in a toolset that is off by default.
  • You choose the surface. Toolsets are opt-in, PAPERLESS_MCP_READ_ONLY=true offers only tools that change nothing, and PAPERLESS_MCP_DISABLED_TOOLS takes single tools away.
  • Paperless stays in charge. The server acts as the user of its API token: the permissions set in Paperless apply to every call.
  • Secrets stay secret. Passwords and API keys are write-only. Tool calls log neither tokens nor document text nor search queries at the default log level; the privacy policy names the exceptions.
  • No reach beyond Paperless. Callers cannot make the server read local files or reach other hosts. Uploading by file path exists only over stdio and only from directories you name.

Found a security problem? Report it privately.

Configuration

The settings you are most likely to touch; Configuration has all of them.

VariableMeaning
PAPERLESS_URLBase URL of your Paperless instance (required)
PAPERLESS_TOKENPaperless API token (required)
PAPERLESS_PUBLIC_URLBase URL for links shown to you, if it differs from PAPERLESS_URL
PAPERLESS_MCP_TOOLSETSToolsets to offer, comma-separated, or all (default core,ai)
PAPERLESS_MCP_READ_ONLYtrue to offer only tools that change nothing
PAPERLESS_MCP_DISABLED_TOOLSTools never offered, by name
PAPERLESS_MCP_UPLOAD_DIRSDirectories the model may upload files from by path (stdio only; default: none)

Compatibility

paperless-ngx3.4.2 and later (API version 10). Every change is tested against 3.4.2, the latest 3.x release weekly. 2.x is not supported
ClientsClaude Code and Claude Desktop over stdio, claude.ai custom connectors and other MCP clients over Streamable HTTP
RuntimePython 3.14 or later (uvx fetches it for you), or the container image

Documentation

Privacy Policy

You run the server yourself: it sends your data to your Paperless and your MCP client, keeps no copy of your documents on disk and has no telemetry. The privacy policy says what it reads, writes, stores and logs, and where data goes (your client's AI model and Paperless's own AI included).

Known limitations

  • One Paperless user per server. Every client of a server acts as the user of its PAPERLESS_TOKEN, also when clients sign in through an identity provider. Run one server per Paperless account.
  • search_documents with more_like_id can return nothing on Paperless 3.4.2. Paperless 3.4.2 (Tantivy 0.26) panics while scoring a more-like-this query once edited or deleted documents have left stale entries in the search index. Paperless catches the panic, logs More Like This scoring panicked and answers an empty list with HTTP 200, so the server cannot tell it from "no similar documents". If a result is empty although similar documents should exist, have an administrator run document_index reindex in the Paperless container (for example docker compose exec webserver document_index reindex). The fix is upstream in Tantivy (tantivy PR 2964); it needs a Paperless release that ships it.

How this project is built

The code is written by AI agents and held to rules that are checked, not remembered: a layered architecture enforced by import contracts, every design decision recorded with the test that guards it (backlog/decisions/), a contract suite that runs the same tests against a fake and a real Paperless, and mutation testing with a gate. Plans and task history are in backlog/. See Development to run the checks yourself; issues and pull requests are welcome.

Credits

This is a new build, not a fork, but it learned from three existing paperless-ngx MCP servers and adopts some of their ideas deliberately:

  • pvliesdonk/paperless-mcp (MIT): field projection in lists, content slicing with a next offset, retries only for idempotent calls, token redaction, errors that name the next call, a central tool-annotation table, web_url, and the OIDC proxy beside bearer tokens.
  • baruchiro/paperless-mcp (ISC): names instead of IDs in output, confirm: true for destructive calls, an upload allowlist, live end-to-end tests against a real Paperless, a test over every advertised tool schema.
  • OrellBuehler/paperless-mcp (MIT): toolsets, a read-only mode and a test that every tool belongs to a toolset, coverage of Paperless 3.x features (versions, AI suggestions, trash, PDF operations), prompts that ask for confirmation, a test that every tool named in a prompt exists.

Thanks to the paperless-ngx and FastMCP projects, which this server stands on.

Licence

MIT, see LICENSE.


If mcp-server-paperless saves you time, a ⭐ helps other Paperless users find it.

PYPI
mcp-server-paperless
Install Command
pip install mcp-server-paperless
Runtime: uvx