Document MCP
Document MCP
ChatGPT风格聊天机器人加一个Document MCP服务器。你在设置中注册文件夹路径和本地LiteLLM模型。问题发送到LiteLLM(带MCP工具);服务器只读取这些文件夹,使用pywin32 COM处理Word/Excel/PowerPoint(与Model Council相同的Office路径)。
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。设置 → 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 app设置
选项卡 | 功能说明 |
LiteLLM | 基础URL、密钥、加载 |
文件夹 | MCP根目录(允许列表)。与Model Council的 |
Claude MCP | 复制Claude Desktop / Claude Code / Cursor代码片段,或为你写入Claude Desktop配置 |
URL可以粘贴为http://host:4000、http://host:4000/v1或.../v1/chat/completions——它们会像Model Council一样被标准化。
LiteLLM + MCP如何在此工作
取自Model Council的应用内MCP循环:
主机调用MCP
tools/list并将模式转换为OpenAI工具。主机向LiteLLM POST
chat/completions,附带这些工具(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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Securely search and manage workspace context files for AI agents and teams.
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MENARHQ-cloud/Document-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server