Document MCP
Документ MCP
Чат-бот в стиле ChatGPT плюс сервер Document MCP. Вы регистрируете пути к папкам и локальную модель LiteLLM в Настройках. Вопросы направляются в LiteLLM с инструментами MCP; сервер читает только эти папки, используя pywin32 COM для Word / Excel / PowerPoint (тот же путь Office, что и в 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 и Cursor подключаются к тому же серверу MCP и тому же списку папок.
Быстрый старт
Запустите свой прокси LiteLLM.
Дважды щелкните
start.bat.Откройте http://127.0.0.1:7860.
Настройки → LiteLLM: вставьте базовый URL (например,
http://localhost:4000), ключ API, Загрузить модели или Добавить модель, затем Сохранить.Настройки → Папки: вставьте пути к папкам Windows.
sample_docsрегистрируется при первом запуске.Спросите что угодно, что могут ответить эти файлы.
Вручную
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python -m appRelated MCP server: file-analysis-mcp
Настройки
Вкладка | Что делает |
LiteLLM | Базовый URL, ключ, загрузить |
Папки | Корни MCP (разрешенный список). Та же идея, что и |
Claude MCP | Скопировать сниппеты для Claude Desktop / Claude Code / Cursor, или записать конфиг Claude Desktop за вас |
URL-адреса можно вставлять как http://host:4000, http://host:4000/v1 или .../v1/chat/completions — они нормализуются, как в Model Council.
Как здесь работают LiteLLM + MCP
Взято из цикла MCP внутри приложения Model Council:
Хост вызывает MCP
tools/listи преобразует схемы в инструменты OpenAI.Хост отправляет POST-запрос
chat/completionsк LiteLLM с этими инструментами (tool_choice: auto).Если модель возвращает
tool_calls, хост запускает MCPtools/call(stdio).JSON инструмента добавляется как
role: tool, и цикл повторяется до тех пор, пока не будет получен обычный ответ.
Модель никогда не видит файлы, если она не вызывает инструмент. Корни находятся в разрешенном списке. Файлы Office отдают предпочтение COM, чтобы даже заблокированные для Windows / IRM файлы можно было прочитать.
Инструменты MCP
Инструмент | Назначение |
| Исправность, движки, количество папок |
| Зарегистрированные корни |
| Изменить корни |
| Инвентаризация |
| Имя + извлеченный текст |
| Извлечение (сначала COM, библиотека как запасной вариант) |
Подсказка: ask_documents.
Claude Desktop / Claude Code / Cursor
В чат-боте: Настройки → Claude MCP → Добавить в Claude Desktop (записывает %APPDATA%\Claude\claude_desktop_config.json). Перезапустите Claude, затем попросите его выполнить ping для Document MCP.
Или скопируйте эту структуру (пути заполняются в Настройках):
{
"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: репо mcp.json, или Настройки → Claude MCP скопируйте сниппет Cursor.
HTTP (шлюз LiteLLM MCP):
start_mcp_http.batЗатем добавьте http://127.0.0.1:8765/mcp.
pywin32 / Office
Word.Application→.doc/.docxExcel.Application→.xls/.xlsx/.xlsmPowerPoint.Application→.ppt/.pptx
Запасной вариант: python-docx / openpyxl / python-pptx. PDF: PyMuPDF. Для устаревших двоичных файлов Office по-прежнему требуется Microsoft Office.
python -m document_mcp.reader sample_docs\mena_rhq_overview.mdМакет
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