# Docling MCP

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 777
- Author: docling-project
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/docling-project/docling-mcp
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/docling-mcp

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `DOCLING_MCP_CONVERSION_MODE`, `DOCLING_MCP_SERVICE_URL`, `DOCLING_MCP_SERVICE_API_KEY`, `DOCLING_MCP_SERVICE_TIMEOUT`, `DOCLING_MCP_SERVICE_MAX_RETRIES`, `DOCLING_MCP_FALLBACK_TO_LOCAL`, `DOCLING_MCP_KEEP_IMAGES`, `DOCLING_MCP_IMAGES_SCALE`, `DOCLING_MCP_DO_OCR`, `DOCLING_MCP_DO_TABLE_STRUCTURE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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
```
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>

### Codex

**Platform CLI**
```bash
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-mcp
```
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>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
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-mcp
```
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>

## When to use it
- 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
- Convert `report.pdf` to 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

## Similar
- [markitdown](https://affpapa.org/en/nevibecode/skills/julianobarbosa-markitdown.md) — skill · 1600 installs
- [doc-to-markdown](https://affpapa.org/en/nevibecode/skills/doc-to-markdown.md) — skill · 872 installs
- [haiku.rag](https://affpapa.org/en/nevibecode/mcp/haikurag.md) — MCP server · ★ 635
- [pandoc](https://affpapa.org/en/nevibecode/skills/pandoc.md) — skill · 484 installs
- [convert-pdf-to-md](https://affpapa.org/en/nevibecode/skills/convert-pdf-to-md.md) — skill · 138 installs
- [liteparse](https://affpapa.org/en/nevibecode/skills/k-dense-ai-liteparse.md) — skill · 1400 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
