paperless mcp
This commit is contained in:
parent
c76daf44e0
commit
a7732a655a
|
|
@ -198,7 +198,18 @@
|
||||||
"Bash(pandoc -f markdown -t docx \"_vollmacht_print.md\" -o \"Vollmacht Vera Pachtvertrag Viedenz.docx\")",
|
"Bash(pandoc -f markdown -t docx \"_vollmacht_print.md\" -o \"Vollmacht Vera Pachtvertrag Viedenz.docx\")",
|
||||||
"Bash(rm \"_vollmacht_print.md\")",
|
"Bash(rm \"_vollmacht_print.md\")",
|
||||||
"Bash(pandoc -f markdown -t docx \"_nachtrag_print.md\" -o \"Nachtrag Pachtvertrag Viedenz.docx\")",
|
"Bash(pandoc -f markdown -t docx \"_nachtrag_print.md\" -o \"Nachtrag Pachtvertrag Viedenz.docx\")",
|
||||||
"Bash(rm \"_nachtrag_print.md\")"
|
"Bash(rm \"_nachtrag_print.md\")",
|
||||||
|
"Read(//c/Users/d-chrka/**)",
|
||||||
|
"Edit(D:\\\\projects\\\\chrka\\\\brain\\\\.claude\\\\settings.json)",
|
||||||
|
"Bash(curl -sS -o /dev/null -w \"MCP root: HTTP %{http_code}\\\\n\" http://localhost:5000/)",
|
||||||
|
"Bash(curl -sS -o /dev/null -w \"MCP /mcp: HTTP %{http_code}\\\\n\" http://localhost:5000/mcp)",
|
||||||
|
"Bash(curl -sS -o /dev/null -w \"MCP /health: HTTP %{http_code}\\\\n\" http://localhost:5000/health)",
|
||||||
|
"Bash(curl -sS -X POST http://localhost:5000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}' -w '\\\\n---HTTP %{http_code}---\\\\n')",
|
||||||
|
"Bash(curl -sS -N -X POST http://localhost:5000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -H 'Mcp-Session-Id: test-session' -d '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\",\"params\":{}}')",
|
||||||
|
"Bash(curl -sS -i -X POST http://localhost:5000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}')",
|
||||||
|
"Bash(curl -sS -D - -o /dev/null -X POST http://localhost:5000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}')",
|
||||||
|
"Bash(awk '{print $2}')",
|
||||||
|
"Bash(SID=$\\(curl -sS -D - -o /dev/null -X POST http://localhost:5000/mcp \\\\\n -H \"Content-Type: application/json\" \\\\\n -H \"Accept: application/json, text/event-stream\" \\\\\n -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}' | grep -i \"mcp-session-id\" | awk '{print $2}' | tr -d '\\\\r\\\\n'\\)\ncurl -sS -X POST http://localhost:5000/mcp \\\\\n -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Mcp-Session-Id: $SID\" \\\\\n -d '{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}' -o /dev/null\necho \"=== Call: paperless_documents_get id=3323 ===\"\ncurl -sS -X POST http://localhost:5000/mcp \\\\\n -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Mcp-Session-Id: $SID\" \\\\\n -d '{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"tools/call\",\"params\":{\"name\":\"paperless_documents_get\",\"arguments\":{\"id\":3323}}}' | head -c 600)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ms365-calendar": {
|
"ms365-calendar": {
|
||||||
|
|
@ -207,5 +218,9 @@
|
||||||
"-c",
|
"-c",
|
||||||
"TOKEN=$(curl -s -X POST 'https://login.microsoftonline.com/94cf90d7-e9ff-49a1-bc3b-a5b94d3cc8ca/oauth2/v2.0/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials&client_id=93f9f15c-b566-4ca1-9145-c23f87c7f5c7&client_secret=Gpm8Q~5QKks3jYrbIkTM54AHmnZPC3a8RDc1Xam.&scope=https://graph.microsoft.com/.default' | python3 -c \"import sys,json; d=json.load(sys.stdin); print(d.get('access_token',''))\") && MS365_MCP_OAUTH_TOKEN=$TOKEN npx -y @softeria/ms-365-mcp-server --preset calendar --read-only"
|
"TOKEN=$(curl -s -X POST 'https://login.microsoftonline.com/94cf90d7-e9ff-49a1-bc3b-a5b94d3cc8ca/oauth2/v2.0/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials&client_id=93f9f15c-b566-4ca1-9145-c23f87c7f5c7&client_secret=Gpm8Q~5QKks3jYrbIkTM54AHmnZPC3a8RDc1Xam.&scope=https://graph.microsoft.com/.default' | python3 -c \"import sys,json; d=json.load(sys.stdin); print(d.get('access_token',''))\") && MS365_MCP_OAUTH_TOKEN=$TOKEN npx -y @softeria/ms-365-mcp-server --preset calendar --read-only"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"paperless": {
|
||||||
|
"type": "http",
|
||||||
|
"url": "http://localhost:5000/mcp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"title": "Dokumentiere pachtvertrag Viedenz",
|
"title": "Dokumentiere pachtvertrag Viedenz",
|
||||||
"titleGenerationStatus": "success",
|
"titleGenerationStatus": "success",
|
||||||
"createdAt": 1778770805667,
|
"createdAt": 1778770805667,
|
||||||
"updatedAt": 1778780175097,
|
"updatedAt": 1778827603536,
|
||||||
"lastResponseAt": 1778780175097,
|
"lastResponseAt": 1778780175097,
|
||||||
"sessionId": "2e51702d-cc9f-4067-8ae7-d6d8ade4c972",
|
"sessionId": "2e51702d-cc9f-4067-8ae7-d6d8ade4c972",
|
||||||
"providerState": {
|
"providerState": {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"id": "conv-1778827726105-2m4ikxrxg",
|
||||||
|
"providerId": "claude",
|
||||||
|
"title": "Optimize Paperless MCP integration",
|
||||||
|
"titleGenerationStatus": "success",
|
||||||
|
"createdAt": 1778827726105,
|
||||||
|
"updatedAt": 1778829160912,
|
||||||
|
"lastResponseAt": 1778829160911,
|
||||||
|
"sessionId": "81a5f2af-0645-4bdc-a7ca-8444d8ef0b5e",
|
||||||
|
"providerState": {
|
||||||
|
"providerSessionId": "81a5f2af-0645-4bdc-a7ca-8444d8ef0b5e"
|
||||||
|
},
|
||||||
|
"usage": {
|
||||||
|
"model": "opus",
|
||||||
|
"inputTokens": 1,
|
||||||
|
"cacheCreationInputTokens": 1378,
|
||||||
|
"cacheReadInputTokens": 113684,
|
||||||
|
"contextWindow": 200000,
|
||||||
|
"contextTokens": 115063,
|
||||||
|
"percentage": 58,
|
||||||
|
"contextWindowIsAuthoritative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"openTabs": [
|
"openTabs": [
|
||||||
{
|
{
|
||||||
"tabId": "tab-1776326979311-d1ltpj7",
|
"tabId": "tab-1776326979311-d1ltpj7",
|
||||||
"conversationId": "conv-1778770805666-gv3mpxj5m"
|
"conversationId": "conv-1778827726105-2m4ikxrxg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"activeTabId": "tab-1776326979311-d1ltpj7"
|
"activeTabId": "tab-1776326979311-d1ltpj7"
|
||||||
|
|
|
||||||
|
|
@ -4,53 +4,20 @@
|
||||||
"type": "split",
|
"type": "split",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": "abd6dd12c3a7a3c4",
|
"id": "d7ad139896e58563",
|
||||||
"type": "tabs",
|
"type": "tabs",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": "906e7d9288100579",
|
"id": "2c51a65fe9d6b31a",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "empty",
|
||||||
"state": {
|
"state": {},
|
||||||
"file": "00 Kontext/Personen/Hedwig Theile-Ochel.md",
|
|
||||||
"mode": "source",
|
|
||||||
"source": false
|
|
||||||
},
|
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "Hedwig Theile-Ochel"
|
"title": "Neuer Tab"
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "a9ec1200215db86a",
|
|
||||||
"type": "leaf",
|
|
||||||
"state": {
|
|
||||||
"type": "markdown",
|
|
||||||
"state": {
|
|
||||||
"file": "00 Kontext/Personen/Stefan Theile-Ochel.md",
|
|
||||||
"mode": "source",
|
|
||||||
"source": false
|
|
||||||
},
|
|
||||||
"icon": "lucide-file",
|
|
||||||
"title": "Stefan Theile-Ochel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "eda038c515c8d69c",
|
|
||||||
"type": "leaf",
|
|
||||||
"state": {
|
|
||||||
"type": "markdown",
|
|
||||||
"state": {
|
|
||||||
"file": "02 Projekte/Pachtanpassung Viedenz 2026/Vollmacht Vera Pachtvertrag Viedenz.md",
|
|
||||||
"mode": "source",
|
|
||||||
"source": false
|
|
||||||
},
|
|
||||||
"icon": "lucide-file",
|
|
||||||
"title": "Vollmacht Vera Pachtvertrag Viedenz"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"currentTab": 2
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
|
|
@ -228,21 +195,21 @@
|
||||||
},
|
},
|
||||||
"active": "1e4fd006b67464e8",
|
"active": "1e4fd006b67464e8",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
|
"CLAUDE.md.tmp.65564.1778829146795",
|
||||||
|
"03 Bereiche/Heimnetz/Server/Paperless.md.tmp.65564.1778828902314",
|
||||||
|
"02 Projekte/Pachtanpassung Viedenz 2026/~WRL3351.tmp",
|
||||||
|
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD3340.tmp",
|
||||||
|
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD3332.tmp",
|
||||||
|
"scripts/paperless-mcp/docker-compose.yml",
|
||||||
|
"scripts/paperless-mcp/docker-compose.yml.tmp.65564.1778828475762",
|
||||||
|
"scripts/paperless-mcp",
|
||||||
|
"02 Projekte/Pachtanpassung Viedenz 2026/Vollmacht Vera Pachtvertrag Viedenz.md",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/Nachtrag Pachtvertrag Viedenz.pdf",
|
"02 Projekte/Pachtanpassung Viedenz 2026/Nachtrag Pachtvertrag Viedenz.pdf",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD1720.tmp",
|
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD1720.tmp",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/Vollmacht Vera Pachtvertrag Viedenz.pdf",
|
"02 Projekte/Pachtanpassung Viedenz 2026/Vollmacht Vera Pachtvertrag Viedenz.pdf",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRL1427.tmp",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD1408.tmp",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~$chtrag Pachtvertrag Viedenz.docx",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRL0003.tmp",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD0002.tmp",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~WRD0000.tmp",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/~$llmacht Vera Pachtvertrag Viedenz.docx",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/Nachtrag Pachtvertrag Viedenz.docx",
|
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/_nachtrag_print.md",
|
"02 Projekte/Pachtanpassung Viedenz 2026/_nachtrag_print.md",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/_vollmacht_print.md",
|
"02 Projekte/Pachtanpassung Viedenz 2026/_vollmacht_print.md",
|
||||||
"00 Kontext/Personen/Stefan Theile-Ochel.md",
|
"00 Kontext/Personen/Stefan Theile-Ochel.md",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/Vollmacht Vera Pachtvertrag Viedenz.md",
|
|
||||||
"00 Kontext/Personen/Anne Menne.md",
|
"00 Kontext/Personen/Anne Menne.md",
|
||||||
"00 Kontext/Personen/Hedwig Theile-Ochel.md",
|
"00 Kontext/Personen/Hedwig Theile-Ochel.md",
|
||||||
"02 Projekte/Pachtanpassung Viedenz 2026/Nachtrag Pachtvertrag Viedenz.md",
|
"02 Projekte/Pachtanpassung Viedenz 2026/Nachtrag Pachtvertrag Viedenz.md",
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,9 @@
|
||||||
---
|
---
|
||||||
tags:
|
tags:
|
||||||
- upnote-import
|
- server
|
||||||
|
- paperless
|
||||||
|
- dms
|
||||||
|
- heimnetz
|
||||||
---
|
---
|
||||||
|
|
||||||
# Paperless-NGX
|
# Paperless-NGX
|
||||||
|
|
@ -22,7 +25,7 @@ Archivsystem.
|
||||||
### Config NPM
|
### Config NPM
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
|
@ -35,135 +38,194 @@ Archivsystem.
|
||||||
add_header P3P 'CP=""'; # may not be required in all setups
|
add_header P3P 'CP=""'; # may not be required in all setups
|
||||||
```
|
```
|
||||||
|
|
||||||
# Update
|
# MCP-Anbindung (Claude Code)
|
||||||
|
|
||||||
1. Version notierenaktuelle Version vermerken. Wird benötigt, falls ein Rollback erforderlich sein sollte
|
Damit Claude Code strukturiert (statt per `curl`) mit Paperless arbeiten kann, läuft ein **PaperlessMCP**-Container lokal auf der Windows-Workstation. Er übersetzt MCP-Tool-Calls in REST-Aufrufe gegen `paper.straso.com`.
|
||||||
2. altes Backup löschen, in /volume1/docker$
|
|
||||||
|
## Architektur
|
||||||
|
|
||||||
|
```
|
||||||
|
Claude Code ──MCP/HTTP──► PaperlessMCP (127.0.0.1:5000) ──REST/HTTPS──► Paperless-ngx (paper.straso.com)
|
||||||
|
(Windows) (Docker Desktop, Windows) (NAS, 10.40.10.131:8000)
|
||||||
|
```
|
||||||
|
|
||||||
|
Bewusst **nicht** in die NAS-Compose aufgenommen — Begründung siehe Abschnitt „Designentscheidungen".
|
||||||
|
|
||||||
|
## Komponenten
|
||||||
|
|
||||||
|
| Punkt | Wert |
|
||||||
|
|---|---|
|
||||||
|
| Repo | [barryw/PaperlessMCP](https://github.com/barryw/PaperlessMCP) (.NET, 43 Tools, Bulk-Ops) |
|
||||||
|
| Image | `ghcr.io/barryw/paperlessmcp:latest` |
|
||||||
|
| Stack-Datei | `scripts/paperless-mcp/docker-compose.yml` |
|
||||||
|
| Env-Datei | `scripts/paperless-mcp/.env` (gitignored, Template: `.env.example`) |
|
||||||
|
| Bind-Adresse | `127.0.0.1:5000` (lokal-only, kein LAN-Exposure) |
|
||||||
|
| MCP-Endpoint | `http://localhost:5000/mcp` |
|
||||||
|
| Claude-Config | `paperless` als HTTP-MCP in `.claude/settings.json` |
|
||||||
|
| Tool-Prefix in Claude | `mcp__paperless__*` |
|
||||||
|
|
||||||
|
## Betrieb
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /volume1/docker
|
cd D:\projects\chrka\brain\scripts\paperless-mcp
|
||||||
rm -r paperless_backup/
|
|
||||||
|
docker compose up -d # start
|
||||||
|
docker compose ps # status
|
||||||
|
docker compose logs -f # tail logs
|
||||||
|
docker compose pull && docker compose up -d # update
|
||||||
|
docker compose down # stop
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Anwendung stoppen in /volume1/docker/paperless$
|
## Sicherheit
|
||||||
|
|
||||||
```
|
- **Token** liegt nur in `scripts/paperless-mcp/.env` (gitignored, identisch zum Token in `scripts/.env`)
|
||||||
cd paperless
|
- **Port-Binding** `127.0.0.1:5000` → kein Zugriff aus LAN/Internet, auch nicht versehentlich
|
||||||
sudo docker-compose down
|
- **Dry-Run default** in PaperlessMCP: destruktive Ops (Delete, Bulk-Edit) brauchen explizit `confirm=true`
|
||||||
```
|
- Tausche Token bei Bedarf in Paperless: Settings → Django Admin → Tokens, danach `.env` aktualisieren + `docker compose restart`
|
||||||
|
|
||||||
3. neues Backup erstellen, in /volume1/docker$
|
## Designentscheidungen
|
||||||
|
|
||||||
```
|
- **Lokal statt NAS-Compose**, weil:
|
||||||
cd ..
|
- MCP-Server hat sehr breite Schreibrechte → soll nicht im LAN exponiert sein
|
||||||
sudo cp -r ./paperless ./paperless_backup
|
- Token muss nicht auf die NAS migriert werden, bleibt im Vault-Workspace
|
||||||
```
|
- NAS-Update-Routine bleibt schlank (siehe unten)
|
||||||
|
- Container läuft nur wenn gebraucht, kein 24/7-Idle
|
||||||
|
- **HTTP statt stdio**, weil PaperlessMCP nur HTTP unterstützt und Claude Code HTTP-MCPs nativ kann
|
||||||
|
- **Eigene `.env` statt `scripts/.env`**, weil PaperlessMCP andere Variablennamen erwartet (`PAPERLESS_BASE_URL`, `PAPERLESS_API_TOKEN`)
|
||||||
|
|
||||||
4. Images löschen, in /volume1/docker/paperless$
|
## Troubleshooting
|
||||||
|
|
||||||
```
|
| Symptom | Check |
|
||||||
cd paperless
|
|---|---|
|
||||||
sudo docker-compose rm -f
|
| Claude findet `paperless` nicht | Container läuft? `docker compose ps`. Claude Code neu starten. |
|
||||||
```
|
| `Connection refused` auf :5000 | Docker Desktop läuft? Port-Binding stimmt? `netstat -an \| findstr 5000` |
|
||||||
|
| 401 von paper.straso.com | Token in `.env` korrekt? Token in Paperless noch gültig? |
|
||||||
|
| `mcpServers`-Key nicht gefunden | `paperless`-Eintrag in `.claude/settings.json` steht auf Root-Ebene; ggf. unter `mcpServers` schieben |
|
||||||
|
| Image-Tag broken | In `docker-compose.yml` auf konkrete Version pinnen, siehe [Releases](https://github.com/barryw/PaperlessMCP/releases) |
|
||||||
|
|
||||||
5. Images Updaten, in /volume1/docker/paperless$
|
# Update
|
||||||
|
|
||||||
```
|
Arbeitsverzeichnis auf der NAS: `/volume1/docker/paperless`
|
||||||
sudo docker-compose pull
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Anwendung starten
|
1. **Aktuelle Version notieren** — für Rollback im Fehlerfall.
|
||||||
|
|
||||||
```
|
2. **Altes Backup löschen:**
|
||||||
sudo docker-compose up -d
|
```bash
|
||||||
```
|
cd /volume1/docker
|
||||||
|
rm -r paperless_backup/
|
||||||
|
```
|
||||||
|
|
||||||
### DB-Server-Upgrade
|
3. **Anwendung stoppen:**
|
||||||
|
```bash
|
||||||
|
cd /volume1/docker/paperless
|
||||||
|
sudo docker-compose down
|
||||||
|
```
|
||||||
|
|
||||||
nur den DB Container starten
|
4. **Neues Backup erstellen:**
|
||||||
|
```bash
|
||||||
|
cd /volume1/docker
|
||||||
|
sudo cp -r ./paperless ./paperless_backup
|
||||||
|
```
|
||||||
|
|
||||||
```
|
5. **Container entfernen:**
|
||||||
|
```bash
|
||||||
|
cd /volume1/docker/paperless
|
||||||
|
sudo docker-compose rm -f
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **Images aktualisieren:**
|
||||||
|
```bash
|
||||||
|
sudo docker-compose pull
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **Anwendung starten:**
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## DB-Server-Upgrade
|
||||||
|
|
||||||
|
Nur den DB-Container starten:
|
||||||
|
|
||||||
|
```bash
|
||||||
sudo docker-compose up -d db
|
sudo docker-compose up -d db
|
||||||
```
|
```
|
||||||
|
|
||||||
backup script erstellen
|
Backup-Script:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
sudo docker exec -it paperless-db-1 pg_dumpall -U paperless > $HOME/upgrade_paperless_backup.sql
|
sudo docker exec -it paperless-db-1 pg_dumpall -U paperless > $HOME/upgrade_paperless_backup.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
…..
|
### Bekannte Stolperfallen
|
||||||
|
|
||||||
[Paperless broke after update | solariz.de - Tech & Thoughts](https://solariz.de/posts/25/paperless-broken-after-upgrade-postgress/#paperless-ngx-postgresql-14-or-later-is-required-error)
|
- **PostgreSQL 14+ Pflicht ab bestimmten Versionen:** [solariz.de — Paperless broken after upgrade](https://solariz.de/posts/25/paperless-broken-after-upgrade-postgress/#paperless-ngx-postgresql-14-or-later-is-required-error)
|
||||||
|
- **`password authentication failed for user "paperless"`** — Volumes zurücksetzen ([Issue #1552](https://github.com/jonaswinkler/paperless-ng/issues/1552)):
|
||||||
|
```bash
|
||||||
|
docker-compose up -V --remove-orphans --force-recreate
|
||||||
|
```
|
||||||
|
|
||||||
außerdem mussten alle volumes einmal zurückgesetzt werden: [\[BUG\] password authentication failed for user "paperless" · Issue #1552 · jonaswinkler/paperless-ng](https://github.com/jonaswinkler/paperless-ng/issues/1552)
|
## Updateverlauf
|
||||||
|
|
||||||
```
|
|
||||||
docker-compose up -V --remove-orphans --force-recreate
|
|
||||||
```
|
|
||||||
|
|
||||||
# <br>
|
|
||||||
|
|
||||||
# Updateverlauf
|
|
||||||
|
|
||||||
- 2025-09-26: von 2.13.5 auf 2.18.4
|
- 2025-09-26: von 2.13.5 auf 2.18.4
|
||||||
|
|
||||||
## <br>
|
|
||||||
|
|
||||||
# Archivierungsworkflow
|
# Archivierungsworkflow
|
||||||
|
|
||||||
### Dokumente, die aufbewahrt werden:
|
## Dokumente, die aufbewahrt werden
|
||||||
|
|
||||||
189er Etiketten für [ASNs](https://docs.paperless-ngx.com/advanced_usage/#archive-serial-number-assignment):
|
- 189er Etiketten für [ASNs](https://docs.paperless-ngx.com/advanced_usage/#archive-serial-number-assignment): [bueroshop24 — Avery Zweckform L4731REV](https://www.bueroshop24.de/5670-avery-zweckform-etiketten-l4731rev-25-wei%C3%9F-25-4-x-10-0-mm-345520?mkz=724)
|
||||||
|
- Tool zum Generieren von Barcodes: [tobiasmaier.info — ASN QR Code Label Generator](https://tobiasmaier.info/asn-qr-code-label-generator/)
|
||||||
|
|
||||||
[https://www.bueroshop24.de/5670-avery-zweckform-etiketten-l4731rev-25-wei%C3%9F-25-4-x-10-0-mm-345520?mkz=724](https://www.bueroshop24.de/5670-avery-zweckform-etiketten-l4731rev-25-wei%C3%9F-25-4-x-10-0-mm-345520?mkz=724)
|
## Empfohlener Workflow
|
||||||
|
|
||||||
Tools zum generieren von Barcodes:
|
[Paperless-ngx Docs — Recommended Workflow](https://docs.paperless-ngx.com/usage/#usage-recommended-workflow)
|
||||||
|
|
||||||
[https://tobiasmaier.info/asn-qr-code-label-generator/](https://tobiasmaier.info/asn-qr-code-label-generator/)
|
## ASN-Definition
|
||||||
|
|
||||||
### empfohlener Wokflow:
|
|
||||||
|
|
||||||
[https://docs.paperless-ngx.com/usage/#usage-recommended-workflow](https://docs.paperless-ngx.com/usage/#usage-recommended-workflow)
|
|
||||||
|
|
||||||
### ASN-Definition:
|
|
||||||
|
|
||||||
Zähler-Offset:
|
Zähler-Offset:
|
||||||
|
|
||||||
100189 = Christian
|
| Offset | Person |
|
||||||
|
|---|---|
|
||||||
|
| 100189 | Christian |
|
||||||
|
| 200189 | Vera |
|
||||||
|
| 300189 | Vicky |
|
||||||
|
| 400189 | Justus |
|
||||||
|
| 500189 | Hetti |
|
||||||
|
|
||||||
200189 = Vera
|
Beispiel: `ASN200000, TAG:Vera`
|
||||||
|
|
||||||
300189 = Vicky
|
|
||||||
|
|
||||||
400189 = Justus
|
|
||||||
|
|
||||||
500189 = Hetti
|
|
||||||
|
|
||||||
z.B.: ASN200000,TAG:Vera
|
|
||||||
|
|
||||||
# Dokumente exportieren
|
# Dokumente exportieren
|
||||||
|
|
||||||
VoraussetzungVolume für Export-Verzeichnis festlegen
|
**Voraussetzung:** Volume für Export-Verzeichnis festlegen.
|
||||||
|
|
||||||
` ``` volumes: - /volume1/docker/paperless/data:/usr/src/paperless/data - /volume1/docker/paperless/media:/usr/src/paperless/media - /volume1/docker/paperless_export:/usr/src/paperless/export # https://paperless.readthedocs.io/en/latest/utilities.html#the-exporter - /volume1/homes/chk/Drive/Paperless-Input:/usr/src/paperless/consume ``` `
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- /volume1/docker/paperless/data:/usr/src/paperless/data
|
||||||
|
- /volume1/docker/paperless/media:/usr/src/paperless/media
|
||||||
|
- /volume1/docker/paperless_export:/usr/src/paperless/export # https://paperless.readthedocs.io/en/latest/utilities.html#the-exporter
|
||||||
|
- /volume1/homes/chk/Drive/Paperless-Input:/usr/src/paperless/consume
|
||||||
|
```
|
||||||
|
|
||||||
manueller Export
|
Manueller Export:
|
||||||
|
|
||||||
` ``` sudo docker exec paperless-webserver-1 document_exporter ../export ``` `
|
```bash
|
||||||
|
sudo docker exec paperless-webserver-1 document_exporter ../export
|
||||||
|
```
|
||||||
|
|
||||||
Archiv erzeugen
|
Archiv erzeugen:
|
||||||
|
|
||||||
` ``` tar -czf paper_export.tgz ./paperless_export ``` `
|
```bash
|
||||||
|
tar -czf paper_export.tgz ./paperless_export
|
||||||
|
```
|
||||||
|
|
||||||
manueller Import
|
Manueller Import:
|
||||||
|
|
||||||
` ``` sudo docker exec paperless-webserver-1 document_importer ../export ``` `
|
```bash
|
||||||
|
sudo docker exec paperless-webserver-1 document_importer ../export
|
||||||
|
```
|
||||||
|
|
||||||
Quelle: [https://www.youtube.com/watch?v=F-NtIbxF6oc](https://www.youtube.com/watch?v=F-NtIbxF6oc)
|
Quelle: [YouTube — Paperless-ngx Export/Import](https://www.youtube.com/watch?v=F-NtIbxF6oc)
|
||||||
|
|
||||||
# Backup NAS in Amazon Cloud
|
# Backup NAS in Amazon Cloud
|
||||||
|
|
||||||
[https://s3.console.aws.amazon.com/s3/buckets/paperbackup?region=eu-west-1&tab=objects](https://s3.console.aws.amazon.com/s3/buckets/paperbackup?region=eu-west-1&tab=objects)
|
- [S3 Bucket `paperbackup`](https://s3.console.aws.amazon.com/s3/buckets/paperbackup?region=eu-west-1&tab=objects) (Amazon Portal S3 → Buckets)
|
||||||
|
|
||||||
Amazon Portal S3 → Buckets
|
|
||||||
|
|
|
||||||
23
CLAUDE.md
23
CLAUDE.md
|
|
@ -37,27 +37,24 @@ Christian Kauer, IT-Leiter bei der KRAH Elektrotechnischen Fabrik GmbH & Co. KG,
|
||||||
|
|
||||||
Wenn der Nutzer „Paperless", „mein Dokumentenarchiv", „mein Archiv", „meine Belege" o.ä. erwähnt, ist die Paperless-ngx-Instanz unter `https://paper.straso.com/` gemeint.
|
Wenn der Nutzer „Paperless", „mein Dokumentenarchiv", „mein Archiv", „meine Belege" o.ä. erwähnt, ist die Paperless-ngx-Instanz unter `https://paper.straso.com/` gemeint.
|
||||||
|
|
||||||
**Zugriff:** REST-API mit Token-Auth. Credentials in `scripts/.env`:
|
**Zugriff:** Primär über **MCP** (`mcp__paperless__*`-Tools). Container läuft lokal auf `http://localhost:5000/mcp`. Setup-Doku: [[03 Bereiche/Heimnetz/Server/Paperless.md|Paperless.md]].
|
||||||
- `PAPERLESS_URL=https://paper.straso.com/`
|
|
||||||
- `PAPERLESS_TOKEN=...`
|
|
||||||
|
|
||||||
**Aufruf-Pattern (Bash + curl):**
|
**Wichtige Tools:**
|
||||||
|
- `paperless_documents_get` — Einzeldokument (inkl. OCR-`content`)
|
||||||
|
- `paperless_documents_list` / Search-Tools — Listen, Filter, Volltextsuche
|
||||||
|
- `paperless_correspondents_*`, `paperless_document_types_*`, `paperless_tags_*` — Metadaten
|
||||||
|
- `paperless_documents_update` / Bulk-Ops — Editieren (Dry-Run default, destruktive Ops brauchen `confirm=true`)
|
||||||
|
|
||||||
|
**Fallback (nur wenn MCP-Container down):** REST mit Token-Auth aus `scripts/.env`:
|
||||||
```bash
|
```bash
|
||||||
source scripts/.env
|
source scripts/.env
|
||||||
curl -sS -H "Authorization: Token $PAPERLESS_TOKEN" "$PAPERLESS_URL/api/documents/<ID>/"
|
curl -sS -H "Authorization: Token $PAPERLESS_TOKEN" "$PAPERLESS_URL/api/documents/<ID>/"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Wichtige Endpoints:**
|
|
||||||
- `GET /api/documents/<id>/` — Einzeldokument (inkl. OCR-`content`)
|
|
||||||
- `GET /api/documents/?correspondent__id=<id>&page_size=50&ordering=created` — Liste filtern
|
|
||||||
- `GET /api/documents/?query=<suchbegriff>` — Volltextsuche
|
|
||||||
- `GET /api/correspondents/<id>/`, `/api/document_types/<id>/`, `/api/tags/<id>/` — Metadaten auflösen
|
|
||||||
- `GET /api/documents/<id>/download/` — Originaldatei
|
|
||||||
|
|
||||||
**Hinweise:**
|
**Hinweise:**
|
||||||
- JSON immer mit `encoding='utf-8'` lesen (Windows-Default cp1252 scheitert)
|
|
||||||
- Bei Bezug auf Dokumente: ID, Titel und Datum nennen, in Notizen als `[[Paperless <ID>]]` verlinken
|
- Bei Bezug auf Dokumente: ID, Titel und Datum nennen, in Notizen als `[[Paperless <ID>]]` verlinken
|
||||||
- Token nicht in Notizen oder Chat ausgeben
|
- Token niemals in Notizen oder Chat ausgeben
|
||||||
|
- Bei Fallback auf curl: JSON immer mit `encoding='utf-8'` lesen (Windows-Default cp1252 scheitert)
|
||||||
|
|
||||||
## Session-Routinen
|
## Session-Routinen
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Copy to .env and fill in values. Never commit .env.
|
||||||
|
# Token comes from Paperless: Settings -> Django Admin -> Tokens
|
||||||
|
PAPERLESS_BASE_URL=https://paper.straso.com
|
||||||
|
PAPERLESS_API_TOKEN=
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
.env
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
# PaperlessMCP — MCP server bridging Claude Code to Paperless-ngx
|
||||||
|
# Runs locally on Windows (Docker Desktop). Exposed only on localhost.
|
||||||
|
# Repo: https://github.com/barryw/PaperlessMCP
|
||||||
|
#
|
||||||
|
# Start: docker compose up -d
|
||||||
|
# Stop: docker compose down
|
||||||
|
# Update: docker compose pull && docker compose up -d
|
||||||
|
# Logs: docker compose logs -f
|
||||||
|
|
||||||
|
services:
|
||||||
|
paperless-mcp:
|
||||||
|
image: ghcr.io/barryw/paperlessmcp:latest
|
||||||
|
container_name: paperless-mcp
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5000:5000" # localhost only — never expose publicly
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost:5000/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
Loading…
Reference in New Issue