Skip to main content
Glama
Paperless-ngx MCP Server

Paperless-ngx MCP Server

by NamerekT

Paperless-ngx MCP Server

A Model Context Protocol (MCP) server that connects AI assistants (such as Claude Desktop, Cursor, and other MCP clients) to a Paperless-ngx document archive.

Features

  • Full-Text & Metadata Search: Search through documents using OCR text, tags, correspondents, document types, and date ranges.

  • OCR Content Inspection: Read full OCR text, metadata, and custom notes for any document.

  • Document Download: Save original or archived PDF versions to local storage.

  • Metadata Management: View reference collections (tags, correspondents, document types) and update document properties.

  • Document Upload: Upload local files into Paperless with automatic background OCR processing.

  • Archive Statistics: Retrieve instant counts of documents, tags, correspondents, and types.


Related MCP server: Paperless-NGX MCP Server

Tools Reference

Tool

Parameters

Description

search_documents

query, tags, correspondent, document_type, created_after, created_before, limit

Search documents with filters and text query

get_document

document_id, include_content

Get document metadata and OCR content

download_document

document_id, original, save_as

Download original file or archive PDF to disk

list_tags

—

List all tags with item counts

list_correspondents

—

List all correspondents with item counts

list_document_types

—

List all document types with item counts

stats

—

Summary of counts across the archive

update_document

document_id, title, correspondent, document_type, add_tags, remove_tags, create_missing

Update metadata and assign/remove tags

upload_document

file_path, title, correspondent, document_type, tags, created, create_missing

Upload a new file with metadata


Configuration

The server requires the following environment variables:

Variable

Description

Example

PAPERLESS_URL

Base URL of the Paperless-ngx instance

http://localhost:8000

PAPERLESS_TOKEN

Paperless API authentication token

your_api_token_here

PAPERLESS_DOWNLOAD_DIR

(Optional) Path where downloaded documents will be saved

~/Downloads


Installation & Setup

For detailed installation instructions, see SETUP.md.

Quick Start (Claude Desktop Config)

Add the server to your claude_desktop_config.json:

{
  "mcpServers": {
    "paperless": {
      "command": "python",
      "args": ["/path/to/src/server.py"],
      "env": {
        "PAPERLESS_URL": "http://localhost:8000",
        "PAPERLESS_TOKEN": "your_api_token_here",
        "PAPERLESS_DOWNLOAD_DIR": "/path/to/downloads"
      }
    }
  }
}

Or run via uv:

{
  "mcpServers": {
    "paperless": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mcp-paperless", "src/server.py"],
      "env": {
        "PAPERLESS_URL": "http://localhost:8000",
        "PAPERLESS_TOKEN": "your_api_token_here",
        "PAPERLESS_DOWNLOAD_DIR": "/path/to/downloads"
      }
    }
  }
}

Helper Script

A PowerShell helper script paperless-api.ps1 is provided for quick CLI interaction and testing:

# Get archive summary
.\paperless-api.ps1 -Token "your_token"

# Query documents
.\paperless-api.ps1 -Token "your_token" -Endpoint "documents/?page_size=5"

# Export all tags to JSON
.\paperless-api.ps1 -Token "your_token" -Endpoint "tags/" -All -OutFile tags.json

Packaging as MCP Bundle (.mcpb)

To build the desktop bundle:

Compress-Archive -Path manifest.json,pyproject.toml,src -DestinationPath paperless-ngx.zip -Force
Move-Item paperless-ngx.zip paperless-ngx.mcpb -Force

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

9 tools
download_documentB

Download document file to local disk.

original True for original uploaded file, False for archived PDF version save_as Full target path; defaults to PAPERLESS_DOWNLOAD_DIR

Inputs: document_id (required), save_as, original.

get_documentC

Retrieve document metadata and extracted OCR text by ID.

Inputs: document_id (required), include_content.

list_correspondentsA

List all correspondents with document counts.

Inputs: no named parameters. Returns: result

list_document_typesA

List all document types with document counts.

Inputs: no named parameters. Returns: result

list_tagsA

List all tags with document counts.

Inputs: no named parameters. Returns: result

search_documentsA

Search documents in Paperless.

query Full-text search query across content and title tags List of tag names (document must have all specified tags) correspondent Correspondent name document_type Document type name created_after Date YYYY-MM-DD, strictly after created_before Date YYYY-MM-DD, strictly before limit Maximum number of records to return

Inputs: tags, limit, query, correspondent, +3 more.

statsA

Archive summary: counts of documents, tags, correspondents, types, and storage paths.

Inputs: no named parameters.

update_documentA

Update document title, correspondent, type, and tags.

correspondent / document_type — name or ID; empty string "" clears the field. add_tags / remove_tags — lists of tag names. create_missing — whether to create missing tags/correspondents/types automatically.

Inputs: document_id (required), title, add_tags, remove_tags, +3 more.

upload_documentA

Upload a file to Paperless.

file_path Local path to PDF/image on this machine created Document date YYYY-MM-DD Returns task ID — processing and OCR run asynchronously in the background.

Inputs: file_path (required), tags, title, created, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools target distinct actions or resources, but stats and the list_* tools both report counts for tags, correspondents, and types, which could cause some ambiguity. search/get/download/update/upload are clearly separated.

    Naming Consistency4/5

    Eight tools follow a consistent verb_noun pattern such as search_documents, get_document, list_tags, and upload_document. The exception is 'stats', which breaks the pattern and would be clearer as get_stats or get_summary.

    Tool Count5/5

    Nine tools is well-scoped for a document management server: search, retrieve, download, upload, update, reference-data listers, and a stats summary. Each tool earns its place without feeling redundant.

    Completeness3/5

    Core document operations are covered, including upload, search, get, download, and update, but there is no delete_document and no way to poll the async task ID returned by upload_document. Reference-data creation is only implicitly handled through update_document's create_missing flag.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers