Init commit

This commit is contained in:
pporcheret
2026-10-24 17:55:05 +02:00
parent 7152b10695
commit c9c3d5f223
122 changed files with 7154 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
PAPERLESS_URL=https://paperless.nerkdesign.com/
PAPERLESS_TOKEN=4c55d54776783220375c24bd4701edbae24cec86
+2
View File
@@ -0,0 +1,2 @@
PAPERLESS_URL=http://paperless.local:8000
PAPERLESS_TOKEN=CHANGE_ME
+3
View File
@@ -0,0 +1,3 @@
# MCP_paperless
Copier `.env.example` vers `.env`, puis créer le venv et installer `requirements.txt`.
+11
View File
@@ -0,0 +1,11 @@
import os, requests
from dotenv import load_dotenv
from mcp.server.fastmcp import FastMCP
load_dotenv();mcp=FastMCP("Alfred Paperless");BASE=os.getenv('PAPERLESS_URL','').rstrip('/');TOKEN=os.getenv('PAPERLESS_TOKEN','');H={'Authorization':f'Token {TOKEN}'}
@mcp.tool()
def search_documents(query:str, limit:int=10):
r=requests.get(BASE+'/api/documents/',headers=H,params={'query':query,'page_size':limit},timeout=20);r.raise_for_status();return r.json()
@mcp.tool()
def get_document(document_id:int):
r=requests.get(f'{BASE}/api/documents/{document_id}/',headers=H,timeout=20);r.raise_for_status();return r.json()
if __name__=='__main__':mcp.run()
+3
View File
@@ -0,0 +1,3 @@
mcp>=1.12
requests>=2.32
python-dotenv>=1.0