Document MCP
Document MCP
Chatbot estilo ChatGPT más un servidor Document MCP. Registras rutas de carpetas y un modelo LiteLLM local en Configuración. Las preguntas van a LiteLLM con herramientas MCP; el servidor solo lee esas carpetas, usando pywin32 COM para Word / Excel / PowerPoint (la misma ruta de Office que 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 y Cursor se conectan al mismo servidor MCP y a la misma lista de carpetas.
Inicio rápido
Ejecuta tu proxy LiteLLM.
Haz doble clic en
start.bat.Abre http://127.0.0.1:7860.
Configuración → LiteLLM: pega la URL base (p. ej.
http://localhost:4000), clave API, Cargar modelos o Añadir modelo, luego Guardar.Configuración → Carpetas: pega rutas de carpetas de Windows.
sample_docsse registra en la primera ejecución.Pregunta cualquier cosa que esos archivos puedan responder.
Manual
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python -m appRelated MCP server: file-analysis-mcp
Configuración
Pestaña | Qué hace |
LiteLLM | URL base, clave, cargar |
Folders | Raíces MCP (lista permitida). Misma idea que Model Council |
Claude MCP | Copiar fragmentos de Claude Desktop / Claude Code / Cursor, o escribir la configuración de Claude Desktop por ti |
Las URL se pueden pegar como http://host:4000, http://host:4000/v1 o .../v1/chat/completions — se normalizan como Model Council.
Cómo funcionan LiteLLM + MCP aquí
Tomado del bucle MCP dentro de la aplicación de Model Council:
El host llama a MCP
tools/listy convierte los esquemas en herramientas de OpenAI.El host envía POST
chat/completionsa LiteLLM con esas herramientas (tool_choice: auto).Si el modelo devuelve
tool_calls, el host ejecuta MCPtools/call(stdio).El JSON de la herramienta se añade como
role: tooly el bucle se repite hasta obtener una respuesta normal.
El modelo nunca ve archivos a menos que llame a una herramienta. Las raíces están en la lista permitida. Los archivos de Office prefieren COM para que los archivos desbloqueados por Windows / IRM aún puedan leerse.
Herramientas MCP
Herramienta | Propósito |
| Estado, motores, número de carpetas |
| Raíces registradas |
| Cambiar raíces |
| Inventario |
| Nombre + texto extraído |
| Extraer (COM primero, biblioteca de respaldo) |
Prompt: ask_documents.
Claude Desktop / Claude Code / Cursor
En el chatbot: Configuración → Claude MCP → Añadir a Claude Desktop (escribe %APPDATA%\Claude\claude_desktop_config.json). Reinicia Claude, luego pídele que haga ping a Document MCP.
O copia esta forma (las rutas se completan en Configuración):
{
"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: repositorio mcp.json, o Configuración → Claude MCP copia el fragmento de Cursor.
HTTP (puerta de enlace LiteLLM MCP):
start_mcp_http.batLuego añade http://127.0.0.1:8765/mcp.
pywin32 / Office
Word.Application→.doc/.docxExcel.Application→.xls/.xlsx/.xlsmPowerPoint.Application→.ppt/.pptx
Respaldo: python-docx / openpyxl / python-pptx. PDFs: PyMuPDF. Office binario heredado aún necesita Microsoft Office.
python -m document_mcp.reader sample_docs\mena_rhq_overview.mdDiseño
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)This server cannot be deployed
Maintenance
Related MCP Connectors
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.
Securely search and manage workspace context files for AI agents and teams.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
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-
- FlicenseAqualityCmaintenanceEnables 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