mcp-server-paperless 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_server_paperless-0.2.0/LICENSE +21 -0
- mcp_server_paperless-0.2.0/PKG-INFO +317 -0
- mcp_server_paperless-0.2.0/README.md +296 -0
- mcp_server_paperless-0.2.0/pyproject.toml +313 -0
- mcp_server_paperless-0.2.0/pyproject.toml.orig +302 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/__init__.py +6 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/__main__.py +5 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/app.py +505 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/cli.py +86 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/__init__.py +4 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/admin.py +444 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/ai.py +94 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/bulk.py +353 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/credentials.py +25 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/documents.py +654 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/errors.py +144 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/instance.py +86 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/mail.py +409 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/pdf.py +153 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/permissions.py +206 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/ports.py +1289 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/raw.py +51 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/sharing.py +156 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/tasks.py +72 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/taxonomy.py +176 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/taxonomy_edits.py +49 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/toolsets.py +6 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/trash.py +91 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/versions.py +142 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/views.py +209 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/domain/workflows.py +526 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/observability.py +176 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/__init__.py +1 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/admin.py +594 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/ai.py +139 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/auth.py +27 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/bulk.py +174 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/client.py +466 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/disposition.py +66 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/documents.py +702 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/errors.py +143 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/instance.py +144 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/mail.py +509 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/pagination.py +91 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/pdf.py +383 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/permissions.py +228 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/queued.py +156 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/raw.py +54 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/sharing.py +300 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/tasks.py +73 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/taxonomy.py +260 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/trash.py +122 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/views.py +131 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/paperless/workflows.py +153 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/server.py +488 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/__init__.py +1 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/admin_accounts.py +486 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/admin_system.py +354 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/ai.py +97 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/bulk_documents.py +620 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/bulk_taxonomy.py +237 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/custom_values.py +236 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/document_edits.py +427 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/documents.py +347 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/files.py +138 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/filter_rules.py +310 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/instance.py +42 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/mail.py +855 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/notes.py +81 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/page_ranges.py +87 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/pdf.py +598 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/permissions.py +613 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/principals.py +73 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/raw.py +287 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/removal.py +58 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/sharing.py +460 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/tag_hierarchy.py +57 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/task_outcome.py +77 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/tasks.py +78 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/taxonomy.py +150 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/taxonomy_edits.py +385 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/trash.py +263 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/upload_source.py +235 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/upload_types.py +138 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/uploads.py +198 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/version_uploads.py +121 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/versions.py +296 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/views.py +304 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/services/workflows.py +703 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/settings.py +430 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/__init__.py +1 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/_shared.py +959 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/admin.py +569 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/ai.py +67 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/bulk.py +120 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/core.py +792 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/mail.py +529 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/pdf.py +326 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/permissions.py +181 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/prompts.py +211 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/raw.py +49 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/selection.py +84 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/sharing.py +245 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/trash.py +115 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/upload.py +126 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/upload_stdio.py +107 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/versions.py +201 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/versions_stdio.py +86 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/views.py +206 -0
- mcp_server_paperless-0.2.0/src/mcp_server_paperless/tools/workflows.py +174 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gardenbaum
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-server-paperless
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: MCP server for paperless-ngx 3.x.
|
|
5
|
+
Author: gardenbaum
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: cryptography>=50.0.2
|
|
9
|
+
Requires-Dist: fastmcp>=4.2,<4.3
|
|
10
|
+
Requires-Dist: httpx2>=2.16.0
|
|
11
|
+
Requires-Dist: mcp>=2.3.0,<3
|
|
12
|
+
Requires-Dist: py-key-value-aio>=0.5.0
|
|
13
|
+
Requires-Dist: pydantic>=2.14.3
|
|
14
|
+
Requires-Dist: pydantic-settings>=2.16.2
|
|
15
|
+
Requires-Dist: uvicorn>=0.40
|
|
16
|
+
Requires-Python: >=3.14
|
|
17
|
+
Project-URL: Repository, https://github.com/gardenbaum/paperless-mcp
|
|
18
|
+
Project-URL: Documentation, https://github.com/gardenbaum/paperless-mcp/tree/main/docs
|
|
19
|
+
Project-URL: Issues, https://github.com/gardenbaum/paperless-mcp/issues
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
<div align="center">
|
|
23
|
+
|
|
24
|
+
# paperless-mcp
|
|
25
|
+
|
|
26
|
+
**Let Claude work with your [paperless-ngx](https://docs.paperless-ngx.com) archive:<br>
|
|
27
|
+
find, read, file, upload and organise documents by asking.**
|
|
28
|
+
|
|
29
|
+
[](https://github.com/gardenbaum/paperless-mcp/actions/workflows/ci.yml)
|
|
30
|
+
[](https://github.com/gardenbaum/paperless-mcp/actions/workflows/e2e-full.yml)
|
|
31
|
+
[](https://github.com/gardenbaum/paperless-mcp/pkgs/container/paperless-mcp)
|
|
32
|
+
[](https://github.com/paperless-ngx/paperless-ngx)
|
|
33
|
+
[](pyproject.toml)
|
|
34
|
+
[](https://github.com/gardenbaum/paperless-mcp/blob/main/LICENSE)
|
|
35
|
+
|
|
36
|
+
[Quick start](#quick-start) · [What you can ask](#what-you-can-ask) · [Toolsets](#toolsets) ·
|
|
37
|
+
[Safety](#how-it-keeps-your-archive-safe) · [Documentation](#documentation)
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
paperless-mcp is a [Model Context Protocol](https://modelcontextprotocol.io) server for
|
|
42
|
+
paperless-ngx 3.x, built on FastMCP 4. It gives Claude Code, Claude Desktop, claude.ai and any
|
|
43
|
+
other MCP client 87 tools in 13 toolsets that cover most of what the Paperless API can do, from a
|
|
44
|
+
search to mail rules and workflows. It starts small and careful: 18 tools by default, names instead
|
|
45
|
+
of ids, and a confirmation step before anything that cannot be undone.
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart LR
|
|
49
|
+
A["Claude Code<br>Claude Desktop"] -- stdio --> S
|
|
50
|
+
B["claude.ai<br>connector"] -- "HTTPS + OIDC" --> S
|
|
51
|
+
C["Other MCP<br>clients"] -- "HTTP + bearer token" --> S
|
|
52
|
+
S(["paperless-mcp"]) -- "REST API v10" --> P[("paperless-ngx 3.x")]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## What you can ask
|
|
56
|
+
|
|
57
|
+
- "What is in my inbox? Suggest a correspondent, type and tags for each document and file them
|
|
58
|
+
once I agree."
|
|
59
|
+
- "Find last year's electricity bills and add up what I paid."
|
|
60
|
+
- "Upload this PDF as an invoice from ACME and tag it tax-2026."
|
|
61
|
+
- "Which documents mention the rental deposit? Show me the paragraph."
|
|
62
|
+
- "Merge the three scans of the contract into one document and rotate page 2."
|
|
63
|
+
- "Give me a link to my insurance policy that expires in a week."
|
|
64
|
+
- "Set up a mail rule that files the invoices from billing@example.org."
|
|
65
|
+
- "Find duplicate and unused tags and propose how to clean them up."
|
|
66
|
+
|
|
67
|
+
An example of how that goes (illustrative):
|
|
68
|
+
|
|
69
|
+
> **You:** What is still in my inbox?
|
|
70
|
+
>
|
|
71
|
+
> **Claude:** Three documents. Here is how I would file them:
|
|
72
|
+
>
|
|
73
|
+
> | Document | Correspondent | Type | Tags |
|
|
74
|
+
> |---|---|---|---|
|
|
75
|
+
> | Electricity bill, March | City Power | Invoice | utilities, tax-2026 |
|
|
76
|
+
> | Policy update | Northwind Insurance | Letter | insurance |
|
|
77
|
+
> | Receipt, hardware store | *new:* Brick & Bolt | Receipt | household |
|
|
78
|
+
>
|
|
79
|
+
> "Brick & Bolt" does not exist yet as a correspondent; I would create it. Shall I apply this?
|
|
80
|
+
>
|
|
81
|
+
> **You:** Yes, and tag the policy update tax-2026 too.
|
|
82
|
+
|
|
83
|
+
Four built-in prompts start such tasks from the client's prompt menu: `triage_inbox`,
|
|
84
|
+
`find_document`, `annual_review` and `cleanup_taxonomy`. Each one proposes its changes and waits
|
|
85
|
+
for your yes before it writes.
|
|
86
|
+
|
|
87
|
+
## Why another paperless-ngx MCP server?
|
|
88
|
+
|
|
89
|
+
There are already several MCP servers for paperless-ngx. This one is a new build, made for
|
|
90
|
+
people who want all of the following in one server:
|
|
91
|
+
|
|
92
|
+
- 🗂️ **Much more than search.** Besides finding, reading and filing documents it handles notes,
|
|
93
|
+
custom fields, saved views, file versions, the trash, PDF operations, share links, mail rules,
|
|
94
|
+
workflows, permissions and user administration: most of what paperless-ngx 3.x can do.
|
|
95
|
+
- 🏷️ **Names instead of numbers.** You say "invoices from ACME tagged tax-2026" and the server
|
|
96
|
+
finds the matching ids itself. If a name does not exist or fits more than one entry, it says so
|
|
97
|
+
and lists the candidates instead of guessing.
|
|
98
|
+
- 🛡️ **Nothing final without your yes.** Before a tool deletes, overwrites, publishes or shares
|
|
99
|
+
anything, it reports what would happen and waits for your confirmation. Changes to many
|
|
100
|
+
documents at once can be previewed first.
|
|
101
|
+
- 🪶 **Small to start with.** Only 18 tools by default out of the 87, so the assistant starts
|
|
102
|
+
with the essentials and you decide what else it may do. Search results are short lists and long
|
|
103
|
+
documents are read piece by piece, so a conversation does not fill up with text it does not
|
|
104
|
+
need.
|
|
105
|
+
- 🧪 **Tested against a real Paperless.** More than 600 tests run against a real paperless-ngx
|
|
106
|
+
after every change and every night, on top of more than 4,500 faster tests. Every week the
|
|
107
|
+
whole suite also runs against the newest Paperless release.
|
|
108
|
+
- 🔐 **Safe to reach from outside.** Over the network the server does not start without
|
|
109
|
+
authentication. Claude Code signs in with a token, claude.ai through your own identity
|
|
110
|
+
provider, and the container image runs without root rights.
|
|
111
|
+
|
|
112
|
+
## Quick start
|
|
113
|
+
|
|
114
|
+
You need a Paperless API token: in Paperless open your profile menu, "My Profile", and create an
|
|
115
|
+
API auth token. The server acts as that user and sees and changes only what that user may.
|
|
116
|
+
|
|
117
|
+
### Claude Code
|
|
118
|
+
|
|
119
|
+
With [uv](https://docs.astral.sh/uv/) installed, one command, no clone:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
claude mcp add paperless \
|
|
123
|
+
--env PAPERLESS_URL=https://paperless.example.org \
|
|
124
|
+
--env PAPERLESS_TOKEN=your-api-token \
|
|
125
|
+
-- uvx mcp-server-paperless@latest
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Add `--scope user` to have it in every project. Then ask Claude for an overview of your Paperless
|
|
129
|
+
instance. `@latest` makes uvx check for a new release at every start; to stay on one, name its
|
|
130
|
+
version instead (`mcp-server-paperless@0.2.0`).
|
|
131
|
+
|
|
132
|
+
> [!WARNING]
|
|
133
|
+
> The package is **`mcp-server-paperless`**. The PyPI project
|
|
134
|
+
> [`paperless-mcp`](https://pypi.org/project/paperless-mcp/) is a different server by someone
|
|
135
|
+
> else; `uvx paperless-mcp` would run it with your Paperless token.
|
|
136
|
+
|
|
137
|
+
### Claude Desktop
|
|
138
|
+
|
|
139
|
+
Add the server to `claude_desktop_config.json` (Settings, Developer, Edit Config) and restart:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"mcpServers": {
|
|
144
|
+
"paperless": {
|
|
145
|
+
"command": "uvx",
|
|
146
|
+
"args": ["mcp-server-paperless@latest"],
|
|
147
|
+
"env": {
|
|
148
|
+
"PAPERLESS_URL": "https://paperless.example.org",
|
|
149
|
+
"PAPERLESS_TOKEN": "your-api-token"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
If Claude Desktop cannot find `uvx`, give its full path (`which uvx`). Other MCP clients that
|
|
157
|
+
start a stdio server take the same command, arguments and environment.
|
|
158
|
+
|
|
159
|
+
### Container, for remote clients
|
|
160
|
+
|
|
161
|
+
The image serves MCP over Streamable HTTP and does not start without authentication:
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
export MCP_TOKEN="$(openssl rand -hex 32)"
|
|
165
|
+
docker run -d --name paperless-mcp -p 127.0.0.1:8001:8000 \
|
|
166
|
+
-e PAPERLESS_URL=https://paperless.example.org \
|
|
167
|
+
-e PAPERLESS_TOKEN=your-api-token \
|
|
168
|
+
-e PAPERLESS_MCP_HTTP_AUTH_TOKENS="$MCP_TOKEN" \
|
|
169
|
+
-e PAPERLESS_MCP_HTTP_ALLOWED_HOSTS=localhost \
|
|
170
|
+
ghcr.io/gardenbaum/paperless-mcp:0.1.0
|
|
171
|
+
|
|
172
|
+
claude mcp add --transport http paperless http://127.0.0.1:8001/mcp \
|
|
173
|
+
--header "Authorization: Bearer $MCP_TOKEN"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
[Run in a container](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/container.md) has the compose file next to Paperless and the reverse
|
|
177
|
+
proxy setup, [Run over HTTP](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/http.md) the details of the transport.
|
|
178
|
+
|
|
179
|
+
### claude.ai
|
|
180
|
+
|
|
181
|
+
claude.ai custom connectors sign in with OAuth. Put the HTTP server behind your identity provider
|
|
182
|
+
(Authentik, Keycloak, Google, Auth0 or any other OpenID Connect provider) with five environment
|
|
183
|
+
variables: [Connect claude.ai](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/claude-ai-connector.md).
|
|
184
|
+
|
|
185
|
+
## Toolsets
|
|
186
|
+
|
|
187
|
+
The 87 tools are grouped into toolsets, and only two are on by default, so the model is not
|
|
188
|
+
handed tools you never use. Switch more on with `PAPERLESS_MCP_TOOLSETS=core,ai,pdf,trash` or
|
|
189
|
+
`all`.
|
|
190
|
+
|
|
191
|
+
| Toolset | Tools | Default | What it is for |
|
|
192
|
+
|---|---|---|---|
|
|
193
|
+
| `core` | 16 | on | Search, read, download, file and upload documents; notes; tags, correspondents, types, storage paths and custom fields; background tasks |
|
|
194
|
+
| `ai` | 2 | on | Ask Paperless AI about your documents and get its filing suggestions (offered only while Paperless AI is enabled) |
|
|
195
|
+
| `bulk` | 2 | | Change many documents or taxonomy items in one step, with a dry run first |
|
|
196
|
+
| `pdf` | 7 | | Rotate, merge, split, delete pages, edit PDFs, remove passwords, reprocess |
|
|
197
|
+
| `versions` | 5 | | The file versions of a document: list, upload, label, delete, merge documents as versions |
|
|
198
|
+
| `trash` | 3 | | List the trash, restore from it, empty it |
|
|
199
|
+
| `views` | 6 | | Saved views: create, change, delete and run them |
|
|
200
|
+
| `sharing` | 8 | | Public share links and bundles, and sending documents by e-mail |
|
|
201
|
+
| `permissions` | 3 | | Owners and view and change rights of documents and taxonomy; list users and groups |
|
|
202
|
+
| `mail` | 13 | | Mail accounts and rules for the mail import, and what it processed |
|
|
203
|
+
| `workflows` | 5 | | The workflows Paperless runs by itself: triggers and actions |
|
|
204
|
+
| `admin` | 16 | | Users, groups, application configuration, logs, tasks, bulk download |
|
|
205
|
+
| `raw` | 1 | | A read-only escape hatch: GET any path of the Paperless API the other tools do not cover |
|
|
206
|
+
|
|
207
|
+
Every tool with its kind and a one-line description is in the [tool
|
|
208
|
+
reference](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/tools.md); what to know before switching a toolset on is in
|
|
209
|
+
[Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md#toolsets).
|
|
210
|
+
|
|
211
|
+
## How it keeps your archive safe
|
|
212
|
+
|
|
213
|
+
An assistant that can file your documents can also delete them. The server is built so that this
|
|
214
|
+
takes more than a misunderstanding:
|
|
215
|
+
|
|
216
|
+
- **Confirmation before anything final.** Tools that delete, overwrite, publish or grant access
|
|
217
|
+
change nothing when called without `confirm=true`. They answer with what would happen (which
|
|
218
|
+
documents, who gains access, what cannot be undone), so the client shows it to you first.
|
|
219
|
+
- **Dry runs for bulk edits.** `bulk_edit_documents` and `bulk_edit_taxonomy` preview how many
|
|
220
|
+
objects would change before they ask for confirmation.
|
|
221
|
+
- **The trash first.** Deleting a document moves it to the Paperless trash, from where it can be
|
|
222
|
+
restored. Emptying the trash is a separate tool in a toolset that is off by default.
|
|
223
|
+
- **You choose the surface.** Toolsets are opt-in, `PAPERLESS_MCP_READ_ONLY=true` offers only
|
|
224
|
+
tools that change nothing, and `PAPERLESS_MCP_DISABLED_TOOLS` takes single tools away.
|
|
225
|
+
- **Paperless stays in charge.** The server acts as the user of its API token: the permissions
|
|
226
|
+
set in Paperless apply to every call.
|
|
227
|
+
- **Secrets stay secret.** Passwords and API keys are write-only, and tokens, document text and
|
|
228
|
+
search queries are not logged at the default log level.
|
|
229
|
+
- **No reach beyond Paperless.** Callers cannot make the server read local files or reach other
|
|
230
|
+
hosts. Uploading by file path exists only over stdio and only from directories you name.
|
|
231
|
+
|
|
232
|
+
## Configuration
|
|
233
|
+
|
|
234
|
+
The settings you are most likely to touch; [Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md) has all of
|
|
235
|
+
them.
|
|
236
|
+
|
|
237
|
+
| Variable | Meaning |
|
|
238
|
+
|---|---|
|
|
239
|
+
| `PAPERLESS_URL` | Base URL of your Paperless instance (required) |
|
|
240
|
+
| `PAPERLESS_TOKEN` | Paperless API token (required) |
|
|
241
|
+
| `PAPERLESS_PUBLIC_URL` | Base URL for links shown to you, if it differs from `PAPERLESS_URL` |
|
|
242
|
+
| `PAPERLESS_MCP_TOOLSETS` | Toolsets to offer, comma-separated, or `all` (default `core,ai`) |
|
|
243
|
+
| `PAPERLESS_MCP_READ_ONLY` | `true` to offer only tools that change nothing |
|
|
244
|
+
| `PAPERLESS_MCP_DISABLED_TOOLS` | Tools never offered, by name |
|
|
245
|
+
| `PAPERLESS_MCP_UPLOAD_DIRS` | Directories the model may upload files from by path (stdio only; default: none) |
|
|
246
|
+
|
|
247
|
+
## Compatibility
|
|
248
|
+
|
|
249
|
+
| | |
|
|
250
|
+
|---|---|
|
|
251
|
+
| **paperless-ngx** | 3.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 |
|
|
252
|
+
| **Clients** | Claude Code and Claude Desktop over stdio, claude.ai custom connectors and other MCP clients over Streamable HTTP |
|
|
253
|
+
| **Runtime** | Python 3.14 or later (`uvx` fetches it for you), or the container image |
|
|
254
|
+
|
|
255
|
+
## Documentation
|
|
256
|
+
|
|
257
|
+
- [Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md): every variable, the toolsets, read-only mode, uploads
|
|
258
|
+
- [Tool reference](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/tools.md): all tools and prompts
|
|
259
|
+
- [Run over HTTP](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/http.md): bearer tokens, allowed hosts, what the transport refuses
|
|
260
|
+
- [Connect claude.ai](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/claude-ai-connector.md): sign-in through your identity provider
|
|
261
|
+
- [Run in a container](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/container.md): the image, compose files, reverse proxy
|
|
262
|
+
- [Development](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/development.md): architecture, how it is tested, how to contribute
|
|
263
|
+
|
|
264
|
+
## Known limitations
|
|
265
|
+
|
|
266
|
+
- **One Paperless user per server.** Every client of a server acts as the user of its
|
|
267
|
+
`PAPERLESS_TOKEN`, also when clients sign in through an identity provider. Run one server per
|
|
268
|
+
Paperless account.
|
|
269
|
+
- **`search_documents` with `more_like_id` can return nothing on Paperless 3.4.2.** Paperless
|
|
270
|
+
3.4.2 (Tantivy 0.26) panics while scoring a more-like-this query once edited or deleted
|
|
271
|
+
documents have left stale entries in the search index. Paperless catches the panic, logs
|
|
272
|
+
`More Like This scoring panicked` and answers an empty list with HTTP 200, so the server cannot
|
|
273
|
+
tell it from "no similar documents". If a result is empty although similar documents should
|
|
274
|
+
exist, have an administrator run `document_index reindex` in the Paperless container (for
|
|
275
|
+
example `docker compose exec webserver document_index reindex`). The fix is upstream in Tantivy
|
|
276
|
+
(tantivy PR 2964); it needs a Paperless release that ships it.
|
|
277
|
+
|
|
278
|
+
## How this project is built
|
|
279
|
+
|
|
280
|
+
The code is written by AI agents and held to rules that are checked, not remembered: a layered
|
|
281
|
+
architecture enforced by import contracts, every design decision recorded with the test that
|
|
282
|
+
guards it (`backlog/decisions/`), a contract suite that runs the same tests against a fake and a
|
|
283
|
+
real Paperless, and mutation testing with a gate. Plans and task history are in `backlog/`. See
|
|
284
|
+
[Development](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/development.md) to run the checks yourself; issues and pull requests are
|
|
285
|
+
welcome.
|
|
286
|
+
|
|
287
|
+
## Credits
|
|
288
|
+
|
|
289
|
+
This is a new build, not a fork, but it learned from three existing paperless-ngx MCP servers and
|
|
290
|
+
adopts some of their ideas deliberately:
|
|
291
|
+
|
|
292
|
+
- [pvliesdonk/paperless-mcp](https://github.com/pvliesdonk/paperless-mcp) (MIT): field
|
|
293
|
+
projection in lists, content slicing with a next offset, retries only for idempotent calls,
|
|
294
|
+
token redaction, errors that name the next call, a central tool-annotation table, `web_url`,
|
|
295
|
+
and the OIDC proxy beside bearer tokens.
|
|
296
|
+
- [baruchiro/paperless-mcp](https://github.com/baruchiro/paperless-mcp) (ISC): names instead of
|
|
297
|
+
IDs in output, `confirm: true` for destructive calls, an upload allowlist, live end-to-end tests
|
|
298
|
+
against a real Paperless, a test over every advertised tool schema.
|
|
299
|
+
- [OrellBuehler/paperless-mcp](https://github.com/OrellBuehler/paperless-mcp) (MIT): toolsets,
|
|
300
|
+
a read-only mode and a test that every tool belongs to a toolset, coverage of Paperless 3.x
|
|
301
|
+
features (versions, AI suggestions, trash, PDF operations), prompts that ask for confirmation,
|
|
302
|
+
a test that every tool named in a prompt exists.
|
|
303
|
+
|
|
304
|
+
Thanks to the [paperless-ngx](https://github.com/paperless-ngx/paperless-ngx) and
|
|
305
|
+
[FastMCP](https://github.com/PrefectHQ/fastmcp) projects, which this server stands on.
|
|
306
|
+
|
|
307
|
+
## Licence
|
|
308
|
+
|
|
309
|
+
MIT, see [LICENSE](https://github.com/gardenbaum/paperless-mcp/blob/main/LICENSE).
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
<div align="center">
|
|
314
|
+
|
|
315
|
+
If paperless-mcp saves you time, a ⭐ helps other Paperless users find it.
|
|
316
|
+
|
|
317
|
+
</div>
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# paperless-mcp
|
|
4
|
+
|
|
5
|
+
**Let Claude work with your [paperless-ngx](https://docs.paperless-ngx.com) archive:<br>
|
|
6
|
+
find, read, file, upload and organise documents by asking.**
|
|
7
|
+
|
|
8
|
+
[](https://github.com/gardenbaum/paperless-mcp/actions/workflows/ci.yml)
|
|
9
|
+
[](https://github.com/gardenbaum/paperless-mcp/actions/workflows/e2e-full.yml)
|
|
10
|
+
[](https://github.com/gardenbaum/paperless-mcp/pkgs/container/paperless-mcp)
|
|
11
|
+
[](https://github.com/paperless-ngx/paperless-ngx)
|
|
12
|
+
[](pyproject.toml)
|
|
13
|
+
[](https://github.com/gardenbaum/paperless-mcp/blob/main/LICENSE)
|
|
14
|
+
|
|
15
|
+
[Quick start](#quick-start) · [What you can ask](#what-you-can-ask) · [Toolsets](#toolsets) ·
|
|
16
|
+
[Safety](#how-it-keeps-your-archive-safe) · [Documentation](#documentation)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
paperless-mcp is a [Model Context Protocol](https://modelcontextprotocol.io) server for
|
|
21
|
+
paperless-ngx 3.x, built on FastMCP 4. It gives Claude Code, Claude Desktop, claude.ai and any
|
|
22
|
+
other MCP client 87 tools in 13 toolsets that cover most of what the Paperless API can do, from a
|
|
23
|
+
search to mail rules and workflows. It starts small and careful: 18 tools by default, names instead
|
|
24
|
+
of ids, and a confirmation step before anything that cannot be undone.
|
|
25
|
+
|
|
26
|
+
```mermaid
|
|
27
|
+
flowchart LR
|
|
28
|
+
A["Claude Code<br>Claude Desktop"] -- stdio --> S
|
|
29
|
+
B["claude.ai<br>connector"] -- "HTTPS + OIDC" --> S
|
|
30
|
+
C["Other MCP<br>clients"] -- "HTTP + bearer token" --> S
|
|
31
|
+
S(["paperless-mcp"]) -- "REST API v10" --> P[("paperless-ngx 3.x")]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What you can ask
|
|
35
|
+
|
|
36
|
+
- "What is in my inbox? Suggest a correspondent, type and tags for each document and file them
|
|
37
|
+
once I agree."
|
|
38
|
+
- "Find last year's electricity bills and add up what I paid."
|
|
39
|
+
- "Upload this PDF as an invoice from ACME and tag it tax-2026."
|
|
40
|
+
- "Which documents mention the rental deposit? Show me the paragraph."
|
|
41
|
+
- "Merge the three scans of the contract into one document and rotate page 2."
|
|
42
|
+
- "Give me a link to my insurance policy that expires in a week."
|
|
43
|
+
- "Set up a mail rule that files the invoices from billing@example.org."
|
|
44
|
+
- "Find duplicate and unused tags and propose how to clean them up."
|
|
45
|
+
|
|
46
|
+
An example of how that goes (illustrative):
|
|
47
|
+
|
|
48
|
+
> **You:** What is still in my inbox?
|
|
49
|
+
>
|
|
50
|
+
> **Claude:** Three documents. Here is how I would file them:
|
|
51
|
+
>
|
|
52
|
+
> | Document | Correspondent | Type | Tags |
|
|
53
|
+
> |---|---|---|---|
|
|
54
|
+
> | Electricity bill, March | City Power | Invoice | utilities, tax-2026 |
|
|
55
|
+
> | Policy update | Northwind Insurance | Letter | insurance |
|
|
56
|
+
> | Receipt, hardware store | *new:* Brick & Bolt | Receipt | household |
|
|
57
|
+
>
|
|
58
|
+
> "Brick & Bolt" does not exist yet as a correspondent; I would create it. Shall I apply this?
|
|
59
|
+
>
|
|
60
|
+
> **You:** Yes, and tag the policy update tax-2026 too.
|
|
61
|
+
|
|
62
|
+
Four built-in prompts start such tasks from the client's prompt menu: `triage_inbox`,
|
|
63
|
+
`find_document`, `annual_review` and `cleanup_taxonomy`. Each one proposes its changes and waits
|
|
64
|
+
for your yes before it writes.
|
|
65
|
+
|
|
66
|
+
## Why another paperless-ngx MCP server?
|
|
67
|
+
|
|
68
|
+
There are already several MCP servers for paperless-ngx. This one is a new build, made for
|
|
69
|
+
people who want all of the following in one server:
|
|
70
|
+
|
|
71
|
+
- 🗂️ **Much more than search.** Besides finding, reading and filing documents it handles notes,
|
|
72
|
+
custom fields, saved views, file versions, the trash, PDF operations, share links, mail rules,
|
|
73
|
+
workflows, permissions and user administration: most of what paperless-ngx 3.x can do.
|
|
74
|
+
- 🏷️ **Names instead of numbers.** You say "invoices from ACME tagged tax-2026" and the server
|
|
75
|
+
finds the matching ids itself. If a name does not exist or fits more than one entry, it says so
|
|
76
|
+
and lists the candidates instead of guessing.
|
|
77
|
+
- 🛡️ **Nothing final without your yes.** Before a tool deletes, overwrites, publishes or shares
|
|
78
|
+
anything, it reports what would happen and waits for your confirmation. Changes to many
|
|
79
|
+
documents at once can be previewed first.
|
|
80
|
+
- 🪶 **Small to start with.** Only 18 tools by default out of the 87, so the assistant starts
|
|
81
|
+
with the essentials and you decide what else it may do. Search results are short lists and long
|
|
82
|
+
documents are read piece by piece, so a conversation does not fill up with text it does not
|
|
83
|
+
need.
|
|
84
|
+
- 🧪 **Tested against a real Paperless.** More than 600 tests run against a real paperless-ngx
|
|
85
|
+
after every change and every night, on top of more than 4,500 faster tests. Every week the
|
|
86
|
+
whole suite also runs against the newest Paperless release.
|
|
87
|
+
- 🔐 **Safe to reach from outside.** Over the network the server does not start without
|
|
88
|
+
authentication. Claude Code signs in with a token, claude.ai through your own identity
|
|
89
|
+
provider, and the container image runs without root rights.
|
|
90
|
+
|
|
91
|
+
## Quick start
|
|
92
|
+
|
|
93
|
+
You need a Paperless API token: in Paperless open your profile menu, "My Profile", and create an
|
|
94
|
+
API auth token. The server acts as that user and sees and changes only what that user may.
|
|
95
|
+
|
|
96
|
+
### Claude Code
|
|
97
|
+
|
|
98
|
+
With [uv](https://docs.astral.sh/uv/) installed, one command, no clone:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
claude mcp add paperless \
|
|
102
|
+
--env PAPERLESS_URL=https://paperless.example.org \
|
|
103
|
+
--env PAPERLESS_TOKEN=your-api-token \
|
|
104
|
+
-- uvx mcp-server-paperless@latest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Add `--scope user` to have it in every project. Then ask Claude for an overview of your Paperless
|
|
108
|
+
instance. `@latest` makes uvx check for a new release at every start; to stay on one, name its
|
|
109
|
+
version instead (`mcp-server-paperless@0.2.0`).
|
|
110
|
+
|
|
111
|
+
> [!WARNING]
|
|
112
|
+
> The package is **`mcp-server-paperless`**. The PyPI project
|
|
113
|
+
> [`paperless-mcp`](https://pypi.org/project/paperless-mcp/) is a different server by someone
|
|
114
|
+
> else; `uvx paperless-mcp` would run it with your Paperless token.
|
|
115
|
+
|
|
116
|
+
### Claude Desktop
|
|
117
|
+
|
|
118
|
+
Add the server to `claude_desktop_config.json` (Settings, Developer, Edit Config) and restart:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"mcpServers": {
|
|
123
|
+
"paperless": {
|
|
124
|
+
"command": "uvx",
|
|
125
|
+
"args": ["mcp-server-paperless@latest"],
|
|
126
|
+
"env": {
|
|
127
|
+
"PAPERLESS_URL": "https://paperless.example.org",
|
|
128
|
+
"PAPERLESS_TOKEN": "your-api-token"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If Claude Desktop cannot find `uvx`, give its full path (`which uvx`). Other MCP clients that
|
|
136
|
+
start a stdio server take the same command, arguments and environment.
|
|
137
|
+
|
|
138
|
+
### Container, for remote clients
|
|
139
|
+
|
|
140
|
+
The image serves MCP over Streamable HTTP and does not start without authentication:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
export MCP_TOKEN="$(openssl rand -hex 32)"
|
|
144
|
+
docker run -d --name paperless-mcp -p 127.0.0.1:8001:8000 \
|
|
145
|
+
-e PAPERLESS_URL=https://paperless.example.org \
|
|
146
|
+
-e PAPERLESS_TOKEN=your-api-token \
|
|
147
|
+
-e PAPERLESS_MCP_HTTP_AUTH_TOKENS="$MCP_TOKEN" \
|
|
148
|
+
-e PAPERLESS_MCP_HTTP_ALLOWED_HOSTS=localhost \
|
|
149
|
+
ghcr.io/gardenbaum/paperless-mcp:0.1.0
|
|
150
|
+
|
|
151
|
+
claude mcp add --transport http paperless http://127.0.0.1:8001/mcp \
|
|
152
|
+
--header "Authorization: Bearer $MCP_TOKEN"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
[Run in a container](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/container.md) has the compose file next to Paperless and the reverse
|
|
156
|
+
proxy setup, [Run over HTTP](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/http.md) the details of the transport.
|
|
157
|
+
|
|
158
|
+
### claude.ai
|
|
159
|
+
|
|
160
|
+
claude.ai custom connectors sign in with OAuth. Put the HTTP server behind your identity provider
|
|
161
|
+
(Authentik, Keycloak, Google, Auth0 or any other OpenID Connect provider) with five environment
|
|
162
|
+
variables: [Connect claude.ai](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/claude-ai-connector.md).
|
|
163
|
+
|
|
164
|
+
## Toolsets
|
|
165
|
+
|
|
166
|
+
The 87 tools are grouped into toolsets, and only two are on by default, so the model is not
|
|
167
|
+
handed tools you never use. Switch more on with `PAPERLESS_MCP_TOOLSETS=core,ai,pdf,trash` or
|
|
168
|
+
`all`.
|
|
169
|
+
|
|
170
|
+
| Toolset | Tools | Default | What it is for |
|
|
171
|
+
|---|---|---|---|
|
|
172
|
+
| `core` | 16 | on | Search, read, download, file and upload documents; notes; tags, correspondents, types, storage paths and custom fields; background tasks |
|
|
173
|
+
| `ai` | 2 | on | Ask Paperless AI about your documents and get its filing suggestions (offered only while Paperless AI is enabled) |
|
|
174
|
+
| `bulk` | 2 | | Change many documents or taxonomy items in one step, with a dry run first |
|
|
175
|
+
| `pdf` | 7 | | Rotate, merge, split, delete pages, edit PDFs, remove passwords, reprocess |
|
|
176
|
+
| `versions` | 5 | | The file versions of a document: list, upload, label, delete, merge documents as versions |
|
|
177
|
+
| `trash` | 3 | | List the trash, restore from it, empty it |
|
|
178
|
+
| `views` | 6 | | Saved views: create, change, delete and run them |
|
|
179
|
+
| `sharing` | 8 | | Public share links and bundles, and sending documents by e-mail |
|
|
180
|
+
| `permissions` | 3 | | Owners and view and change rights of documents and taxonomy; list users and groups |
|
|
181
|
+
| `mail` | 13 | | Mail accounts and rules for the mail import, and what it processed |
|
|
182
|
+
| `workflows` | 5 | | The workflows Paperless runs by itself: triggers and actions |
|
|
183
|
+
| `admin` | 16 | | Users, groups, application configuration, logs, tasks, bulk download |
|
|
184
|
+
| `raw` | 1 | | A read-only escape hatch: GET any path of the Paperless API the other tools do not cover |
|
|
185
|
+
|
|
186
|
+
Every tool with its kind and a one-line description is in the [tool
|
|
187
|
+
reference](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/tools.md); what to know before switching a toolset on is in
|
|
188
|
+
[Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md#toolsets).
|
|
189
|
+
|
|
190
|
+
## How it keeps your archive safe
|
|
191
|
+
|
|
192
|
+
An assistant that can file your documents can also delete them. The server is built so that this
|
|
193
|
+
takes more than a misunderstanding:
|
|
194
|
+
|
|
195
|
+
- **Confirmation before anything final.** Tools that delete, overwrite, publish or grant access
|
|
196
|
+
change nothing when called without `confirm=true`. They answer with what would happen (which
|
|
197
|
+
documents, who gains access, what cannot be undone), so the client shows it to you first.
|
|
198
|
+
- **Dry runs for bulk edits.** `bulk_edit_documents` and `bulk_edit_taxonomy` preview how many
|
|
199
|
+
objects would change before they ask for confirmation.
|
|
200
|
+
- **The trash first.** Deleting a document moves it to the Paperless trash, from where it can be
|
|
201
|
+
restored. Emptying the trash is a separate tool in a toolset that is off by default.
|
|
202
|
+
- **You choose the surface.** Toolsets are opt-in, `PAPERLESS_MCP_READ_ONLY=true` offers only
|
|
203
|
+
tools that change nothing, and `PAPERLESS_MCP_DISABLED_TOOLS` takes single tools away.
|
|
204
|
+
- **Paperless stays in charge.** The server acts as the user of its API token: the permissions
|
|
205
|
+
set in Paperless apply to every call.
|
|
206
|
+
- **Secrets stay secret.** Passwords and API keys are write-only, and tokens, document text and
|
|
207
|
+
search queries are not logged at the default log level.
|
|
208
|
+
- **No reach beyond Paperless.** Callers cannot make the server read local files or reach other
|
|
209
|
+
hosts. Uploading by file path exists only over stdio and only from directories you name.
|
|
210
|
+
|
|
211
|
+
## Configuration
|
|
212
|
+
|
|
213
|
+
The settings you are most likely to touch; [Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md) has all of
|
|
214
|
+
them.
|
|
215
|
+
|
|
216
|
+
| Variable | Meaning |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `PAPERLESS_URL` | Base URL of your Paperless instance (required) |
|
|
219
|
+
| `PAPERLESS_TOKEN` | Paperless API token (required) |
|
|
220
|
+
| `PAPERLESS_PUBLIC_URL` | Base URL for links shown to you, if it differs from `PAPERLESS_URL` |
|
|
221
|
+
| `PAPERLESS_MCP_TOOLSETS` | Toolsets to offer, comma-separated, or `all` (default `core,ai`) |
|
|
222
|
+
| `PAPERLESS_MCP_READ_ONLY` | `true` to offer only tools that change nothing |
|
|
223
|
+
| `PAPERLESS_MCP_DISABLED_TOOLS` | Tools never offered, by name |
|
|
224
|
+
| `PAPERLESS_MCP_UPLOAD_DIRS` | Directories the model may upload files from by path (stdio only; default: none) |
|
|
225
|
+
|
|
226
|
+
## Compatibility
|
|
227
|
+
|
|
228
|
+
| | |
|
|
229
|
+
|---|---|
|
|
230
|
+
| **paperless-ngx** | 3.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 |
|
|
231
|
+
| **Clients** | Claude Code and Claude Desktop over stdio, claude.ai custom connectors and other MCP clients over Streamable HTTP |
|
|
232
|
+
| **Runtime** | Python 3.14 or later (`uvx` fetches it for you), or the container image |
|
|
233
|
+
|
|
234
|
+
## Documentation
|
|
235
|
+
|
|
236
|
+
- [Configuration](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/configuration.md): every variable, the toolsets, read-only mode, uploads
|
|
237
|
+
- [Tool reference](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/tools.md): all tools and prompts
|
|
238
|
+
- [Run over HTTP](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/http.md): bearer tokens, allowed hosts, what the transport refuses
|
|
239
|
+
- [Connect claude.ai](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/claude-ai-connector.md): sign-in through your identity provider
|
|
240
|
+
- [Run in a container](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/container.md): the image, compose files, reverse proxy
|
|
241
|
+
- [Development](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/development.md): architecture, how it is tested, how to contribute
|
|
242
|
+
|
|
243
|
+
## Known limitations
|
|
244
|
+
|
|
245
|
+
- **One Paperless user per server.** Every client of a server acts as the user of its
|
|
246
|
+
`PAPERLESS_TOKEN`, also when clients sign in through an identity provider. Run one server per
|
|
247
|
+
Paperless account.
|
|
248
|
+
- **`search_documents` with `more_like_id` can return nothing on Paperless 3.4.2.** Paperless
|
|
249
|
+
3.4.2 (Tantivy 0.26) panics while scoring a more-like-this query once edited or deleted
|
|
250
|
+
documents have left stale entries in the search index. Paperless catches the panic, logs
|
|
251
|
+
`More Like This scoring panicked` and answers an empty list with HTTP 200, so the server cannot
|
|
252
|
+
tell it from "no similar documents". If a result is empty although similar documents should
|
|
253
|
+
exist, have an administrator run `document_index reindex` in the Paperless container (for
|
|
254
|
+
example `docker compose exec webserver document_index reindex`). The fix is upstream in Tantivy
|
|
255
|
+
(tantivy PR 2964); it needs a Paperless release that ships it.
|
|
256
|
+
|
|
257
|
+
## How this project is built
|
|
258
|
+
|
|
259
|
+
The code is written by AI agents and held to rules that are checked, not remembered: a layered
|
|
260
|
+
architecture enforced by import contracts, every design decision recorded with the test that
|
|
261
|
+
guards it (`backlog/decisions/`), a contract suite that runs the same tests against a fake and a
|
|
262
|
+
real Paperless, and mutation testing with a gate. Plans and task history are in `backlog/`. See
|
|
263
|
+
[Development](https://github.com/gardenbaum/paperless-mcp/blob/main/docs/development.md) to run the checks yourself; issues and pull requests are
|
|
264
|
+
welcome.
|
|
265
|
+
|
|
266
|
+
## Credits
|
|
267
|
+
|
|
268
|
+
This is a new build, not a fork, but it learned from three existing paperless-ngx MCP servers and
|
|
269
|
+
adopts some of their ideas deliberately:
|
|
270
|
+
|
|
271
|
+
- [pvliesdonk/paperless-mcp](https://github.com/pvliesdonk/paperless-mcp) (MIT): field
|
|
272
|
+
projection in lists, content slicing with a next offset, retries only for idempotent calls,
|
|
273
|
+
token redaction, errors that name the next call, a central tool-annotation table, `web_url`,
|
|
274
|
+
and the OIDC proxy beside bearer tokens.
|
|
275
|
+
- [baruchiro/paperless-mcp](https://github.com/baruchiro/paperless-mcp) (ISC): names instead of
|
|
276
|
+
IDs in output, `confirm: true` for destructive calls, an upload allowlist, live end-to-end tests
|
|
277
|
+
against a real Paperless, a test over every advertised tool schema.
|
|
278
|
+
- [OrellBuehler/paperless-mcp](https://github.com/OrellBuehler/paperless-mcp) (MIT): toolsets,
|
|
279
|
+
a read-only mode and a test that every tool belongs to a toolset, coverage of Paperless 3.x
|
|
280
|
+
features (versions, AI suggestions, trash, PDF operations), prompts that ask for confirmation,
|
|
281
|
+
a test that every tool named in a prompt exists.
|
|
282
|
+
|
|
283
|
+
Thanks to the [paperless-ngx](https://github.com/paperless-ngx/paperless-ngx) and
|
|
284
|
+
[FastMCP](https://github.com/PrefectHQ/fastmcp) projects, which this server stands on.
|
|
285
|
+
|
|
286
|
+
## Licence
|
|
287
|
+
|
|
288
|
+
MIT, see [LICENSE](https://github.com/gardenbaum/paperless-mcp/blob/main/LICENSE).
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
<div align="center">
|
|
293
|
+
|
|
294
|
+
If paperless-mcp saves you time, a ⭐ helps other Paperless users find it.
|
|
295
|
+
|
|
296
|
+
</div>
|