Document MCP
Document MCP
ChatGPT-ähnlicher Chatbot plus ein Document MCP-Server. Sie registrieren Ordnerpfade und ein lokales LiteLLM-Modell in den Einstellungen. Fragen gehen an LiteLLM mit MCP-Tools; der Server liest nur diese Ordner, unter Verwendung von pywin32 COM für Word / Excel / PowerPoint (gleicher Office-Pfad wie Model Council).
Chat UI → LiteLLM /v1/chat/completions (+ tools)
↑ tool_calls (search_documents, read_document, …)
MCP host → Document MCP (stdio JSON-RPC)
→ allowlisted folders
→ win32com Word / Excel / PowerPointClaude Desktop, Claude Code und Cursor verbinden sich mit dem gleichen MCP-Server und der gleichen Ordnerliste.
Schnellstart
Führen Sie Ihren LiteLLM-Proxy aus.
Doppelklicken Sie auf
start.bat.Öffnen Sie http://127.0.0.1:7860.
Einstellungen → LiteLLM: Fügen Sie die Basis-URL (z. B.
http://localhost:4000), den API-Schlüssel ein, Modelle laden oder Modell hinzufügen, dann Speichern.Einstellungen → Ordner: Fügen Sie Windows-Ordnerpfade ein.
sample_docsist beim ersten Start registriert.Fragen Sie alles, was diese Dateien beantworten können.
Manuell
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python -m appRelated MCP server: file-analysis-mcp
Einstellungen
Registerkarte | Funktion |
LiteLLM | Basis-URL, Schlüssel, |
Ordner | MCP-Roots (Positivliste). Gleiche Idee wie Model Council |
Claude MCP | Claude Desktop / Claude Code / Cursor-Snippets kopieren oder Claude Desktop-Konfiguration für Sie schreiben |
URLs können als http://host:4000, http://host:4000/v1 oder .../v1/chat/completions eingefügt werden – sie werden wie bei Model Council normalisiert.
Wie LiteLLM + MCP hier funktionieren
Aus Model Councils In-App-MCP-Schleife übernommen:
Host ruft MCP
tools/listauf und konvertiert Schemata in OpenAI-Tools.Host sendet POST
chat/completionsan LiteLLM mit diesen Tools (tool_choice: auto).Wenn das Modell
tool_callszurückgibt, führt der Host MCPtools/call(stdio) aus.Tool-JSON wird als
role: toolangehängt und die Schleife wiederholt sich, bis eine normale Antwort erfolgt.
Das Modell sieht niemals Dateien, es sei denn, es ruft ein Tool auf. Roots sind in der Positivliste. Office-Dateien bevorzugen COM, sodass Windows-entsperrte / IRM-Dateien weiterhin gelesen werden können.
MCP-Tools
Tool | Zweck |
| Status, Engines, Ordneranzahl |
| Registrierte Roots |
| Roots ändern |
| Bestandsaufnahme |
| Name + extrahierter Text |
| Extrahieren (COM zuerst, Bibliothek als Fallback) |
Prompt: ask_documents.
Claude Desktop / Claude Code / Cursor
Im Chatbot: Einstellungen → Claude MCP → Zu Claude Desktop hinzufügen (schreibt %APPDATA%\Claude\claude_desktop_config.json). Claude neu starten, dann bitten Sie es, Document MCP zu pingen.
Oder kopieren Sie diese Vorlage (Pfade werden in den Einstellungen ausgefüllt):
{
"mcpServers": {
"document-mcp": {
"command": "D:\\\\AntigravityCodes\\\\Document-MCP\\\\.venv\\\\Scripts\\\\python.exe",
"args": ["-m", "document_mcp"],
"cwd": "D:\\\\AntigravityCodes\\\\Document-MCP",
"env": {
"PYTHONUTF8": "1",
"DOCUMENT_MCP_ROOTS": "D:\\\\AntigravityCodes\\\\Document-MCP\\\\data\\\\folders.json"
}
}
}
}Claude Code:
claude mcp add-json document-mcp "{...stdio server json from Settings...}"Cursor: Repo mcp.json, oder Einstellungen → Claude MCP Cursor-Snippet kopieren.
HTTP (LiteLLM MCP-Gateway):
start_mcp_http.batDann fügen Sie http://127.0.0.1:8765/mcp hinzu.
pywin32 / Office
Word.Application→.doc/.docxExcel.Application→.xls/.xlsx/.xlsmPowerPoint.Application→.ppt/.pptx
Fallback: python-docx / openpyxl / python-pptx. PDFs: PyMuPDF. Legacy binäres Office benötigt weiterhin Microsoft Office.
python -m document_mcp.reader sample_docs\mena_rhq_overview.mdLayout
app/ FastAPI chat host (MCP client + UI)
document_mcp/ FastMCP server, COM readers, Claude install helper
sample_docs/ Starter files
data/ folders.json, settings, extract cache (local)Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Read and search folders on your own computer with explicit consent. Files are never uploaded.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables natural language interaction with local .docx files, allowing users to find, read, search, and summarize Word documents using friendly names and location hints.53-
- FlicenseAqualityDmaintenanceEnables read-only scanning and text extraction from PDF, DOCX, PPTX, SVG, and PNG files in a local folder, providing the raw text to AI models for summarization or analysis without an external LLM API.5-
- FlicenseAqualityCmaintenanceEnables local Windows file management with allowlisted folder access and integration with Outlook Classic or Microsoft 365 email for AI assistants like Claude Desktop.38-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents on Windows to drive real Microsoft Word and WPS Office applications through COM, automating legacy .doc/.docx batch conversion, bookmark and placeholder template filling, print-fidelity PDF export, extraction from legacy binaries, editing of documents currently open on screen, and mail-merge batch generation. It hardens these operations with CJK font preservation, password and corruption pre-checks, structured self-correcting errors, path allowlisting, read-only mode, and automatic Word-to-WPS failover.1MIT