Skip to main content
Docling provides an MCP (Model Context Protocol) server that enables seamless integration of document processing capabilities into AI agents and agentic applications.

Overview

The Model Context Protocol (MCP) is a standard for connecting AI applications to external tools. Docling’s MCP server allows AI agents to:
  • Process documents on-demand through a standard protocol
  • Extract text, tables, and structure from various document formats
  • Integrate document understanding into autonomous agent workflows
  • Work with any MCP-compatible client or framework

Installation

The Docling MCP server can be installed using uvx:
uvx --from=docling-mcp docling-mcp-server

Quick Start

Configuration

Add Docling MCP to your MCP client configuration:
{
  "mcpServers": {
    "docling": {
      "command": "uvx",
      "args": [
        "--from=docling-mcp",
        "docling-mcp-server"
      ]
    }
  }
}

Claude Desktop Integration

For Claude Desktop, edit your claude_desktop_config.json:
{
  "mcpServers": {
    "docling": {
      "command": "uvx",
      "args": [
        "--from=docling-mcp",
        "docling-mcp-server"
      ]
    }
  }
}
The config file is located at:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

LM Studio Integration

For LM Studio, edit the mcp.json file or click the button below: Add MCP Server docling to LM Studio

Supported Clients

Claude Desktop

Anthropic’s desktop AI assistant

LM Studio

Local LLM development environment

LlamaIndex

Data framework for LLM applications

Pydantic AI

Type-safe AI agent framework

Framework Integration

Docling MCP provides specialized tools for various frameworks:

LlamaIndex Agents

from llama_index.agent import Agent
from docling_mcp import DoclingMCPTool

# Create agent with Docling MCP tool
tool = DoclingMCPTool()
agent = Agent.from_tools([tool])

# Use the agent
response = agent.query(
    "Extract the key findings from report.pdf"
)
print(response)

Pydantic AI Agents

from pydantic_ai import Agent
from docling_mcp import DoclingMCPTool

# Create type-safe agent
agent = Agent(
    tools=[DoclingMCPTool()],
    model="openai:gpt-4"
)

# Process documents
result = agent.run(
    "Summarize the contents of document.pdf"
)

Llama Stack

from llama_stack import Agent
from docling_mcp import DoclingMCPTool

agent = Agent(
    tools=[DoclingMCPTool()]
)

response = agent.run(
    "What are the main topics in the presentation.pptx?"
)

smolagents

from smolagents import Agent
from docling_mcp import DoclingMCPTool

agent = Agent(
    tools=[DoclingMCPTool()],
    model="gpt-4"
)

result = agent.run(
    "Extract tables from financial_report.pdf"
)

Features

Standard Protocol

Implements MCP standard for broad compatibility

Framework Support

Works with LlamaIndex, Pydantic AI, and more

Document Processing

Full Docling capabilities via agent tools

Easy Setup

Simple configuration for any MCP client

Use Cases

1

Conversational Document Analysis

Enable AI assistants to read and analyze documents in conversations
2

Autonomous Research

Let agents autonomously process and extract information from documents
3

Document-Grounded Responses

Provide agents with document understanding for accurate responses
4

Multi-Step Workflows

Chain document processing with other agent capabilities

Example Agent Workflow

from pydantic_ai import Agent
from docling_mcp import DoclingMCPTool

# Create agent with document processing capability
agent = Agent(
    tools=[DoclingMCPTool()],
    model="openai:gpt-4",
    system_prompt="""You are a research assistant that can read and analyze documents.
    When asked about documents, use the Docling tool to extract their contents."""
)

# Multi-step workflow
workflow = """
1. Read the quarterly_report.pdf
2. Extract all financial tables
3. Summarize the key metrics
4. Compare with last quarter's results from q3_report.pdf
"""

result = agent.run(workflow)
print(result)

Advanced Configuration

Customize the MCP server configuration:
{
  "mcpServers": {
    "docling": {
      "command": "uvx",
      "args": [
        "--from=docling-mcp",
        "docling-mcp-server"
      ],
      "env": {
        "DOCLING_OCR": "true",
        "DOCLING_TABLE_STRUCTURE": "true"
      }
    }
  }
}

Resources

GitHub

Docling MCP repository

MCP Protocol

Model Context Protocol docs

Examples

Framework examples

Configuration

Example configurations

Supported Frameworks

Docling MCP includes examples for:
  • LlamaIndex - Data framework for LLM applications
  • Llama Stack - Comprehensive LLM development stack
  • Pydantic AI - Type-safe agent development
  • smolagents - Lightweight agent framework by Hugging Face
Visit the Docling MCP repository for detailed examples and integration guides.

Next Steps

Build docs developers (and LLMs) love