Skip to main content
Glama
Jasonzld

mcp-docparser

by Jasonzld
README.md
# 🚀 MCP Document Parser - Portable Edition

## 一键部署文档解析工具 for Claude Desktop & CLI

### 📥 快速安装

#### Windows
```batch
install.bat
```

#### macOS/Linux
```bash
chmod +x install.sh
./install.sh
```

### ✨ 功能特性

- 📄 **PDF** 文档解析
- 📝 **Word** (docx/doc) 提取
- 📊 **Excel** (xlsx/xls) 表格读取
- 🖼️ **图片OCR** (JPG/PNG/BMP等,支持中英文)
- 📑 **Markdown/HTML/CSV/JSON** 支持
- 🔍 文档分块处理
- 📋 元数据提取

### 💾 资源占用

| 对比项 | MCP Parser | RAGFlow |
|--------|------------|---------|
| 内存 | ~200MB | 4GB+ |
| CPU | <5% | 50-100% |
| 依赖 | Node.js | Docker+WSL2 |
| 启动 | 即时 | 2-3分钟 |

### 🔧 系统要求

- Node.js 16+ (安装器会自动安装)
- 支持系统: Windows/macOS/Linux
- Claude Desktop 或 Claude CLI

### 📦 包含文件

```
mcp-docparser-portable/
├── install.bat          # Windows安装器
├── install.sh          # macOS/Linux安装器
├── package.json        # 项目配置
├── server.js          # MCP服务器
└── README.md          # 本文档
```

### 🎯 使用方法

安装完成后,在Claude中使用以下MCP工具:

#### 1. 解析文档
```
使用MCP工具 parse_document 解析 "C:/path/to/document.pdf"
```

#### 2. 图片OCR
```
使用MCP工具 ocr_image 识别 "C:/path/to/image.jpg" 中的文字
```

#### 3. 提取文本
```
使用MCP工具 extract_text 从 "C:/path/to/document.docx" 提取文本
```

#### 4. 文档分块
```
使用MCP工具 chunk_document 将 "C:/path/to/large.pdf" 分成1000字符的块
```

#### 5. 获取文档信息
```
使用MCP工具 get_document_info 获取 "C:/path/to/file.xlsx" 的信息
```

### 🛠️ 手动配置

如果自动配置失败,手动添加到配置文件:

#### Claude Desktop (Windows)
路径: `%APPDATA%\Claude\claude_desktop_config.json`

#### Claude Desktop (macOS)
路径: `~/Library/Application Support/Claude/claude_desktop_config.json`

#### Claude CLI (所有平台)
路径: `~/.claude/claude_desktop_config.json`

配置内容:
```json
{
  "mcpServers": {
    "docparser": {
      "command": "node",
      "args": ["安装路径/server.js"]
    }
  }
}
```

### 🔍 故障排除

1. **Node.js未安装**
   - Windows: 安装器会自动下载安装
   - macOS: 使用 `brew install node`
   - Linux: 使用 `apt install nodejs` 或 `yum install nodejs`

2. **权限问题**
   - Windows: 以管理员身份运行
   - macOS/Linux: 使用 `sudo`

3. **Claude未识别MCP**
   - 重启Claude Desktop/CLI
   - 检查配置文件路径是否正确

### 📊 性能对比

| 功能 | 速度 | 准确率 |
|------|------|--------|
| PDF解析 | <1秒/页 | 99% |
| 图片OCR | 2-3秒/图 | 95%+ |
| Word提取 | <1秒 | 100% |
| Excel读取 | <2秒 | 100% |

### 🌟 优势

1. **轻量级** - 无需Docker/WSL2
2. **跨平台** - Windows/macOS/Linux通用
3. **易部署** - 一键安装脚本
4. **高性能** - 本地处理,无网络延迟
5. **全功能** - 支持所有常见文档格式

### 📝 许可

MIT License - 免费使用和分发

### 🤝 贡献

欢迎提交Issue和Pull Request

---

*让Claude拥有强大的文档处理能力,只需200MB内存!*

TDQS

B3.1/5.0

Scored across 7 tools

Disambiguation2/5

Multiple tools have overlapping purposes: parse_document, extract_text, and ocr_image all extract text from images/documents, with descriptions that are nearly indistinguishable. analyze_image also overlaps with get_document_info for image metadata, making it hard for an agent to choose the right tool.

Naming Consistency4/5

All tool names use snake_case and most follow a verb_noun pattern (e.g., analyze_image, chunk_document, get_document_info). batch_ocr and ocr_image deviate slightly by starting with a noun or acronym, but the overall convention is clear and readable.

Tool Count5/5

Seven tools is well-scoped for a document parsing server, providing distinct capabilities for parsing, OCR, text extraction, metadata, image analysis, and chunking without being overwhelming or thin.

Completeness4/5

The surface covers core document parsing tasks: parsing, text extraction, OCR (including batch and language support), metadata retrieval, image analysis, and chunking. Minor gaps exist, such as tools for output saving or format-specific handling, but agents can work around them.

Maintenance

ActivityInactive
ResponsivenessNo issues