Skip to main content
Glama

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_objects tool (and a paperless://taxonomy resource) 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's created__gte / tags__id__all / title__icontains form;

  • truncates document text and raw responses by default, so one call cannot swamp the context;

  • requires an explicit confirm: true on 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 plugin marketplace add patrickcylai/paperless-ngx-mcp
claude plugin install paperless-ngx@patrickcylai-plugins

Claude 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=true

Change 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-mcp

Note 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 build

Then 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-mcp

It 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/healthz

Point an HTTP-capable client at it:

claude mcp add --transport http paperless http://127.0.0.1:8765/mcp

If 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 32

Set 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

PAPERLESS_URL

yes

—

Base URL of the install. A trailing /api is stripped, so either form works.

PAPERLESS_TOKEN

yes*

—

API token. Takes precedence over username/password.

PAPERLESS_USERNAME / PAPERLESS_PASSWORD

yes*

—

Basic-auth alternative to a token.

PAPERLESS_READ_ONLY

no

false

When set, every tool that would modify the archive refuses to run — no request is even sent.

PAPERLESS_DOWNLOAD_DIR

no

$TMPDIR/paperless-mcp

The only directory paperless_download_document may write into. Created 0700.

PAPERLESS_UPLOAD_DIRS

no

$PAPERLESS_DOWNLOAD_DIR

Comma-separated list of directories paperless_upload_document may read from.

PAPERLESS_API_VERSION

no

server default

Pin the API version (Accept: …; version=N). Leave unset unless you have a reason.

PAPERLESS_TIMEOUT_MS

no

30000

Per-request timeout.

* One of the two credential forms is required.

Transport settings (the HTTP ones are ignored under stdio):

Variable

Default

Meaning

MCP_TRANSPORT

stdio

stdio or http.

MCP_HTTP_HOST

127.0.0.1

Interface to bind. Set a bearer token before widening this.

MCP_HTTP_PORT

8765

Port to listen on.

MCP_HTTP_PATH

/mcp

Path the MCP endpoint is mounted at.

MCP_AUTH_TOKEN

—

When set, requests must send Authorization: Bearer <token>. /healthz stays open.

MCP_ALLOWED_HOSTS

localhost

Comma-separated Host allowlist (DNS-rebinding protection). * disables the check.

MCP_ALLOWED_ORIGINS

localhost

Comma-separated Origin allowlist. * disables the check.

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_document writes only inside PAPERLESS_DOWNLOAD_DIR. A dest_path is taken as relative to that directory; an absolute one has to be under it. Anything else is refused.

  • paperless_upload_document reads only from the directories in PAPERLESS_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

paperless_search_documents

Full-text search plus structured filters, paginated, with highlights.

paperless_get_document

One document: metadata, extracted text, notes, custom field values.

paperless_download_document

Write the original / archived PDF / thumbnail into PAPERLESS_DOWNLOAD_DIR.

paperless_upload_document

Upload a file from PAPERLESS_UPLOAD_DIRS for consumption, optionally waiting for the result.

paperless_update_document

Change title, dates, correspondent, type, tags, custom fields.

paperless_bulk_edit_documents

One operation across many documents; delete needs confirmation.

paperless_get_document_suggestions

What paperless' own matching would file the document as.

paperless_document_notes

List, add or delete notes on a document.

Taxonomy

Tool

Does

paperless_list_objects

List tags, correspondents, document types, storage paths, custom fields, saved views, users, groups, mail accounts, mail rules, workflows, share links.

paperless_create_object

Create a tag, correspondent, document type, storage path or custom field.

paperless_update_object

Rename or reconfigure one of the above.

paperless_delete_objects

Delete them; requires confirmation.

System

Tool

Does

paperless_get_statistics

Document counts, inbox size, file-type breakdown.

paperless_get_system_status

Version, database/index/Redis health, what this server is connected to.

paperless_list_tasks

Background tasks — use it to follow up on an upload.

paperless_api_request

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: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, 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 tools
paperless_api_requestRaw API requestA
Destructive

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 documentsA
Destructive

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 typesA
Destructive

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 notesA
Destructive

List, add or delete the free-text notes attached to a document.

Inputs: id (required), note, action, note_id.

paperless_download_documentDownload document fileA
Idempotent

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 documentA
Read-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 suggestionsA
Read-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 statisticsA
Read-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 statusA
Read-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 objectsA
Read-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 tasksA
Read-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 documentsA
Read-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 documentA
Idempotent

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 typeA
Idempotent

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

    A4.1/5.0

    Scored across 16 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      A 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
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      A 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
    • A
      license
      A
      quality
      B
      maintenance
      A 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.
      7
      2
      MIT