Docling MCP — Claude Code MCP server: PDF to structured JSON
Turns PDFs and other documents into structured JSON inside your agent. Useful when you need to parse a report or paper before feeding it further.
claude mcp add --env DOCLING_MCP_CONVERSION_MODE=<DOCLING_MCP_CONVERSION_MODE> --env DOCLING_MCP_SERVICE_URL=<DOCLING_MCP_SERVICE_URL> --env DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> --env DOCLING_MCP_SERVICE_TIMEOUT=<DOCLING_MCP_SERVICE_TIMEOUT> --env DOCLING_MCP_SERVICE_MAX_RETRIES=<DOCLING_MCP_SERVICE_MAX_RETRIES> --transport stdio docling-mcp -- uvx docling-mcpWhat Docling MCP does
Docling MCP wraps the Docling library into a set of tools that an MCP client can call. The main job is converting PDFs into structured JSON in the DoclingDocument format, plus generating documents that export to several formats. There is a local cache so the same file is not processed twice, and sources can be local paths or URLs.
Three modes are available. Remote talks to an external Docling Serve over a URL and API key, local does everything on your machine, hybrid tries the remote service and falls back to local when it is unreachable. The mode is set by DOCLING_MCP_CONVERSION_MODE, and the default is remote — so without DOCLING_MCP_SERVICE_URL and DOCLING_MCP_SERVICE_API_KEY the server will not start. For local mode install the package with the local extra.
One flag worth knowing: DOCLING_MCP_DO_PICTURE_DESCRIPTION turns on a vision-language model that describes every figure, and on a laptop running it on CPU that can slow conversion down a lot. If you hit timeouts, raise DOCLING_MCP_SERVICE_TIMEOUT — the default is 300.0 seconds. Your MCP client may also cut the request short, so check its own timeout setting.
What it helps with
- pull text and tables out of a PDF into structured JSON
- hand the agent a local file or a document URL
- build a DoclingDocument and export it to another format
- upload parsed documents to Milvus for RAG
- skip reprocessing the same file thanks to caching
Example prompts for the agent
- Convert
report.pdfto a DoclingDocument and show me the table structure - Fetch the document at this URL and export it as markdown
- Build a DoclingDocument from this data and export it to JSON
How to install Docling MCP
Platform CLI
claude mcp add --env DOCLING_MCP_CONVERSION_MODE=<DOCLING_MCP_CONVERSION_MODE> --env DOCLING_MCP_SERVICE_URL=<DOCLING_MCP_SERVICE_URL> --env DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> --env DOCLING_MCP_SERVICE_TIMEOUT=<DOCLING_MCP_SERVICE_TIMEOUT> --env DOCLING_MCP_SERVICE_MAX_RETRIES=<DOCLING_MCP_SERVICE_MAX_RETRIES> --transport stdio docling-mcp -- uvx docling-mcpReplace <…> with your own values. 9 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from docling-mcp <command>
Platform CLI
codex mcp add docling-mcp --env DOCLING_MCP_CONVERSION_MODE=<DOCLING_MCP_CONVERSION_MODE> --env DOCLING_MCP_SERVICE_URL=<DOCLING_MCP_SERVICE_URL> --env DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> --env DOCLING_MCP_SERVICE_TIMEOUT=<DOCLING_MCP_SERVICE_TIMEOUT> --env DOCLING_MCP_SERVICE_MAX_RETRIES=<DOCLING_MCP_SERVICE_MAX_RETRIES> -- uvx docling-mcpReplace <…> with your own values. 9 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from docling-mcp <command>
Config file
{
"mcpServers": {
"docling-mcp": {
"command": "uvx",
"args": [
"docling-mcp"
],
"env": {
"DOCLING_MCP_CONVERSION_MODE": "<DOCLING_MCP_CONVERSION_MODE>",
"DOCLING_MCP_SERVICE_URL": "<DOCLING_MCP_SERVICE_URL>",
"DOCLING_MCP_SERVICE_API_KEY": "<DOCLING_MCP_SERVICE_API_KEY>",
"DOCLING_MCP_SERVICE_TIMEOUT": "<DOCLING_MCP_SERVICE_TIMEOUT>",
"DOCLING_MCP_SERVICE_MAX_RETRIES": "<DOCLING_MCP_SERVICE_MAX_RETRIES>"
}
}
}
}Replace <…> with your own values. 9 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from docling-mcp <command>
Config file
{
"servers": {
"docling-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"docling-mcp"
],
"env": {
"DOCLING_MCP_CONVERSION_MODE": "<DOCLING_MCP_CONVERSION_MODE>",
"DOCLING_MCP_SERVICE_URL": "<DOCLING_MCP_SERVICE_URL>",
"DOCLING_MCP_SERVICE_API_KEY": "<DOCLING_MCP_SERVICE_API_KEY>",
"DOCLING_MCP_SERVICE_TIMEOUT": "<DOCLING_MCP_SERVICE_TIMEOUT>",
"DOCLING_MCP_SERVICE_MAX_RETRIES": "<DOCLING_MCP_SERVICE_MAX_RETRIES>"
}
}
}
}Replace <…> with your own values. 9 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from docling-mcp <command>
Platform CLI
gemini mcp add -e DOCLING_MCP_CONVERSION_MODE=<DOCLING_MCP_CONVERSION_MODE> -e DOCLING_MCP_SERVICE_URL=<DOCLING_MCP_SERVICE_URL> -e DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> -e DOCLING_MCP_SERVICE_TIMEOUT=<DOCLING_MCP_SERVICE_TIMEOUT> -e DOCLING_MCP_SERVICE_MAX_RETRIES=<DOCLING_MCP_SERVICE_MAX_RETRIES> docling-mcp uvx docling-mcpReplace <…> with your own values. 9 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from docling-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Docling MCP
How do I install Docling MCP in Claude?
Run claude mcp add docling-mcp -e DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> -- uvx docling-mcp. For the full set of variables use `claude mcp add --env DOCLING_MCP_CONVERSION_MODE=<DOCLING_MCP_CONVERSION_MODE> --env DOCLING_MCP_SERVICE_URL=<DOCLING_MCP_SERVICE_URL> --env DOCLING_MCP_SERVICE_API_KEY=<DOCLING_MCP_SERVICE_API_KEY> --env DOCLING_MCP_SERVICE_TIMEOUT=<DOCLING_MCP_SERVICE_TIMEOUT> --env DOCLING_MCP_SERVICE_MAX_RETRIES=<DOCLING_MCP_SERVICE_MAX_RETRIES> --transport stdio docling-mcp -- uvx docling-mcp`.
What does Docling MCP do?
It gives your agent tools to convert PDFs into structured JSON and to generate documents. Output can be exported to several formats, and parsed data can be pushed to Milvus.
What do I need for remote mode?
A Docling Serve URL and an API key, set as DOCLING_MCP_SERVICE_URL and DOCLING_MCP_SERVICE_API_KEY. Without them remote mode, which is the default, will not run.