MCP Server Integration#
Model Context Protocol (MCP) is the standard Docling uses to expose document processing capabilities to AI agents and LLM clients. The implementation lives in the dedicated docling-mcp package (currently v2.1.0), which is a core runtime dependency of docling-serve .
Architecture and Installation Modes#
Docling MCP v2.0 introduced a hybrid architecture with three installation profiles :
| Mode | Install | When to use |
|---|---|---|
| Remote (default) | pip install docling-mcp | Access to a Docling Serve API; ~50 MB, no model downloads |
| Local | pip install docling-mcp[local] | Offline or no Docling Serve available; full model stack |
| Hybrid | pip install docling-mcp[local] + DOCLING_FALLBACK_TO_LOCAL=true | Remote preferred, automatic local fallback |
For remote/hybrid modes, set these environment variables :
export DOCLING_SERVICE_URL=https://your-docling-service.example.com
export DOCLING_SERVICE_API_KEY=your-api-key # if required
export DOCLING_CONVERSION_MODE=remote
Transport Protocols#
The docling-mcp-server CLI supports three transports :
stdio— for Claude Desktop and LM Studio (default for local client installs)sse— for Llama Stack integrationsstreamable-http— for containerized/remote deployments
MCP Client Configuration#
The fastest way to wire up any MCP-compatible client is via uvx :
{
"mcpServers": {
"docling": {
"command": "uvx",
"args": ["--from=docling-mcp", "docling-mcp-server"]
}
}
}
For Claude Desktop, edit claude_desktop_config.json with the snippet above. For LM Studio, edit mcp.json. Example configs are in docs/integrations/.
Container Deployment via docling-serve#
The docling-serve container image (quay.io/docling-project/docling-serve) bundles the docling-mcp-server executable starting from v1.1.0 . By default, the container runs docling-serve run on port 5001. To launch the MCP server instead, override the entrypoint :
podman run -p 8000:8000 quay.io/docling-project/docling-serve \
-- docling-mcp-server --transport streamable-http --port 8000 --host 0.0.0.0
The MCP endpoint is then available at http://localhost:8000/mcp. Clients connect to it via :
{
"mcpServers": {
"docling": { "url": "http://localhost:8000/mcp" }
}
}
Exposed Tools#
The MCP server exposes tools for :
- Conversion — PDF →
DoclingDocument(structured JSON) - Generation — create
DoclingDocumentobjects exportable to multiple formats - RAG — Milvus upload and retrieval integration
Framework-specific examples using LlamaIndex, Llama Stack, Pydantic AI, and smolagents are in the examples/ directory .
Key References#
docling-mcprepository — source, examples, migration guide- docling MCP usage docs — client setup, remote API mode, env vars
- docling-serve MCP docs — container entrypoint override, port mapping
- docling-serve
pyproject.toml—docling-mcp>=1.0.0dependency pin