@baruchiro/paperless-mcp 0.3.0 → 0.4.0
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.
- package/README.md +64 -10
- package/build/api/PaperlessAPI.d.ts +3 -1
- package/build/api/PaperlessAPI.js +11 -0
- package/build/tools/documents.js +19 -0
- package/package.json +1 -1
- package/paperless-mcp.dxt +0 -0
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# Paperless-NGX MCP Server
|
|
4
4
|
|
|
5
|
-
[](https://smithery.ai/server/@baruchiro/paperless-mcp)
|
|
6
5
|

|
|
7
6
|
|
|
8
7
|
An MCP (Model Context Protocol) server for interacting with a Paperless-NGX API server. This server provides tools for managing documents, tags, correspondents, and document types in your Paperless-NGX instance.
|
|
@@ -11,15 +10,7 @@ An MCP (Model Context Protocol) server for interacting with a Paperless-NGX API
|
|
|
11
10
|
|
|
12
11
|
[](https://cursor.com/install-mcp?name=paperless&config=eyJjb21tYW5kIjoibnB4IC15IEBiYXJ1Y2hpcm8vcGFwZXJsZXNzLW1jcEBsYXRlc3QiLCJlbnYiOnsiUEFQRVJMRVNTX1VSTCI6Imh0dHA6Ly95b3VyLXBhcGVybGVzcy1pbnN0YW5jZTo4MDAwIiwiUEFQRVJMRVNTX0FQSV9LRVkiOiJ5b3VyLWFwaS10b2tlbiJ9fQ%3D%3D)
|
|
13
12
|
|
|
14
|
-
###
|
|
15
|
-
|
|
16
|
-
To install Paperless NGX MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@baruchiro/paperless-mcp):
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx -y @smithery/cli install @baruchiro/paperless-mcp --client claude
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Manual Installation
|
|
13
|
+
### Installation
|
|
23
14
|
|
|
24
15
|
Add these to your MCP config file:
|
|
25
16
|
|
|
@@ -137,6 +128,18 @@ download_document({
|
|
|
137
128
|
})
|
|
138
129
|
```
|
|
139
130
|
|
|
131
|
+
#### get_document_thumbnail
|
|
132
|
+
Get a document thumbnail (image preview) by ID. Returns the thumbnail as a base64-encoded WebP image resource.
|
|
133
|
+
|
|
134
|
+
Parameters:
|
|
135
|
+
- id: Document ID
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
get_document_thumbnail({
|
|
139
|
+
id: 123
|
|
140
|
+
})
|
|
141
|
+
```
|
|
142
|
+
|
|
140
143
|
#### bulk_edit_documents
|
|
141
144
|
Perform bulk operations on multiple documents.
|
|
142
145
|
|
|
@@ -480,6 +483,57 @@ npm run start -- <baseUrl> <token> --http --port 3000
|
|
|
480
483
|
- Each request is handled statelessly, following the [StreamableHTTPServerTransport](https://github.com/modelcontextprotocol/typescript-sdk) pattern.
|
|
481
484
|
- GET and DELETE requests to `/mcp` will return 405 Method Not Allowed.
|
|
482
485
|
|
|
486
|
+
<details>
|
|
487
|
+
<summary>Docker Deployment</summary>
|
|
488
|
+
|
|
489
|
+
The MCP server can be deployed using Docker and Docker Compose. The Docker image automatically runs in HTTP mode with SSE (Server-Sent Events) support on port 3000.
|
|
490
|
+
|
|
491
|
+
### Docker Compose Configuration
|
|
492
|
+
|
|
493
|
+
Create a `docker-compose.yml` file:
|
|
494
|
+
|
|
495
|
+
```yaml
|
|
496
|
+
services:
|
|
497
|
+
paperless-mcp:
|
|
498
|
+
container_name: paperless-mcp
|
|
499
|
+
image: ghcr.io/baruchiro/paperless-mcp:latest
|
|
500
|
+
environment:
|
|
501
|
+
- PAPERLESS_URL=http://your-paperless-ngx-server:8000
|
|
502
|
+
- PAPERLESS_API_KEY=your-paperless-api-key
|
|
503
|
+
- PAPERLESS_PUBLIC_URL=https://paperless-ngx.yourpublicurl.com
|
|
504
|
+
ports:
|
|
505
|
+
- "3000:3000"
|
|
506
|
+
restart: unless-stopped
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Then run:
|
|
510
|
+
```bash
|
|
511
|
+
docker-compose up -d
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### Using with Continue VS Code Extension
|
|
515
|
+
|
|
516
|
+
If you're using the [Continue VS Code extension](https://continue.dev/), you can configure it to use the Dockerized MCP server via SSE.
|
|
517
|
+
|
|
518
|
+
Create or edit `.continue/mcpServers/paperless-mcp.yaml` at your workspace root:
|
|
519
|
+
|
|
520
|
+
```yaml
|
|
521
|
+
name: Paperless
|
|
522
|
+
version: 0.0.1
|
|
523
|
+
schema: v1
|
|
524
|
+
mcpServers:
|
|
525
|
+
- name: Paperless
|
|
526
|
+
type: sse
|
|
527
|
+
url: http://localhost:3000/sse
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Notes:**
|
|
531
|
+
- Replace `localhost` with your Docker host's IP address or hostname if running on a remote server
|
|
532
|
+
- The Docker container handles authentication via environment variables, so no credentials are needed in the Continue config
|
|
533
|
+
- The SSE endpoint is available at `/sse` on the configured port (default: 3000)
|
|
534
|
+
|
|
535
|
+
</details>
|
|
536
|
+
|
|
483
537
|
# Credits
|
|
484
538
|
|
|
485
539
|
This project is a fork of [nloui/paperless-mcp](https://github.com/nloui/paperless-mcp). Many thanks to the original author for their work. Contributions and improvements may be returned upstream.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
1
2
|
import { BulkEditDocumentsResult, BulkEditParameters, Correspondent, CustomField, Document, DocumentsResponse, DocumentType, GetCorrespondentsResponse, GetCustomFieldsResponse, GetDocumentTypesResponse, GetTagsResponse, Tag } from "./types";
|
|
2
3
|
export declare class PaperlessAPI {
|
|
3
4
|
private readonly baseUrl;
|
|
@@ -10,7 +11,8 @@ export declare class PaperlessAPI {
|
|
|
10
11
|
getDocument(id: number): Promise<Document>;
|
|
11
12
|
updateDocument(id: number, data: Partial<Document>): Promise<Document>;
|
|
12
13
|
searchDocuments(query: string): Promise<DocumentsResponse>;
|
|
13
|
-
downloadDocument(id: number, asOriginal?: boolean): Promise<
|
|
14
|
+
downloadDocument(id: number, asOriginal?: boolean): Promise<AxiosResponse<ArrayBuffer>>;
|
|
15
|
+
getThumbnail(id: number): Promise<AxiosResponse<ArrayBuffer>>;
|
|
14
16
|
getTags(): Promise<GetTagsResponse>;
|
|
15
17
|
createTag(data: Partial<Tag>): Promise<Tag>;
|
|
16
18
|
updateTag(id: number, data: Partial<Tag>): Promise<Tag>;
|
|
@@ -148,6 +148,17 @@ class PaperlessAPI {
|
|
|
148
148
|
return response;
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
getThumbnail(id) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const response = yield axios_1.default.get(`${this.baseUrl}/api/documents/${id}/thumb/`, {
|
|
154
|
+
headers: {
|
|
155
|
+
Authorization: `Token ${this.token}`,
|
|
156
|
+
},
|
|
157
|
+
responseType: "arraybuffer",
|
|
158
|
+
});
|
|
159
|
+
return response;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
151
162
|
// Tag operations
|
|
152
163
|
getTags() {
|
|
153
164
|
return __awaiter(this, void 0, void 0, function* () {
|
package/build/tools/documents.js
CHANGED
|
@@ -249,6 +249,25 @@ function registerDocumentTools(server, api) {
|
|
|
249
249
|
],
|
|
250
250
|
};
|
|
251
251
|
})));
|
|
252
|
+
server.tool("get_document_thumbnail", "Get a document thumbnail (image preview) by ID. Returns the thumbnail as a base64-encoded WebP image resource.", {
|
|
253
|
+
id: zod_1.z.number(),
|
|
254
|
+
}, (0, middlewares_1.withErrorHandling)((args, extra) => __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
if (!api)
|
|
256
|
+
throw new Error("Please configure API connection first");
|
|
257
|
+
const response = yield api.getThumbnail(args.id);
|
|
258
|
+
return {
|
|
259
|
+
content: [
|
|
260
|
+
{
|
|
261
|
+
type: "resource",
|
|
262
|
+
resource: {
|
|
263
|
+
uri: `document-${args.id}-thumb.webp`,
|
|
264
|
+
blob: Buffer.from(response.data).toString("base64"),
|
|
265
|
+
mimeType: "image/webp",
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
};
|
|
270
|
+
})));
|
|
252
271
|
server.tool("update_document", "Update a specific document with new values. This tool allows you to modify any document field including title, correspondent, document type, storage path, tags, custom fields, and more. Only the fields you specify will be updated.", {
|
|
253
272
|
id: zod_1.z.number().describe("The ID of the document to update"),
|
|
254
273
|
title: zod_1.z
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baruchiro/paperless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for interacting with Paperless-NGX document management system. Enables AI assistants to manage documents, tags, correspondents, and document types through the Paperless-NGX API.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"bin": {
|
package/paperless-mcp.dxt
CHANGED
|
Binary file
|