Token导航 LogoToken导航TokenDH.com
Document Parser MCP logo
文档知识stdio官方级别未说明来源级核验

Document Parser MCP

MCP Server

一个智能文档解析和转换服务,支持多种文档格式(PDF、DOCX、图片、音频等)转换为Markdown格式,适用于AI处理和数据检索。

工具数

5

提示词数

0

GitHub Stars

2

资源数

0
多格式支持PythonClaude格式转换Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

kgand

提供方

kgand

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

文档解析器MCP

一种模型上下文协议(MCP)服务器,使用Docling工具包提供智能文档解析和转换功能。将任何文档(PDF、DOCX、图像、音频等)转换为干净的Markdown,用于AI处理和RAG管道。

特性

  • 通用文档支持:PDF、Office文档(DOCX/XLSX/PPTX)、图像、HTML、Markdown、音频文件等
  • 多条处理管道:

- 标准:通过先进的布局分析实现快速、高质量的转换 - VLM:用于复杂布局和手写内容的视觉语言模型 - ASR:用于音频转录的自动语音识别

  • 智能自动检测:根据文件类型自动选择最佳管道
  • 并发处理:内置作业队列,用于处理多个请求
  • MCP集成:与Claude Desktop和其他MCP客户端无缝集成
  • 清除Markdown输出:高质量的结构化文本,可供人工智能使用

安装

先决条件

  • Python 3.9或更高版本
  • 建议使用8GB+RAM

快速开始

  1. 克隆存储库:
git clone 
cd document-parser-mcp
  1. 创建虚拟环境:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. 安装依赖项:
pip install -r requirements.txt
  1. 安装带有可选功能的文档:
# Core Docling
pip install docling

# For Apple Silicon MLX acceleration
pip install docling[mlx]

# Optional OCR engines
pip install easyocr

用法

运行服务器

启动MCP服务器:

python -m document_parser

使用自定义配置:

python -m document_parser --config /path/to/config.yaml

使用调试日志记录:

python -m document_parser --debug

配置

服务器通过以下方式配置 config.yaml.按键设置:

server:
  name: document-parser-mcp
  max_concurrent_jobs: 3
  job_timeout_seconds: 600

processing:
  default_pipeline: standard
  enable_pipeline_auto_detect: true

  ocr:
    engine: easyocr
    languages: [eng]

  pdf:
    backend: dlparse_v4
    table_accuracy_mode: accurate

配置指南 查看详细选项。

MCP工具

服务器提供以下MCP工具:

parse_document

将任何文档解析为Markdown。

参数:

  • source (必填):文档的文件路径或URL
  • pipeline (可选):处理管道- standard, vlm,或 asr
  • options (可选):其他处理选项

例子:

{
  "name": "parse_document",
  "arguments": {
    "source": "https://arxiv.org/pdf/2408.09869",
    "pipeline": "standard"
  }
}

parse_document_advanced

具有详细配置的高级解析。

参数:

  • source (必填):文件路径或URL
  • pipeline (可选):处理管道
  • ocr_enabled (可选):启用/禁用OCR
  • table_accuracy_mode (可选): fastaccurate
  • pdf_backend (可选):PDF处理后端
  • enable_enrichments (可选):启用代码/公式丰富

get_job_status

获取处理作业的状态。

参数:

  • job_id (必填):作业标识符

list_supported_formats

列出所有支持的输入格式和管道。

get_queue_statistics

获取当前队列和处理统计信息。

与Claude Desktop集成

添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "document-parser": {
      "command": "python",
      "args": ["-m", "document_parser"],
      "cwd": "/path/to/document-parser-mcp"
    }
  }
}

重新启动Claude Desktop,文档解析器将作为工具可用。

管道选择指南

标准管道(默认)

  • 最适合:天生的数字PDF、Office文档、简洁的布局
  • 特性:高级布局分析、表格结构恢复、可选OCR
  • 演出:快速、内存高效

VLM管道

  • 最适合:复杂的布局、手写笔记、屏幕截图、扫描文档
  • 特性:视觉语言模型处理,端到端页面理解
  • 演出:较慢,MLX在Apple Silicon上加速

ASR管道

  • 最适合:音频文件(会议、讲座、访谈)
  • 特性:基于耳语的转录
  • 演出:CPU/GPU密集型

发展

运行测试

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

# Run with coverage
pytest --cov=document_parser

代码质量

# Format code
black document_parser tests

# Lint
ruff check document_parser tests

# Type checking
mypy document_parser

项目结构

document-parser-mcp/
├── document_parser/         # Main package
│   ├── config/             # Configuration system
│   ├── core/               # Core exceptions and types
│   ├── engine/             # Document processing engine
│   ├── mcp/                # MCP server implementation
│   ├── processing/         # Job queue and tracking
│   └── utils/              # Utility functions
├── tests/                  # Test suite
├── config.yaml            # Default configuration
├── requirements.txt       # Production dependencies
└── setup.py              # Package configuration

性能优化

内存管理

  • 配置 max_memory_gb 对于您的系统
  • max_concurrent_jobs 基于可用资源
  • 处理大文件时会自动清理

MLX加速(苹果硅)

  • 安装时使用 pip install docling[mlx]
  • 在配置中启用: enable_mlx_acceleration: true
  • 如果不可用,则自动回退到CPU

故障排除

常见问题

“ModuleNotFoundError:没有名为'docling'的模块”

pip install docling

队列已满错误

  • 等待当前作业完成
  • 增加 max_concurrent_jobs 在配置中

大文件内存错误

  • 减少 max_memory_gb 在配置中
  • 使用 pipeline: standard 而不是 vlm

OCR不工作

pip install easyocr
# Or for tesseract
brew install tesseract  # macOS

贡献

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 进行更改
  4. 添加新功能的测试
  5. 运行测试套件
  6. 提交您的更改(git commit -m 'Add amazing feature')
  7. 推到分支(git push origin feature/amazing-feature)
  8. 打开拉取请求

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

致谢

支持

目录标签

目录标签

多格式支持PythonClaude格式转换文档解析本地部署AI处理智能检测

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP