@baruchiro/paperless-mcp 0.0.2 → 0.0.3
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 +9 -2
- package/build/index.js +16 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- [](https://mseep.ai/app/nloui-paperless-mcp) -->
|
|
2
|
+
|
|
1
3
|
# Paperless-NGX MCP Server
|
|
2
4
|
|
|
3
5
|
[](https://smithery.ai/server/@baruchiro/paperless-mcp)
|
|
@@ -6,6 +8,8 @@ An MCP (Model Context Protocol) server for interacting with a Paperless-NGX API
|
|
|
6
8
|
|
|
7
9
|
## Quick Start
|
|
8
10
|
|
|
11
|
+
[](https://cursor.com/install-mcp?name=paperless&config=eyJjb21tYW5kIjoibnB4IC15IEBiYXJ1Y2hpcm8vcGFwZXJsZXNzLW1jcEBsYXRlc3QiLCJlbnYiOnsiUEFQRVJMRVNTX1VSTCI6Imh0dHA6Ly95b3VyLXBhcGVybGVzcy1pbnN0YW5jZTo4MDAwIiwiUEFQRVJMRVNTX0FQSV9LRVkiOiJ5b3VyLWFwaS10b2tlbiJ9fQ%3D%3D)
|
|
12
|
+
|
|
9
13
|
### Installing via Smithery
|
|
10
14
|
|
|
11
15
|
To install Paperless NGX MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@baruchiro/paperless-mcp):
|
|
@@ -28,7 +32,8 @@ Add these to your MCP config file:
|
|
|
28
32
|
],
|
|
29
33
|
"env": {
|
|
30
34
|
"PAPERLESS_URL": "http://your-paperless-instance:8000",
|
|
31
|
-
"PAPERLESS_API_KEY": "your-api-token"
|
|
35
|
+
"PAPERLESS_API_KEY": "your-api-token",
|
|
36
|
+
"PAPERLESS_PUBLIC_URL": "https://your-public-domain.com"
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
```
|
|
@@ -45,7 +50,8 @@ Add these to your MCP config file:
|
|
|
45
50
|
],
|
|
46
51
|
"env": {
|
|
47
52
|
"PAPERLESS_URL": "http://your-paperless-instance:8000",
|
|
48
|
-
"PAPERLESS_API_KEY": "your-api-token"
|
|
53
|
+
"PAPERLESS_API_KEY": "your-api-token",
|
|
54
|
+
"PAPERLESS_PUBLIC_URL": "https://your-public-domain.com"
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
```
|
|
@@ -59,6 +65,7 @@ Add these to your MCP config file:
|
|
|
59
65
|
4. Replace the placeholders in your MCP config:
|
|
60
66
|
- `http://your-paperless-instance:8000` with your Paperless-NGX URL
|
|
61
67
|
- `your-api-token` with the token you just generated
|
|
68
|
+
- `https://your-public-domain.com` with your public Paperless-NGX URL (optional, falls back to PAPERLESS_URL)
|
|
62
69
|
|
|
63
70
|
That's it! Now you can ask Claude to help you manage your Paperless-NGX documents.
|
|
64
71
|
|
package/build/index.js
CHANGED
|
@@ -24,20 +24,22 @@ const correspondents_1 = require("./tools/correspondents");
|
|
|
24
24
|
const documents_1 = require("./tools/documents");
|
|
25
25
|
const documentTypes_1 = require("./tools/documentTypes");
|
|
26
26
|
const tags_1 = require("./tools/tags");
|
|
27
|
-
const { values: { baseUrl, token, http: useHttp, port }, } = (0, node_util_1.parseArgs)({
|
|
27
|
+
const { values: { baseUrl, token, http: useHttp, port, publicUrl }, } = (0, node_util_1.parseArgs)({
|
|
28
28
|
options: {
|
|
29
29
|
baseUrl: { type: "string" },
|
|
30
30
|
token: { type: "string" },
|
|
31
31
|
http: { type: "boolean", default: false },
|
|
32
32
|
port: { type: "string" },
|
|
33
|
+
publicUrl: { type: "string", default: "" },
|
|
33
34
|
},
|
|
34
35
|
allowPositionals: true,
|
|
35
36
|
});
|
|
36
37
|
const resolvedBaseUrl = baseUrl || process.env.PAPERLESS_URL;
|
|
37
38
|
const resolvedToken = token || process.env.PAPERLESS_API_KEY;
|
|
39
|
+
const resolvedPublicUrl = publicUrl || process.env.PAPERLESS_PUBLIC_URL || resolvedBaseUrl;
|
|
38
40
|
const resolvedPort = port ? parseInt(port, 10) : 3000;
|
|
39
41
|
if (!resolvedBaseUrl || !resolvedToken) {
|
|
40
|
-
console.error("Usage: paperless-mcp --baseUrl <url> --token <token> [--http] [--port <port>]");
|
|
42
|
+
console.error("Usage: paperless-mcp --baseUrl <url> --token <token> [--http] [--port <port>] [--publicUrl <url>]");
|
|
41
43
|
console.error("Or set PAPERLESS_URL and PAPERLESS_API_KEY environment variables.");
|
|
42
44
|
process.exit(1);
|
|
43
45
|
}
|
|
@@ -45,7 +47,18 @@ function main() {
|
|
|
45
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
48
|
// Initialize API client and server once
|
|
47
49
|
const api = new PaperlessAPI_1.PaperlessAPI(resolvedBaseUrl, resolvedToken);
|
|
48
|
-
const server = new mcp_js_1.McpServer({ name: "paperless-ngx", version: "1.0.0" }
|
|
50
|
+
const server = new mcp_js_1.McpServer({ name: "paperless-ngx", version: "1.0.0" }, {
|
|
51
|
+
instructions: `
|
|
52
|
+
Paperless-NGX MCP Server Instructions
|
|
53
|
+
|
|
54
|
+
To view documents in your Paperless-NGX web interface, construct URLs using this pattern:
|
|
55
|
+
${resolvedBaseUrl}/documents/{document_id}/
|
|
56
|
+
|
|
57
|
+
Example: If your base URL is "http://localhost:8000", the web interface URL would be "http://localhost:8000/documents/123/" for document ID 123.
|
|
58
|
+
|
|
59
|
+
The document tools return JSON data with document IDs that you can use to construct these URLs.
|
|
60
|
+
`,
|
|
61
|
+
});
|
|
49
62
|
(0, documents_1.registerDocumentTools)(server, api);
|
|
50
63
|
(0, tags_1.registerTagTools)(server, api);
|
|
51
64
|
(0, correspondents_1.registerCorrespondentTools)(server, api);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baruchiro/paperless-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
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": {
|