Paperless MCP

السجل الرسمي البحث والويب

Paperless-NGX over MCP: search, read, upload and tag documents; manage correspondents and types.

ماذا يمكنك أن تفعل مع Paperless MCP؟

  • File transfer links: Download document files and full OCR Markdown over HTTP. Upload files, including Markdown, through the same transfer route. Set PAPERLESS_MCP_BASE_URL to enable the tools. File bytes stay outside model context. See [file transfer ...
  • Document search & retrieval: full-text and filtered list queries against Paperless-NGX, plus access to extracted OCR text, metadata, and thumbnails.
  • Tag, correspondent, document-type, custom-field management: full CRUD and bulk-edit for every classification dimension Paperless exposes.
  • Document lifecycle supports uploads, field changes, notes, audit history, and AI-suggested tags/correspondents/types.
  • Operational introspection covers saved views, storage paths, share links, background tasks (with wait_for_task), statistics, and an upstream release check for Paperless-NGX.
  • MCP tools: 49 LLM-visible tools with Lucide icons; see src/paperless_mcp/tools/.
  • MCP resources: 16 URIs exposing bounded document previews and domain collections; see src/paperless_mcp/resources/.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package pvliesdonk-paperless-mcp
Claude Code
claude mcp add paperless-mcp -e 'PAPERLESS_MCP_KV_STORE_URL=file:///data/state' -e 'PAPERLESS_MCP_TOOLS_ALLOW=<PAPERLESS_MCP_TOOLS_ALLOW>' -e 'PAPERLESS_MCP_TOOLS_DENY=<PAPERLESS_MCP_TOOLS_DENY>' -e 'PAPERLESS_MCP_SERVER_NAME=<PAPERLESS_MCP_SERVER_NAME>' -e 'PAPERLESS_MCP_INSTANCE_DESCRIPTION=<PAPERLESS_MCP_INSTANCE_DESCRIPTION>' -e 'PAPERLESS_MCP_INSTRUCTIONS_EXTRA=<PAPERLESS_MCP_INSTRUCTIONS_EXTRA>' -e 'PAPERLESS_MCP_INSTRUCTIONS=<PAPERLESS_MCP_INSTRUCTIONS>' -e 'PAPERLESS_MCP_LOG_LEVEL=INFO' -e 'PAPERLESS_MCP_LOG_FORMAT=<PAPERLESS_MCP_LOG_FORMAT>' -e 'PAPERLESS_MCP_PAPERLESS_URL=<PAPERLESS_MCP_PAPERLESS_URL>' -e 'PAPERLESS_MCP_API_TOKEN=<your paperless_mcp_api_token>' -e 'PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS=30.0' -e 'PAPERLESS_MCP_HTTP_RETRIES=2' -e 'PAPERLESS_MCP_DEFAULT_PAGE_SIZE=25' -e 'PAPERLESS_MCP_PAPERLESS_PUBLIC_URL=<PAPERLESS_MCP_PAPERLESS_PUBLIC_URL>' -e 'PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S=3600.0' -e 'PAPERLESS_MCP_TRANSFER_TTL_MAX_S=86400.0' -e 'PAPERLESS_MCP_TRANSFER_GRACE_TTL_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_LEASE_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES=104857600' -- uvx pvliesdonk-paperless-mcp==3.0.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "paperless-mcp": {
            "command": "uvx",
            "args": [
                "pvliesdonk-paperless-mcp==3.0.0"
            ],
            "env": {
                "PAPERLESS_MCP_KV_STORE_URL": "file:///data/state",
                "PAPERLESS_MCP_TOOLS_ALLOW": "<PAPERLESS_MCP_TOOLS_ALLOW>",
                "PAPERLESS_MCP_TOOLS_DENY": "<PAPERLESS_MCP_TOOLS_DENY>",
                "PAPERLESS_MCP_SERVER_NAME": "<PAPERLESS_MCP_SERVER_NAME>",
                "PAPERLESS_MCP_INSTANCE_DESCRIPTION": "<PAPERLESS_MCP_INSTANCE_DESCRIPTION>",
                "PAPERLESS_MCP_INSTRUCTIONS_EXTRA": "<PAPERLESS_MCP_INSTRUCTIONS_EXTRA>",
                "PAPERLESS_MCP_INSTRUCTIONS": "<PAPERLESS_MCP_INSTRUCTIONS>",
                "PAPERLESS_MCP_LOG_LEVEL": "INFO",
                "PAPERLESS_MCP_LOG_FORMAT": "<PAPERLESS_MCP_LOG_FORMAT>",
                "PAPERLESS_MCP_PAPERLESS_URL": "<PAPERLESS_MCP_PAPERLESS_URL>",
                "PAPERLESS_MCP_API_TOKEN": "<your paperless_mcp_api_token>",
                "PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS": "30.0",
                "PAPERLESS_MCP_HTTP_RETRIES": "2",
                "PAPERLESS_MCP_DEFAULT_PAGE_SIZE": "25",
                "PAPERLESS_MCP_PAPERLESS_PUBLIC_URL": "<PAPERLESS_MCP_PAPERLESS_PUBLIC_URL>",
                "PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S": "3600.0",
                "PAPERLESS_MCP_TRANSFER_TTL_MAX_S": "86400.0",
                "PAPERLESS_MCP_TRANSFER_GRACE_TTL_S": "60.0",
                "PAPERLESS_MCP_TRANSFER_LEASE_S": "60.0",
                "PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES": "104857600"
            }
        }
    }
}

متغيرات البيئة

  • PAPERLESS_MCP_KV_STORE_URL Persistent-state backend URL shared by every pvl-core subsystem that needs state. `memory://` is in-process and lost on restart; `file:///path` persists on one server; `redis://`, `dynamodb://` and `mongodb://` each need their matching extra. When unset, defaults to `file:///data/state` (the volume family Docker images mount), or to `memory://` (with a warning) on a host where that directory is not usable.
  • PAPERLESS_MCP_TOOLS_ALLOW Comma-separated explicit tool names this instance exposes; every other tool is hidden from listings and cannot be invoked. Names matching no registered tool are inert. Mutually exclusive with `tools_deny`. Takes effect through `apply_tool_visibility`.
  • PAPERLESS_MCP_TOOLS_DENY Comma-separated explicit tool names hidden from this instance (absent from listings, cannot be invoked). Names matching no registered tool are inert. Mutually exclusive with `tools_allow`. Takes effect through `apply_tool_visibility`.
  • PAPERLESS_MCP_SERVER_NAME Rename this server instance; defaults to the project name.
  • PAPERLESS_MCP_INSTANCE_DESCRIPTION Concise routing context that distinguishes this deployment's material or responsibility.
  • PAPERLESS_MCP_INSTRUCTIONS_EXTRA Deployment-specific behavioral policy added to the generated MCP instructions.
  • PAPERLESS_MCP_INSTRUCTIONS Legacy: replaces all generated MCP instructions (deprecated; use _INSTANCE_DESCRIPTION for routing and _INSTRUCTIONS_EXTRA for policy).
  • PAPERLESS_MCP_LOG_LEVEL Log level for every logger in the process, FastMCP's included (DEBUG / INFO / WARNING / ERROR / CRITICAL). The -v CLI flag overrides to DEBUG. The unprefixed FASTMCP_LOG_LEVEL still works for one major version and logs a deprecation warning.
  • PAPERLESS_MCP_LOG_FORMAT Log rendering. rich is one colour event key=value line per record, for a terminal; json is one JSON object per record, for a collector. Unset picks rich when stderr is a terminal and json everywhere else, so a container or journald gets JSON with no configuration.
  • PAPERLESS_MCP_PAPERLESS_URL Base URL of the Paperless-NGX REST API, without a trailing slash. The server refuses to start without it.
  • PAPERLESS_MCP_API_TOKEN سري Paperless service-account token used for outbound API requests. The server refuses to start without it.
  • PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS Per-request HTTP timeout in seconds.
  • PAPERLESS_MCP_HTTP_RETRIES Retries for idempotent requests after network errors or 5xx responses.
  • PAPERLESS_MCP_DEFAULT_PAGE_SIZE Default page size for list tools, from 1 through 100.
  • PAPERLESS_MCP_PAPERLESS_PUBLIC_URL Public Paperless UI URL for user-visible links; defaults to PAPERLESS_URL.
  • PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S Link lifetime in seconds when the caller requests no explicit TTL.
  • PAPERLESS_MCP_TRANSFER_TTL_MAX_S Ceiling in seconds a caller-requested link TTL is clamped to.
  • PAPERLESS_MCP_TRANSFER_GRACE_TTL_S Post-success grace window in seconds: a served token's TTL shrinks to this so a stalled transfer can retry within it.
  • PAPERLESS_MCP_TRANSFER_LEASE_S Crashed-handler reclaim window in seconds for an in-flight reservation.
  • PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES Maximum size in bytes of a single upload.
OCI package ghcr.io/pvliesdonk/paperless-mcp:v3.0.0
Claude Code
claude mcp add paperless-mcp -e 'PAPERLESS_MCP_SHUTDOWN_GRACE_S=3' -e 'PAPERLESS_MCP_BASE_URL=<PAPERLESS_MCP_BASE_URL>' -e 'PAPERLESS_MCP_BEARER_TOKEN=<your paperless_mcp_bearer_token>' -e 'PAPERLESS_MCP_OIDC_CONFIG_URL=<PAPERLESS_MCP_OIDC_CONFIG_URL>' -e 'PAPERLESS_MCP_OIDC_CLIENT_ID=<PAPERLESS_MCP_OIDC_CLIENT_ID>' -e 'PAPERLESS_MCP_OIDC_CLIENT_SECRET=<your paperless_mcp_oidc_client_secret>' -e 'PAPERLESS_MCP_OIDC_AUDIENCE=<PAPERLESS_MCP_OIDC_AUDIENCE>' -e 'PAPERLESS_MCP_OIDC_REQUIRED_SCOPES=openid' -e 'PAPERLESS_MCP_OIDC_ADVERTISED_SCOPES=openid offline_access' -e 'PAPERLESS_MCP_OIDC_JWT_SIGNING_KEY=<your paperless_mcp_oidc_jwt_signing_key>' -e 'PAPERLESS_MCP_OIDC_VERIFY_ACCESS_TOKEN=false' -e 'PAPERLESS_MCP_KV_STORE_URL=file:///data/state' -e 'PAPERLESS_MCP_APP_DOMAIN=<PAPERLESS_MCP_APP_DOMAIN>' -e 'PAPERLESS_MCP_TOOLS_ALLOW=<PAPERLESS_MCP_TOOLS_ALLOW>' -e 'PAPERLESS_MCP_TOOLS_DENY=<PAPERLESS_MCP_TOOLS_DENY>' -e 'PAPERLESS_MCP_AUTH_MODE=<PAPERLESS_MCP_AUTH_MODE>' -e 'PAPERLESS_MCP_BEARER_TOKENS_FILE=<PAPERLESS_MCP_BEARER_TOKENS_FILE>' -e 'PAPERLESS_MCP_BEARER_DEFAULT_SUBJECT=bearer-anon' -e 'PAPERLESS_MCP_SERVER_NAME=<PAPERLESS_MCP_SERVER_NAME>' -e 'PAPERLESS_MCP_INSTANCE_DESCRIPTION=<PAPERLESS_MCP_INSTANCE_DESCRIPTION>' -e 'PAPERLESS_MCP_INSTRUCTIONS_EXTRA=<PAPERLESS_MCP_INSTRUCTIONS_EXTRA>' -e 'PAPERLESS_MCP_INSTRUCTIONS=<PAPERLESS_MCP_INSTRUCTIONS>' -e 'PAPERLESS_MCP_HTTP_PATH=/mcp' -e 'PAPERLESS_MCP_HEALTH_DETAIL=standard' -e 'PUID=1000' -e 'PGID=1000' -e 'PAPERLESS_MCP_LOG_LEVEL=INFO' -e 'PAPERLESS_MCP_LOG_FORMAT=<PAPERLESS_MCP_LOG_FORMAT>' -e 'PAPERLESS_MCP_PAPERLESS_URL=<PAPERLESS_MCP_PAPERLESS_URL>' -e 'PAPERLESS_MCP_API_TOKEN=<your paperless_mcp_api_token>' -e 'PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS=30.0' -e 'PAPERLESS_MCP_HTTP_RETRIES=2' -e 'PAPERLESS_MCP_DEFAULT_PAGE_SIZE=25' -e 'PAPERLESS_MCP_PAPERLESS_PUBLIC_URL=<PAPERLESS_MCP_PAPERLESS_PUBLIC_URL>' -e 'PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S=3600.0' -e 'PAPERLESS_MCP_TRANSFER_TTL_MAX_S=86400.0' -e 'PAPERLESS_MCP_TRANSFER_GRACE_TTL_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_LEASE_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES=104857600' -- docker run -i --rm ghcr.io/pvliesdonk/paperless-mcp:v3.0.0 --port
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "paperless-mcp": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/pvliesdonk/paperless-mcp:v3.0.0",
                "--port"
            ],
            "env": {
                "PAPERLESS_MCP_SHUTDOWN_GRACE_S": "3",
                "PAPERLESS_MCP_BASE_URL": "<PAPERLESS_MCP_BASE_URL>",
                "PAPERLESS_MCP_BEARER_TOKEN": "<your paperless_mcp_bearer_token>",
                "PAPERLESS_MCP_OIDC_CONFIG_URL": "<PAPERLESS_MCP_OIDC_CONFIG_URL>",
                "PAPERLESS_MCP_OIDC_CLIENT_ID": "<PAPERLESS_MCP_OIDC_CLIENT_ID>",
                "PAPERLESS_MCP_OIDC_CLIENT_SECRET": "<your paperless_mcp_oidc_client_secret>",
                "PAPERLESS_MCP_OIDC_AUDIENCE": "<PAPERLESS_MCP_OIDC_AUDIENCE>",
                "PAPERLESS_MCP_OIDC_REQUIRED_SCOPES": "openid",
                "PAPERLESS_MCP_OIDC_ADVERTISED_SCOPES": "openid offline_access",
                "PAPERLESS_MCP_OIDC_JWT_SIGNING_KEY": "<your paperless_mcp_oidc_jwt_signing_key>",
                "PAPERLESS_MCP_OIDC_VERIFY_ACCESS_TOKEN": "false",
                "PAPERLESS_MCP_KV_STORE_URL": "file:///data/state",
                "PAPERLESS_MCP_APP_DOMAIN": "<PAPERLESS_MCP_APP_DOMAIN>",
                "PAPERLESS_MCP_TOOLS_ALLOW": "<PAPERLESS_MCP_TOOLS_ALLOW>",
                "PAPERLESS_MCP_TOOLS_DENY": "<PAPERLESS_MCP_TOOLS_DENY>",
                "PAPERLESS_MCP_AUTH_MODE": "<PAPERLESS_MCP_AUTH_MODE>",
                "PAPERLESS_MCP_BEARER_TOKENS_FILE": "<PAPERLESS_MCP_BEARER_TOKENS_FILE>",
                "PAPERLESS_MCP_BEARER_DEFAULT_SUBJECT": "bearer-anon",
                "PAPERLESS_MCP_SERVER_NAME": "<PAPERLESS_MCP_SERVER_NAME>",
                "PAPERLESS_MCP_INSTANCE_DESCRIPTION": "<PAPERLESS_MCP_INSTANCE_DESCRIPTION>",
                "PAPERLESS_MCP_INSTRUCTIONS_EXTRA": "<PAPERLESS_MCP_INSTRUCTIONS_EXTRA>",
                "PAPERLESS_MCP_INSTRUCTIONS": "<PAPERLESS_MCP_INSTRUCTIONS>",
                "PAPERLESS_MCP_HTTP_PATH": "/mcp",
                "PAPERLESS_MCP_HEALTH_DETAIL": "standard",
                "PUID": "1000",
                "PGID": "1000",
                "PAPERLESS_MCP_LOG_LEVEL": "INFO",
                "PAPERLESS_MCP_LOG_FORMAT": "<PAPERLESS_MCP_LOG_FORMAT>",
                "PAPERLESS_MCP_PAPERLESS_URL": "<PAPERLESS_MCP_PAPERLESS_URL>",
                "PAPERLESS_MCP_API_TOKEN": "<your paperless_mcp_api_token>",
                "PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS": "30.0",
                "PAPERLESS_MCP_HTTP_RETRIES": "2",
                "PAPERLESS_MCP_DEFAULT_PAGE_SIZE": "25",
                "PAPERLESS_MCP_PAPERLESS_PUBLIC_URL": "<PAPERLESS_MCP_PAPERLESS_PUBLIC_URL>",
                "PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S": "3600.0",
                "PAPERLESS_MCP_TRANSFER_TTL_MAX_S": "86400.0",
                "PAPERLESS_MCP_TRANSFER_GRACE_TTL_S": "60.0",
                "PAPERLESS_MCP_TRANSFER_LEASE_S": "60.0",
                "PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES": "104857600"
            }
        }
    }
}

متغيرات البيئة

  • PAPERLESS_MCP_SHUTDOWN_GRACE_S Seconds SIGTERM may spend draining in-flight requests before the HTTP server exits. Keep it at or below the termination grace period the orchestrator allows. `0` drops in-flight requests immediately.
  • PAPERLESS_MCP_BASE_URL Public base URL of the deployed server, for example `https://mcp.example.com`. Required for OIDC. Also the fallback source of the MCP Apps domain when `app_domain` is unset.
  • PAPERLESS_MCP_BEARER_TOKEN سري Single shared bearer token; enables bearer auth unless `bearer_tokens_file` is set, which takes precedence.
  • PAPERLESS_MCP_OIDC_CONFIG_URL OIDC discovery document URL, for example `https://auth.example.com/.well-known/openid-configuration`.
  • PAPERLESS_MCP_OIDC_CLIENT_ID OIDC client identifier registered with the provider.
  • PAPERLESS_MCP_OIDC_CLIENT_SECRET سري OIDC client secret registered with the provider.
  • PAPERLESS_MCP_OIDC_AUDIENCE Expected `aud` claim; tokens issued for another audience are rejected.
  • PAPERLESS_MCP_OIDC_REQUIRED_SCOPES Scopes a caller must present, space- or comma-separated. Defaults to `openid` in oidc-proxy mode.
  • PAPERLESS_MCP_OIDC_ADVERTISED_SCOPES Scopes advertised to MCP clients in protected-resource metadata, space- or comma-separated. Overrides the default `openid offline_access`; `oidc_required_scopes` is always added on top. Set this when the registered client is not permitted `offline_access`, or to have clients request extra claim scopes (such as `groups`) without also requiring them in every token.
  • PAPERLESS_MCP_OIDC_JWT_SIGNING_KEY سري Signing key for issued tokens; used in oidc-proxy mode only. When unset, the key is derived deterministically from `oidc_client_secret`, so tokens survive a restart. Rotating that secret then invalidates every issued token. Set this explicitly to decouple token validity from secret rotation. Generate with `openssl rand -hex 32`.
  • PAPERLESS_MCP_OIDC_VERIFY_ACCESS_TOKEN Validate the access token instead of the id token.
  • PAPERLESS_MCP_KV_STORE_URL Persistent-state backend URL shared by every pvl-core subsystem that needs state. `memory://` is in-process and lost on restart; `file:///path` persists on one server; `redis://`, `dynamodb://` and `mongodb://` each need their matching extra. When unset, defaults to `file:///data/state` (the volume family Docker images mount), or to `memory://` (with a warning) on a host where that directory is not usable.
  • PAPERLESS_MCP_APP_DOMAIN MCP Apps iframe domain, used for CSP sandboxing. Overrides the host derived from `base_url`.
  • PAPERLESS_MCP_TOOLS_ALLOW Comma-separated explicit tool names this instance exposes; every other tool is hidden from listings and cannot be invoked. Names matching no registered tool are inert. Mutually exclusive with `tools_deny`. Takes effect through `apply_tool_visibility`.
  • PAPERLESS_MCP_TOOLS_DENY Comma-separated explicit tool names hidden from this instance (absent from listings, cannot be invoked). Names matching no registered tool are inert. Mutually exclusive with `tools_allow`. Takes effect through `apply_tool_visibility`.
  • PAPERLESS_MCP_AUTH_MODE Explicit auth-mode override, accepting `remote` or `oidc-proxy` (case- and whitespace-insensitive). When unset the mode is auto-detected from which auth variables are set; the override exists because having all four OIDC variables set is ambiguous between those two modes. Other values are ignored with a warning.
  • PAPERLESS_MCP_BEARER_TOKENS_FILE Path to a TOML file mapping bearer tokens to subjects; overrides the single-token `bearer_token` mode.
  • PAPERLESS_MCP_BEARER_DEFAULT_SUBJECT Subject assigned to the single-token bearer mode; ignored when `bearer_tokens_file` is set, since mapped mode carries per-token subjects.
  • PAPERLESS_MCP_SERVER_NAME Rename this server instance; defaults to the project name.
  • PAPERLESS_MCP_INSTANCE_DESCRIPTION Concise routing context that distinguishes this deployment's material or responsibility.
  • PAPERLESS_MCP_INSTRUCTIONS_EXTRA Deployment-specific behavioral policy added to the generated MCP instructions.
  • PAPERLESS_MCP_INSTRUCTIONS Legacy: replaces all generated MCP instructions (deprecated; use _INSTANCE_DESCRIPTION for routing and _INSTRUCTIONS_EXTRA for policy).
  • PAPERLESS_MCP_HTTP_PATH Mount path for the MCP endpoint; the health routes derive their prefix from it.
  • PAPERLESS_MCP_HEALTH_DETAIL How much the unauthenticated /health and /health/ready bodies say: status, standard (adds name, version and per-check verdicts), or full (adds redacted reasons; trusted networks only).
  • PUID Run the server process as this UID; the container entrypoint reassigns ownership of writable paths to match.
  • PGID Run the server process as this GID; pair with PUID to match the owner of a mounted volume.
  • PAPERLESS_MCP_LOG_LEVEL Log level for every logger in the process, FastMCP's included (DEBUG / INFO / WARNING / ERROR / CRITICAL). The -v CLI flag overrides to DEBUG. The unprefixed FASTMCP_LOG_LEVEL still works for one major version and logs a deprecation warning.
  • PAPERLESS_MCP_LOG_FORMAT Log rendering. rich is one colour event key=value line per record, for a terminal; json is one JSON object per record, for a collector. Unset picks rich when stderr is a terminal and json everywhere else, so a container or journald gets JSON with no configuration.
  • PAPERLESS_MCP_PAPERLESS_URL Base URL of the Paperless-NGX REST API, without a trailing slash. The server refuses to start without it.
  • PAPERLESS_MCP_API_TOKEN سري Paperless service-account token used for outbound API requests. The server refuses to start without it.
  • PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS Per-request HTTP timeout in seconds.
  • PAPERLESS_MCP_HTTP_RETRIES Retries for idempotent requests after network errors or 5xx responses.
  • PAPERLESS_MCP_DEFAULT_PAGE_SIZE Default page size for list tools, from 1 through 100.
  • PAPERLESS_MCP_PAPERLESS_PUBLIC_URL Public Paperless UI URL for user-visible links; defaults to PAPERLESS_URL.
  • PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S Link lifetime in seconds when the caller requests no explicit TTL.
  • PAPERLESS_MCP_TRANSFER_TTL_MAX_S Ceiling in seconds a caller-requested link TTL is clamped to.
  • PAPERLESS_MCP_TRANSFER_GRACE_TTL_S Post-success grace window in seconds: a served token's TTL shrinks to this so a stalled transfer can retry within it.
  • PAPERLESS_MCP_TRANSFER_LEASE_S Crashed-handler reclaim window in seconds for an in-flight reservation.
  • PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES Maximum size in bytes of a single upload.

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Paperless MCP
  2. Features
  3. What you can do with it
  4. Installation
  5. Release channels
  6. Quick start
  7. Configuration
  8. Authentication
  9. Post-scaffold checklist
  10. GitHub secrets
  11. Local development
  12. Troubleshooting
  13. Contributing
  14. Links
  15. Domain configuration
  16. Key design decisions

Paperless MCP

Paperless-NGX over MCP: search, read, upload and tag documents; manage correspondents and types.

Documentation | Config wizard | PyPI | Docker

Features

  • File transfer links: Download document files and full OCR Markdown over HTTP. Upload files, including Markdown, through the same transfer route. Set PAPERLESS_MCP_BASE_URL to enable the tools. File bytes stay outside model context. See file transfer links.
  • Document search & retrieval: full-text and filtered list queries against Paperless-NGX, plus access to extracted OCR text, metadata, and thumbnails.
  • Tag, correspondent, document-type, custom-field management: full CRUD and bulk-edit for every classification dimension Paperless exposes.
  • Document lifecycle supports uploads, field changes, notes, audit history, and AI-suggested tags/correspondents/types.
  • Operational introspection covers saved views, storage paths, share links, background tasks (with wait_for_task), statistics, and an upstream release check for Paperless-NGX.
  • MCP tools: 49 LLM-visible tools with Lucide icons; see src/paperless_mcp/tools/.
  • MCP resources: 16 URIs exposing bounded document previews and domain collections; see src/paperless_mcp/resources/.

What you can do with it

With this server mounted in an MCP client (Claude, etc.), you can:

  • "Find last quarter's invoices from ACME." Composes search_documents with a correspondent filter, then reads bounded previews with get_document_content.
  • "Tag these three documents as 'reviewed' and move them to the Accounting correspondent." Uses bulk_edit_documents in a single call.
  • "Upload this PDF and wait until OCR finishes." Composes upload_document + wait_for_task so the assistant only reports back once the document is indexed.
  • "What changed on document 4213 in the last week?" Reads paperless://documents/4213/history and summarises the audit trail.

Every tool and resource is listed in the documentation site: Tools and Resources. The Paperless variables the server reads are in Configuration.

Installation

From PyPI
pip install pvliesdonk-paperless-mcp

If you add optional extras via the PROJECT-EXTRAS-START / PROJECT-EXTRAS-END sentinels in pyproject.toml, document them below:

  • pip install pvliesdonk-paperless-mcp[docs]: installs mkdocs-material and mkdocstrings[python] for building the documentation site locally (uv run mkdocs serve).
From source
git clone https://github.com/pvliesdonk/paperless-mcp.git
cd paperless-mcp
uv sync --all-extras --all-groups
Docker
docker pull ghcr.io/pvliesdonk/paperless-mcp:latest

To run the newest merged code instead of the newest release, use the rolling edge tag. It is rebuilt on every merge to main and carries no version identity. See Image tags for the full tag list.

docker pull ghcr.io/pvliesdonk/paperless-mcp:edge

A compose.yml ships at the repo root and runs as-is: copy .env.example to .env, then docker compose up -d. It publishes port 8000 on the host and assumes no reverse proxy; Docker Compose covers the configuration split, the domain sentinel blocks, and a Traefik overlay.

To attach a remote Python debugger (development only; the protocol is unauthenticated), see Remote debugging.

Linux packages (.deb / .rpm)

Download .deb or .rpm packages from the GitHub Releases page. Both install a hardened systemd unit; env configuration is sourced from /etc/paperless-mcp/env (copy from the shipped /etc/paperless-mcp/env.example).

Claude Desktop (.mcpb bundle)

Download the .mcpb bundle from the GitHub Releases page and double-click to install, or run:

mcpb install paperless-mcp-<version>.mcpb

Claude Desktop prompts for required env vars via a GUI wizard, with no manual JSON editing needed.

For manual Claude Desktop configuration and setup options, see Claude Desktop deployment.

Release channels

Artifacts ship on three channels. Each row lists exactly what that channel publishes.

ChannelVersion identityArtifacts
edge (rolling)None; the commit is the identityDocker image :edge rebuilt on every merge to main; .mcpb bundle as the mcpb-bundle-edge workflow artifact; Claude Code plugin .zip as the plugin-zip-edge artifact; rolling unstable docs version. It leaves no git tag, GitHub release, or PyPI entry behind.
Pre-releasevX.Y.Z-rc.N, computed and reviewed in its release pull requestPyPI (as the pre-release X.Y.ZrcN); GitHub release with wheels, sdist, .deb/.rpm packages, .mcpb bundle, plugin .zip, and SBOM attached; Docker image under its immutable vX.Y.Z-rc.N tag plus the ordering-aware rolling rc tag. Skips the plugin marketplace, the MCP registry, and the docs deploy.
StablevX.Y.ZEverything: PyPI, Docker (version tag plus ordering-aware latest / vX / vX.Y), .deb/.rpm, GitHub release assets (wheels, sdist, .mcpb bundle, plugin .zip, SBOM), plugin marketplace and MCP registry entries (when the release is the newest stable), versioned docs with an ordering-aware latest alias.

Pre-releases reach PyPI so that a candidate's .mcpb bundle installs: the bundle points at PyPI rather than carrying the code. Ordinary installers never see them, because a PEP 440 resolver skips pre-releases unless the requirement pins one or you pass --pre. Ask for a candidate by name with pip install pvliesdonk-paperless-mcp==X.Y.ZrcN. PyPI spells it in the PEP 440 canonical form, while tags use SemVer. Rolling pointers are ordering-aware, so a patch release cut from an old release/X.Y branch never moves latest-style tags back to older content, and a candidate for an already-released version never moves rc. See Release process for the full model.

Quick start

paperless-mcp serve                                # stdio transport
paperless-mcp serve --transport http --port 8000   # streamable HTTP

For library usage (embedding the domain logic without the MCP transport), import from the paperless_mcp package directly. See the project's domain modules under src/paperless_mcp/ for entry points.

Server info

The server registers a built-in get_server_info tool (via fastmcp_pvl_core.register_server_info_tool) so operators can confirm the deployed version with a single MCP call. The default response carries server_name, server_version, and core_version. Servers that talk to a remote upstream wire upstream version reporting inside the DOMAIN-UPSTREAM-START / DOMAIN-UPSTREAM-END sentinel in src/paperless_mcp/server.py; see tool-registration for the wiring pattern.

Health

The server serves /health (liveness, a static 200) and /health/ready (readiness, 503 when a backing store or a domain check fails) outside the MCP mount and outside auth, via fastmcp_pvl_core.register_health_routes. compose.yml probes the first. Domain readiness checks go in the health_checks dict in src/paperless_mcp/server.py; see Docker deployment for the routes, the mount-path rule, and PAPERLESS_MCP_HEALTH_DETAIL.

Configuration

The most common environment variables, shared across all fastmcp-pvl-core-based services:

VariableDefaultDescription
PAPERLESS_MCP_KV_STORE_URLfile:///data/statePersistent-state backend URL shared by every pvl-core subsystem that needs state. memory:// is in-process and lost on restart; file:///path persists on one server; redis://, dynamodb:// and mongodb:// each need their matching extra. When unset, defaults to file:///data/state (the volume family Docker images mount), or to memory:// (with a warning) on a host where that directory is not usable.
PAPERLESS_MCP_LOG_LEVELINFOLog level for every logger in the process, FastMCP's included (DEBUG / INFO / WARNING / ERROR / CRITICAL). The -v CLI flag overrides to DEBUG. The unprefixed FASTMCP_LOG_LEVEL still works for one major version and logs a deprecation warning.
PAPERLESS_MCP_LOG_FORMAT(none)Log rendering. rich is one colour event key=value line per record, for a terminal; json is one JSON object per record, for a collector. Unset picks rich when stderr is a terminal and json everywhere else, so a container or journald gets JSON with no configuration.

This table and the one under Domain configuration are curated subsets. The complete generated reference, with every variable the server reads, is the configuration reference; .env.example lists the same surface in copy-paste form.

Authentication

Callers authenticate via a bearer token or OIDC (mutually exclusive). See the Authentication guide for setup, mapped multi-subject tokens, OIDC, and troubleshooting.

Post-scaffold checklist

After copier copy and gh repo create --push:

  1. Fill in the DOMAIN blocks (every section marked with a DOMAIN sentinel comment) in this README and in AGENTS.md. The GENERATED-ENV-TABLE-* regions are not DOMAIN blocks; the config generator owns them and rewrites them on every run.
  2. Configure GitHub secrets (see below).
  3. Install dev + docs tooling: uv sync --all-extras --all-groups.
  4. Install pre-commit hooks: uv run pre-commit install.
  5. Run the gate locally: uv run pytest -x -q && uv run ruff check --fix . && uv run ruff format . && uv run mypy src/ tests/.
  6. Push the first commit. CI should be green.

GitHub secrets

CI workflows reference two required repository secrets and one optional Claude token. Configure them via Settings → Secrets and variables → Actions or with gh secret set:

SecretUsed byHow to generate
RELEASE_TOKENrelease-prepare.yml, release.yml, copier-update.yml, renovate.yml, bootstrap.ymlFine-grained PAT at https://github.com/settings/personal-access-tokens/new with contents: write, pull_requests: write, and administration: write (bootstrap applies the repository rulesets, auto-merge, the security settings, and the About block). Must belong to a repository admin: the shipped rulesets grant bypass to the admin role, and the release tag + GitHub release that knope creates after a release pull request merges rely on it (pull requests the token opens also need it so their CI runs). Scoped to this repo.
SONAR_TOKENci.ymlhttps://sonarcloud.io: after importing the repository, open its Administration → Analysis Method page. Turn Automatic Analysis off there first, because SonarQube Cloud refuses a CI scan while it is on; choosing GitHub Actions then shows the token. Until the secret exists, CI skips the scan.
CLAUDE_CODE_OAUTH_TOKENclaude.ymlOptional. Run claude setup-token locally and configure this only for @claude or opted-in automatic review.
gh secret set RELEASE_TOKEN
gh secret set SONAR_TOKEN
# Optional: enables @claude and opted-in automatic review.
gh secret set CLAUDE_CODE_OAUTH_TOKEN

Dependency updates are handled by Renovate (renovate.yml), which reuses RELEASE_TOKEN. It maintains uv.lock and auto-merges patch/minor bumps once the CI Success check is green; bootstrap.yml enables auto-merge, applies the repository rulesets (.github/rulesets/), turns on private vulnerability reporting and Dependabot alerts, and fills the repository's About block (description, website, topics) from pyproject.toml on first push. See Repository Protection for the per-branch posture, bypass model, and security settings. GitHub Actions are updated in the copier template and arrive via copier update, not per-repo.

GITHUB_TOKEN is auto-provided; no action needed.

Local development

The PR gate (matches CI):

uv run pytest -x -q                                  # tests
uv run ruff check --fix . && uv run ruff format .    # lint + format
uv run mypy src/ tests/                              # type-check

Pre-commit runs a subset of the gate on each commit; see .pre-commit-config.yaml for details, or AGENTS.md for the full Hard PR Acceptance Gates.

CI requires tests to pass on Python 3.11 through 3.14. Python 3.14 also collects branch coverage and enforces the 80% total and patch coverage thresholds. To reproduce that test command, run uv run --python 3.14 pytest --cov --cov-report=xml --durations=20.

Troubleshooting

Moving a scaffolded project

uv sync creates .venv/bin/* scripts with absolute shebangs pointing at the venv Python. If you move the repo after scaffolding (mv /old/path /new/path), uv run pytest fails with ModuleNotFoundError: No module named 'fastmcp' because the stale shebang resolves to a different interpreter than the venv's site-packages.

Fix:

rm -rf .venv
uv sync --all-extras --all-groups

uv run python -m pytest also works as a one-shot workaround (bypasses the stale entry-script shim).

uv.lock refresh after copier update

When copier update introduces new dependencies (such as a new extra added to pyproject.toml.jinja), the CI install step runs uv sync --locked, which fails against a stale lockfile. Run uv lock locally and commit the refreshed uv.lock alongside accepting the copier-update PR.

CI installs with --locked (and the review workflow with --frozen) so no job ever rewrites uv.lock in its own workspace: a job that re-locks hides the drift it just repaired, and a dirty workspace breaks any later git checkout in the same job. Lockfile drift then shows up as a red install step with a clear message, not as a silent mutation.

Contributing

CONTRIBUTING.md holds the rules for issues and pull requests, and where a fix belongs: fastmcp-pvl-core for library code, the template for template-owned files, this repository for anything inside its DOMAIN-* / CONFIG-* / PROJECT-* blocks. AGENTS.md carries the conventions and gates; the skills under .agents/skills/ carry the task procedures, among them self-reviewing (local self-review before a pull request), writing-release-notes (release notes), applying-template-updates (the weekly template update pull request) and authoring-issues-prs (filing). The release procedure is in docs/deployment/release-process.md; the template update procedure in docs/deployment/template-updates.md. SECURITY.md says how to report a vulnerability privately, and what to expect after.

Domain configuration

The variables this project features as its entry points (domain variables use the PAPERLESS_MCP_ prefix):

VariableDefaultRequiredDescription
PAPERLESS_MCP_PAPERLESS_URL(none)YesBase URL of the Paperless-NGX REST API, without a trailing slash.
PAPERLESS_MCP_API_TOKEN(none)YesPaperless service-account token used for outbound API requests.
PAPERLESS_MCP_PAPERLESS_PUBLIC_URL(none)NoPublic Paperless UI URL for user-visible links; defaults to PAPERLESS_URL.

This is a curated subset: a field appears here when its tags metadata includes readme. Every domain variable is documented in the configuration reference, grouped the same way the config wizard presents them.

Domain-config fields are composed inside src/paperless_mcp/config.py between the CONFIG-FIELDS-START / CONFIG-FIELDS-END sentinels; env reads go through fastmcp_pvl_core.env(_ENV_PREFIX, "SUFFIX", default) so naming stays consistent, and field invariants go in __post_init__ between the CONFIG-VALIDATE-START / CONFIG-VALIDATE-END sentinels. Each field's metadata help, tags, and wizard group generate the reference tables directly, so keep them accurate and complete.

Key design decisions

  • Read-only deployments use tool visibility, not a domain switch. Set PAPERLESS_MCP_TOOLS_DENY (or PAPERLESS_MCP_TOOLS_ALLOW) to hide the mutating tools, including create_upload_link when transfers are enabled. The template applies visibility last in make_server, so hidden tools leave tools/list and are rejected on tools/call. Clients cannot invoke a write that will be refused, and the rule lives in one place for every server built on this template.
  • HTTP layer retries idempotent reads only. PAPERLESS_MCP_HTTP_RETRIES applies to GETs on 5xx/network errors; writes never retry automatically, to avoid double-applying bulk edits or uploads.
  • Tool icons come from Lucide. Every tool carries a Lucide icon hint so MCP clients that render icons (Claude Desktop) get a coherent visual surface. See src/paperless_mcp/tools/_icons.py.
  • Paperless API compatibility: requests prefer payload version 10, with automatic version 9 fallback for Paperless 2.x after an explicit version rejection. Tasks include structured results and timing data while retaining the legacy fields. Saved-view visibility flags can now be null; Python consumers must handle that value. See task tools.
  • Models accept unknown upstream fields. Pydantic models use lenient validation for list-endpoint responses so newer Paperless-NGX versions do not break the client (the Document.some_future_paperless_field test pins this behaviour).
  • No prompts ship in v1. prompts.py is intentionally empty; prompts land as concrete user-workflow patterns emerge in practice.

الأسئلة الشائعة

ما هو Paperless MCP؟

Paperless-NGX over MCP: search, read, upload and tag documents; manage correspondents and types.

كيف أثبّت Paperless MCP؟

يعمل على جهازك. في Claude Code: claude mcp add paperless-mcp -e 'PAPERLESS_MCP_KV_STORE_URL=file:///data/state' -e 'PAPERLESS_MCP_TOOLS_ALLOW=<PAPERLESS_MCP_TOOLS_ALLOW>' -e 'PAPERLESS_MCP_TOOLS_DENY=<PAPERLESS_MCP_TOOLS_DENY>' -e 'PAPERLESS_MCP_SERVER_NAME=<PAPERLESS_MCP_SERVER_NAME>' -e 'PAPERLESS_MCP_INSTANCE_DESCRIPTION=<PAPERLESS_MCP_INSTANCE_DESCRIPTION>' -e 'PAPERLESS_MCP_INSTRUCTIONS_EXTRA=<PAPERLESS_MCP_INSTRUCTIONS_EXTRA>' -e 'PAPERLESS_MCP_INSTRUCTIONS=<PAPERLESS_MCP_INSTRUCTIONS>' -e 'PAPERLESS_MCP_LOG_LEVEL=INFO' -e 'PAPERLESS_MCP_LOG_FORMAT=<PAPERLESS_MCP_LOG_FORMAT>' -e 'PAPERLESS_MCP_PAPERLESS_URL=<PAPERLESS_MCP_PAPERLESS_URL>' -e 'PAPERLESS_MCP_API_TOKEN=<your paperless_mcp_api_token>' -e 'PAPERLESS_MCP_HTTP_TIMEOUT_SECONDS=30.0' -e 'PAPERLESS_MCP_HTTP_RETRIES=2' -e 'PAPERLESS_MCP_DEFAULT_PAGE_SIZE=25' -e 'PAPERLESS_MCP_PAPERLESS_PUBLIC_URL=<PAPERLESS_MCP_PAPERLESS_PUBLIC_URL>' -e 'PAPERLESS_MCP_TRANSFER_TTL_DEFAULT_S=3600.0' -e 'PAPERLESS_MCP_TRANSFER_TTL_MAX_S=86400.0' -e 'PAPERLESS_MCP_TRANSFER_GRACE_TTL_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_LEASE_S=60.0' -e 'PAPERLESS_MCP_TRANSFER_MAX_UPLOAD_BYTES=104857600' -- uvx pvliesdonk-paperless-mcp==3.0.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Paperless MCP إلى مفتاح API؟

نعم. يتطلب PAPERLESS_MCP_API_TOKEN, PAPERLESS_MCP_BEARER_TOKEN, PAPERLESS_MCP_OIDC_CLIENT_SECRET, PAPERLESS_MCP_OIDC_JWT_SIGNING_KEY، وتضبطها في إعداداته.

هل Paperless MCP مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Paperless MCP؟

ينشره pvliesdonk. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.