Skip to main content
Glama
MENARHQ-cloud

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 / PowerPoint

Claude Desktop, Claude Code und Cursor verbinden sich mit dem gleichen MCP-Server und der gleichen Ordnerliste.

Schnellstart

  1. Führen Sie Ihren LiteLLM-Proxy aus.

  2. Doppelklicken Sie auf start.bat.

  3. Öffnen Sie http://127.0.0.1:7860.

  4. 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.

  5. Einstellungen → Ordner: Fügen Sie Windows-Ordnerpfade ein. sample_docs ist beim ersten Start registriert.

  6. 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 app

Related MCP server: file-analysis-mcp

Einstellungen

Registerkarte

Funktion

LiteLLM

Basis-URL, Schlüssel, /v1/models laden, lokalen Modellnamen hinzufügen, der nicht in der Liste ist, Verbindung testen

Ordner

MCP-Roots (Positivliste). Gleiche Idee wie Model Council OFFICE_ALLOWED_ROOTS

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:

  1. Host ruft MCP tools/list auf und konvertiert Schemata in OpenAI-Tools.

  2. Host sendet POST chat/completions an LiteLLM mit diesen Tools (tool_choice: auto).

  3. Wenn das Modell tool_calls zurückgibt, führt der Host MCP tools/call (stdio) aus.

  4. Tool-JSON wird als role: tool angehä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

ping

Status, Engines, Ordneranzahl

list_folders

Registrierte Roots

add_folder / remove_folder

Roots ändern

list_documents

Bestandsaufnahme

search_documents

Name + extrahierter Text

read_document

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.bat

Dann fügen Sie http://127.0.0.1:8765/mcp hinzu.

pywin32 / Office

  • Word.Application → .doc / .docx

  • Excel.Application → .xls / .xlsx / .xlsm

  • PowerPoint.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.md

Layout

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)

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    C
    maintenance
    Enables 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
    -
  • F
    license
    A
    quality
    C
    maintenance
    Enables local Windows file management with allowlisted folder access and integration with Outlook Classic or Microsoft 365 email for AI assistants like Claude Desktop.
    38
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    1
    MIT