npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

paperless-mcp-server

v1.2.0

Published

Model Context Protocol server for Paperless-ngx document management system

Downloads

31

Readme

Paperless MCP Server

npm version

A Model Context Protocol (MCP) server for integrating with Paperless-ngx document management system. This server enables AI assistants to search, retrieve, and manage documents stored in Paperless-ngx through a standardized interface.

Features

🔧 Tools (41 total)

Transport Options

The server supports three transport modes, selectable via the MCP_TRANSPORT environment variable:

  • stdio (default): For MCP clients like Claude Desktop that use stdin/stdout communication
  • http: For HTTP-based integrations (e.g., ChatGPT, browser clients)
  • both: Start both HTTP and STDIO servers simultaneously

Example Usage

# Environment variables
export PAPERLESS_URL="http://your-paperless-instance:8000"
export PAPERLESS_TOKEN="your_api_token_here"

# STDIO only (default)
export MCP_TRANSPORT="stdio"
./start.sh

# HTTP only
export MCP_TRANSPORT="http"
export MCP_PORT="3000"
./start.sh

# Both HTTP and STDIO
export MCP_TRANSPORT="both"
export MCP_PORT="3000"
./start.sh

The start script will:

  • Start the MCP server(s) according to your selected mode
  • Print local HTTP endpoints and/or STDIO readiness

No tunneling or public exposure is included by default. For remote access, use your own reverse proxy, VPN, or secure tunnel solution.

HTTP endpoints:

  • GET /health - Health check
  • POST /api - Modern Streamable HTTP with Mcp-Session-Id headers (for ChatGPT)
  • Legacy endpoints: GET /message, POST /message, /mcp (SSE-based)

System & Tasks (4 tools)

  • list_tasks: List all tasks in Paperless-ngx
  • acknowledge_task: Acknowledge a completed task
  • get_statistics: Get Paperless-ngx statistics (doc counts, types, etc.)
  • get_logs: Get Paperless-ngx system logs

📄 Resources

  • Document Content: Access full document content as resources for AI context
  • Document Metadata: Structured access to document information

Installation

Prerequisites

  • Node.js 18 or higher
  • A running Paperless-ngx instance
  • API token for your Paperless-ngx instance

Install from npm

npm install -g paperless-mcp-server

Migration Note: The package was previously published as @mweinheimer/paperless-mcp-server but has been moved to the unscoped paperless-mcp-server. If you have the old version installed, please uninstall it first:

npm uninstall -g @mweinheimer/paperless-mcp-server
npm install -g paperless-mcp-server

Install with npx (no global installation)

npx paperless-mcp-server

Configuration

Set the following environment variables:

  • PAPERLESS_URL: URL of your Paperless-ngx instance (default: http://localhost:8000)
  • PAPERLESS_TOKEN: Your Paperless-ngx API token (required)

Getting Your API Token

  1. Log into your Paperless-ngx web interface
  2. Go to Settings → API Tokens
  3. Create a new token or copy an existing one

Usage

With Claude Desktop

Add the following to your Claude Desktop configuration file (claude_desktop_config.json):

Using global installation:

{
  "mcpServers": {
    "paperless": {
      "command": "paperless-mcp",
      "env": {
        "PAPERLESS_URL": "http://your-paperless-instance:8000",
        "PAPERLESS_TOKEN": "your_api_token_here"
      }
    }
  }
}

Using npx (recommended):

{
  "mcpServers": {
    "paperless": {
      "command": "npx",
      "args": ["-y", "paperless-mcp-server"],
      "env": {
        "PAPERLESS_URL": "http://your-paperless-instance:8000",
        "PAPERLESS_TOKEN": "your_api_token_here"
      }
    }
  }
}

Transport Options

The server supports two transport protocols:

STDIO Transport (Default)

For MCP clients like Claude Desktop that use stdin/stdout communication:

# Environment variables
export PAPERLESS_URL="http://your-paperless-instance:8000"
export PAPERLESS_TOKEN="your_api_token_here"

# Run with STDIO (default)
paperless-mcp

HTTP Transport

For HTTP-based integrations with ChatGPT and other HTTP clients using Streamable HTTP protocol:

# Clone the repository for development setup
git clone https://github.com/heimerle/paperless-mcp-server
cd paperless-mcp-server

# Install dependencies
npm install

# Configure your Paperless settings
cp config.example.sh config.sh
# Edit config.sh with your Paperless-ngx URL and API token

# Set transport mode to HTTP (optional, default is stdio)
export MCP_TRANSPORT="http"
export MCP_PORT="3000"

# Load config and start server
source config.sh
./start.sh

The start script will:

  1. Start the MCP server on the configured port (default 3000)
  2. Print local HTTP endpoints for health and API access

No tunneling or public exposure is included by default. For remote access, use your own reverse proxy, VPN, or secure tunnel solution.

HTTP endpoints:

  • GET /health - Health check
  • POST /api - Modern Streamable HTTP with Mcp-Session-Id headers (for ChatGPT)
  • Legacy endpoints: GET /message, POST /message, /mcp (SSE-based)

With Other MCP Clients

The server can be used with any MCP-compatible client. Launch it with:

Using global installation:

PAPERLESS_URL=http://your-paperless-instance:8000 PAPERLESS_TOKEN=your_token paperless-mcp

Using npx:

PAPERLESS_URL=http://your-paperless-instance:8000 PAPERLESS_TOKEN=your_token npx paperless-mcp-server

API Coverage

This MCP server provides comprehensive coverage of the Paperless-ngx API:

Fully Implemented (41 MCP Tools)

  • Documents: Full CRUD + search, content, metadata, suggestions, bulk operations
  • Tags: Complete CRUD operations
  • Correspondents: Complete CRUD operations
  • Document Types: Complete CRUD operations
  • Storage Paths: Complete CRUD operations
  • Custom Fields: Complete CRUD operations (all data types)
  • Saved Views: Complete CRUD operations with filters
  • Tasks: List and acknowledge tasks
  • System: Statistics and logs

Paperless-ngx API Endpoints Used

  • /api/documents/ - Document operations
  • /api/documents/{id}/ - Specific document access
  • /api/documents/{id}/content/ - Full text content
  • /api/documents/{id}/download/ - Original file download
  • /api/documents/{id}/suggestions/ - AI metadata suggestions
  • /api/documents/{id}/metadata/ - Extracted metadata
  • /api/tags/ - Tag management
  • /api/correspondents/ - Correspondent management
  • /api/document_types/ - Document type management
  • /api/storage_paths/ - Storage path configuration
  • /api/custom_fields/ - Custom field definitions
  • /api/saved_views/ - Saved view management
  • /api/tasks/ - Background task monitoring
  • /api/statistics/ - System statistics
  • /api/logs/ - System logs

Example Interactions

Search for Documents

"Find all documents from John Doe about invoices"

Get Document Details

"Show me the details of document 123"

Update Document Metadata

"Tag document 456 with 'important' and 'financial'"

Create New Tags

"Create a new tag called 'urgent' with red color"

Bulk Update Documents

"Update documents 123, 456, and 789 to add the 'processed' tag and set correspondent to 'John Doe'"

Development

Building

npm run build

Development Mode

npm run dev

Testing with MCP Inspector

# With global installation
npx @modelcontextprotocol/inspector paperless-mcp

# With npx
npx @modelcontextprotocol/inspector npx paperless-mcp-server

Security Considerations

  • Keep your API token secure and never commit it to version control
  • Use environment variables or secure configuration management
  • Ensure your Paperless-ngx instance is properly secured
  • Consider network security when exposing Paperless-ngx API

Troubleshooting

Common Issues

  1. Authentication Error: Verify your API token is correct and has necessary permissions
  2. Connection Error: Check that PAPERLESS_URL is accessible from where the MCP server runs
  3. Missing Documents: Ensure the user associated with the API token has access to the documents

Logging

The server logs errors to stderr. Check these logs when troubleshooting issues.

Publishing to npm

This package is configured for easy publishing to npm. To publish a new version:

Prerequisites

  • npm account with publishing rights
  • Logged in to npm (npm login)

Publishing Steps

  1. Update version (choose one):

    npm version patch  # 1.0.0 -> 1.0.1
    npm version minor  # 1.0.0 -> 1.1.0
    npm version major  # 1.0.0 -> 2.0.0
  2. Publish to npm:

    npm publish
  3. Verify publication:

    npm info paperless-mcp-server

The package includes:

  • Automatic build on prepublishOnly
  • Proper file filtering via .npmignore
  • Executable binary (paperless-mcp)
  • TypeScript declarations
  • Public access configuration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Links