AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Doc Mcp Server

mcp-willhuo-doc-mcp-server · by willhuo

doc-mcp-server

No reviews yet
0 installs
39 views
0.0% view→install

Install

$ agentstack add mcp-willhuo-doc-mcp-server

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-willhuo-doc-mcp-server)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Doc Mcp Server? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

doc-mcp-server

项目概述

doc-mcp-server 是一个基于 MCP (Model Context Protocol) 的文档读取服务,专为解决 trae 读取各种文档格式而创建。该服务提供了统一的接口,支持读取 Word、Excel、PowerPoint、PDF 文档以及图片 OCR 识别,确保 trae 能够正确处理和分析各种格式的文档内容。

核心功能

  • Word 文档读取:支持读取 .docx 格式文档内容
  • Excel 表格读取:支持读取 .xlsx 格式表格数据
  • PowerPoint 读取:支持读取 .pptx 格式演示文稿内容
  • PDF 文档读取:支持提取 PDF 文档中的文本内容
  • 图片 OCR 识别:支持识别图片中的文字内容

技术栈

  • 后端语言:Python 3.11
  • 核心框架:MCP (Model Context Protocol)
  • 文档处理库
  • python-docx (Word 处理)
  • pandas + openpyxl (Excel 处理)
  • python-pptx (PowerPoint 处理)
  • pdfplumber (PDF 处理)
  • pytesseract + Pillow (OCR 处理)
  • 容器化:Docker + docker-compose

环境要求

  • Python 3.11+ (直接运行)
  • Docker (容器化部署)
  • tesseract-ocr (OCR 功能需要)

安装与部署

方法一:直接运行

  1. 克隆项目到本地
  2. 进入 src 目录
  3. 安装依赖:

``bash pip install -r requirements.txt ``

  1. 安装 tesseract-ocr(OCR 功能需要):
  • Windows: 下载并安装 tesseract-ocr
  • Ubuntu/Debian: apt-get install tesseract-ocr
  • macOS: brew install tesseract
  1. 启动服务:

``bash python server.py ``

方法二:Docker 部署

  1. 克隆项目到本地
  2. 进入 src 目录
  3. 构建并启动容器:

``bash docker-compose up -d ``

项目结构

doc-mcp-server/
├── src/
│   ├── Dockerfile          # Docker 构建文件
│   ├── docker-compose.yml  # Docker 编排配置
│   ├── requirements.txt    # Python 依赖项
│   └── server.py           # 主服务代码
├── LICENSE                 # 许可证文件
└── README.md               # 项目文档

使用方法

调用 MCP 服务

服务启动后,可以通过 MCP 协议调用以下工具:

  1. 读取 Word 文档
  • 工具名:read_word
  • 参数:file_bytes (bytes) - Word 文档的二进制数据
  • 返回:文档文本内容
  1. 读取 PDF 文档
  • 工具名:read_pdf
  • 参数:file_bytes (bytes) - PDF 文档的二进制数据
  • 返回:文档文本内容
  1. 读取 Excel 表格
  • 工具名:read_excel
  • 参数:file_bytes (bytes) - Excel 文档的二进制数据
  • 返回:表格数据的字符串表示
  1. 读取 PowerPoint 演示文稿
  • 工具名:read_ppt
  • 参数:file_bytes (bytes) - PowerPoint 文档的二进制数据
  • 返回:演示文稿文本内容
  1. 图片 OCR 识别
  • 工具名:ocr_image
  • 参数:file_bytes (bytes) - 图片的二进制数据
  • 返回:识别的文本内容

示例代码

# 示例:使用 MCP 客户端调用 read_word 工具
from mcp.client import MCPClient

client = MCPClient("http://localhost:8000")

# 读取本地 Word 文档
with open("example.docx", "rb") as f:
    file_bytes = f.read()

result = client.call("read_word", file_bytes=file_bytes)
print(result)

配置说明

Docker 配置

  • Dockerfile:基于 Python 3.11-slim 镜像,安装 tesseract-ocr 和项目依赖
  • docker-compose.yml:定义了 doc-mcp 服务,设置为自动重启

依赖项配置

项目依赖项在 requirements.txt 文件中定义,包括:

  • mcp
  • python-docx
  • pandas
  • openpyxl
  • python-pptx
  • pdfplumber
  • pytesseract
  • pillow

本地 MCP 配置

在本地开发和测试环境中,可以使用以下 MCP 配置信息:

{
  "mcpServers": {
    "document-reader": {
      "command": "C:\\ProgramData\\anaconda3\\envs\\docmcp\\python.exe",
      "args": [
        "C:\\codes\\doc-mcp-server\\src\\server.py"
      ]
    }
  }
}

此配置适用于本地开发和测试环境,使用 Anaconda 环境中的 Python 解释器运行服务。确保路径引用准确无误,根据实际安装位置进行调整。

常见问题解答

  1. OCR 功能无法使用
  • 确保已安装 tesseract-ocr
  • Docker 部署已自动安装 tesseract-ocr
  1. 服务启动失败
  • 检查 Python 版本是否为 3.11+
  • 检查依赖项是否正确安装
  1. 文档读取失败
  • 确保文档格式正确
  • 检查文件大小是否合理

贡献指南

欢迎提交 Issue 和 Pull Request 来改进这个项目。贡献前请确保:

  1. 代码风格一致
  2. 添加必要的测试
  3. 更新相关文档

维护者

  • [willhuo] - [willhuo@outlook.com](mailto:willhuo@outlook.com)

许可证

[MIT License](LICENSE)

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.