MCP Servers

模型上下文协议服务器、框架、SDK 和模板的综合目录。

MCP server by pycraft-ai

创建于 6/17/2026
更新于 about 8 hours ago
Repository documentation and setup instructions

MCP Document Server

基于 MCP (Model Context Protocol) 的多格式文档读取工具,通过 stdio 传输协议提供服务。

功能

支持读取以下文档格式的内容:

| 格式 | 扩展名 | 所需库 | |------|--------|--------| | Word | .docx | python-docx | | Excel | .xlsx / .xls | openpyxl | | PDF | .pdf | PyMuPDF | | PowerPoint | .pptx | python-pptx | | CSV / 纯文本 | .csv / .txt / .md | 内置 | | JSON | .json | 内置(格式化输出) | | YAML | .yaml / .yml | 内置 |

安装

pip install python-docx openpyxl PyMuPDF python-pptx

使用

该服务器通过标准输入/输出(stdio)与 MCP 客户端通信。

提供的工具

  • read_document - 读取指定路径的文档内容
    • 参数: path (string) - 文件路径

示例:使用 MCP Inspector

# 安装 inspector 后运行
npx @modelcontextprotocol/inspector python doc_mcp_server.py

示例:手动测试

# 向 stdin 发送 JSON-RPC 请求
{"jsonrpc":"2.0","id":1,"method":"tools/list"}

依赖

  • Python 3.7+
  • python-docx(可选,读取 .docx)
  • openpyxl(可选,读取 .xlsx)
  • PyMuPDF(可选,读取 .pdf)
  • python-pptx(可选,读取 .pptx)

许可证

MIT

快速设置
此服务器的安装指南

安装包 (如果需要)

uvx mcp-doc-server

Cursor 配置 (mcp.json)

{ "mcpServers": { "pycraft-ai-mcp-doc-server": { "command": "uvx", "args": [ "mcp-doc-server" ] } } }