Document Parser MCP
An MCP server that uses the Docling toolkit to convert various document formats, including PDFs, Office files, images, and audio, into clean Markdown for AI processing. It supports multiple processing pipelines like VLM and ASR with intelligent auto-detection and job queue management.
README
Document Parser MCP
A Model Context Protocol (MCP) server that provides intelligent document parsing and conversion capabilities using the Docling toolkit. Convert any document (PDF, DOCX, images, audio, etc.) into clean Markdown for AI processing and RAG pipelines.
Features
- Universal Document Support: PDFs, Office documents (DOCX/XLSX/PPTX), images, HTML, Markdown, audio files, and more
- Multiple Processing Pipelines:
- Standard: Fast, high-quality conversion with advanced layout analysis
- VLM: Vision-language models for complex layouts and handwritten content
- ASR: Automatic speech recognition for audio transcription
- Intelligent Auto-Detection: Automatically selects optimal pipeline based on file type
- Concurrent Processing: Built-in job queue for handling multiple requests
- MCP Integration: Seamless integration with Claude Desktop and other MCP clients
- Clean Markdown Output: High-quality structured text ready for AI consumption
Installation
Prerequisites
- Python 3.9 or higher
- 8GB+ RAM recommended
Quick Start
- Clone the repository:
git clone <repository-url>
cd document-parser-mcp
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Install Docling with optional features:
# Core Docling
pip install docling
# For Apple Silicon MLX acceleration
pip install docling[mlx]
# Optional OCR engines
pip install easyocr
Usage
Running the Server
Start the MCP server:
python -m document_parser
With custom configuration:
python -m document_parser --config /path/to/config.yaml
With debug logging:
python -m document_parser --debug
Configuration
The server is configured via config.yaml. Key settings:
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
See Configuration Guide for detailed options.
MCP Tools
The server provides the following MCP tools:
parse_document
Parse any document to Markdown.
Parameters:
source(required): File path or URL to the documentpipeline(optional): Processing pipeline -standard,vlm, orasroptions(optional): Additional processing options
Example:
{
"name": "parse_document",
"arguments": {
"source": "https://arxiv.org/pdf/2408.09869",
"pipeline": "standard"
}
}
parse_document_advanced
Advanced parsing with detailed configuration.
Parameters:
source(required): File path or URLpipeline(optional): Processing pipelineocr_enabled(optional): Enable/disable OCRtable_accuracy_mode(optional):fastoraccuratepdf_backend(optional): PDF processing backendenable_enrichments(optional): Enable code/formula enrichments
get_job_status
Get the status of a processing job.
Parameters:
job_id(required): Job identifier
list_supported_formats
List all supported input formats and pipelines.
get_queue_statistics
Get current queue and processing statistics.
Integration with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"document-parser": {
"command": "python",
"args": ["-m", "document_parser"],
"cwd": "/path/to/document-parser-mcp"
}
}
}
Restart Claude Desktop and the document parser will be available as a tool.
Pipeline Selection Guide
Standard Pipeline (Default)
- Best for: Born-digital PDFs, Office documents, clean layouts
- Features: Advanced layout analysis, table structure recovery, optional OCR
- Performance: Fast, memory-efficient
VLM Pipeline
- Best for: Complex layouts, handwritten notes, screenshots, scanned documents
- Features: Vision-language model processing, end-to-end page understanding
- Performance: Slower, MLX-accelerated on Apple Silicon
ASR Pipeline
- Best for: Audio files (meetings, lectures, interviews)
- Features: Whisper-based transcription
- Performance: CPU/GPU intensive
Development
Running Tests
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Run with coverage
pytest --cov=document_parser
Code Quality
# Format code
black document_parser tests
# Lint
ruff check document_parser tests
# Type checking
mypy document_parser
Project Structure
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
Performance Optimization
Memory Management
- Configure
max_memory_gbfor your system - Set
max_concurrent_jobsbased on available resources - Large files are processed with automatic cleanup
MLX Acceleration (Apple Silicon)
- Install with
pip install docling[mlx] - Enable in config:
enable_mlx_acceleration: true - Automatic fallback to CPU if unavailable
Troubleshooting
Common Issues
"ModuleNotFoundError: No module named 'docling'"
pip install docling
Queue is full errors
- Wait for current jobs to complete
- Increase
max_concurrent_jobsin config
Memory errors with large files
- Reduce
max_memory_gbin config - Use
pipeline: standardinstead ofvlm
OCR not working
pip install easyocr
# Or for tesseract
brew install tesseract # macOS
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Run the test suite
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - see LICENSE file for details.
Acknowledgments
- Built with Docling - an amazing document understanding toolkit
- Uses the Model Context Protocol for AI integration
Support
- Issues: GitHub Issues
- Documentation: Full Documentation
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。