MCP
Use Docling with AI agents via Model Context Protocol
Docling MCP
Docling MCP enables AI agents and clients to use Docling's document processing capabilities through the Model Context Protocol. This allows applications like Claude Desktop, LM Studio, and other MCP clients to convert, process, and generate documents directly.
Prerequisites
Before using Docling MCP, you need access to a Docling Service instance:
- Service URL: Your Docling Serve API endpoint (e.g.,
https://your-docling-service.example.com) - API Key: Authentication token for the service
What is Docling MCP?
Docling MCP is a Model Context Protocol server that exposes Docling's capabilities as tools that AI agents can invoke. It supports:
- Document Conversion: Convert PDFs to structured JSON format (DoclingDocument)
- Document Generation: Create new documents with titles, sections, paragraphs, and lists
- Multiple Formats: Export to Markdown, JSON, and other formats
- Local Caching: Improves performance for repeated document access
- RAG Applications: Integration with vector databases for retrieval-augmented generation
Installation Modes
Remote Mode (Recommended)
Lightweight installation that connects to your Docling Service:
pip install docling-mcpConfigure environment:
export DOCLING_MCP_SERVICE_URL=https://your-docling-service.example.com
export DOCLING_MCP_SERVICE_API_KEY=your-api-key-here
export DOCLING_MCP_CONVERSION_MODE=remoteLocal Mode
For users without Docling Service access (processes documents locally):
pip install docling-mcp[local]Configure environment:
export DOCLING_MCP_CONVERSION_MODE=localHybrid Mode
Remote with automatic fallback to local processing:
pip install docling-mcp[local]Configure:
export DOCLING_MCP_SERVICE_URL=https://your-docling-service.example.com
export DOCLING_MCP_SERVICE_API_KEY=your-api-key-here
export DOCLING_MCP_CONVERSION_MODE=remote
export DOCLING_MCP_FALLBACK_TO_LOCAL=trueQuick Start
The easiest way to use Docling MCP is via uvx:
# For stdio transport (Claude Desktop, LM Studio)
uvx --from docling-mcp docling-mcp-server --transport stdio
# For SSE transport (Llama Stack)
uvx --from docling-mcp docling-mcp-server --transport sse
# For HTTP transport (containerized setups)
uvx --from docling-mcp docling-mcp-server --transport streamable-httpClient Integration
{
"mcpServers": {
"docling": {
"command": "uvx",
"args": [
"--from=docling-mcp",
"docling-mcp-server"
],
"env": {
"DOCLING_MCP_CONVERSION_MODE": "remote",
"DOCLING_MCP_SERVICE_URL": "https://your-docling-service.example.com",
"DOCLING_MCP_SERVICE_API_KEY": "your-api-key-here"
}
}
}
}Add this configuration to claude_desktop_config.json for Claude Desktop or mcp.json for LM Studio. For LM Studio, you can also use the direct install button:
Configuration
All settings use the DOCLING_MCP_ prefix and can be supplied as environment variables, in a .env file in the working directory, or via the env block of your MCP client config:
| Variable | Default | Description |
|---|---|---|
DOCLING_MCP_CONVERSION_MODE | remote | remote or local |
DOCLING_MCP_SERVICE_URL | — | Docling Service endpoint (required for remote mode) |
DOCLING_MCP_SERVICE_API_KEY | — | API key (required for remote mode) |
DOCLING_MCP_SERVICE_TIMEOUT | 300.0 | Request timeout in seconds |
DOCLING_MCP_FALLBACK_TO_LOCAL | false | Fall back to local if service unavailable |
DOCLING_MCP_KEEP_IMAGES | false | Retain page images in output |
DOCLING_MCP_DO_OCR | true | Enable OCR pipeline |
DOCLING_MCP_DO_TABLE_STRUCTURE | true | Detect table structure |
Full configuration reference available in the Docling MCP repository.
Example Usage
Here are some example prompts to get you going:
Converting Documents
Convert the PDF document at /path/to/document.pdf into DoclingDocument and return its document-key.Generating Documents
Create a new document about AI tokenizers. Add a title, then add sections with headings and paragraphs. Include a bulleted list of key concepts. Export to Markdown when done.RAG Applications
Convert this research paper to DoclingDocument, chunk it, and upload to the vector database for retrieval.Resources
- GitHub: github.com/docling-project/docling-mcp
- PyPI: pypi.org/project/docling-mcp
- MCP Registry: registry.modelcontextprotocol.io