Document Parser MCP

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.

Category
Visit Server

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

  1. Clone the repository:
git clone <repository-url>
cd document-parser-mcp
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. 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 document
  • pipeline (optional): Processing pipeline - standard, vlm, or asr
  • options (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 URL
  • pipeline (optional): Processing pipeline
  • ocr_enabled (optional): Enable/disable OCR
  • table_accuracy_mode (optional): fast or accurate
  • pdf_backend (optional): PDF processing backend
  • enable_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_gb for your system
  • Set max_concurrent_jobs based 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_jobs in config

Memory errors with large files

  • Reduce max_memory_gb in config
  • Use pipeline: standard instead of vlm

OCR not working

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

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

License

MIT License - see LICENSE file for details.

Acknowledgments

Support

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured