DoclingDocling for IBM watsonx
This is a preview with content being developed and subject to changes. Rely on theofficial announcement and documentationabout the Docling for IBM watsonx product.
Cookbook

MCP Integration

Integrate Docling with Claude Desktop and other MCP clients

MCP Integration

This page is not accurate! Each item needs to be validated.

Learn how to integrate Docling for IBM watsonx with the Model Context Protocol (MCP) for use with Claude Desktop and other MCP-compatible clients.

Overview

The Model Context Protocol (MCP) is an open protocol that enables AI applications to securely access external data sources and tools. The Docling MCP server allows Claude and other MCP clients to convert documents on-demand during conversations.

What You'll Build

  • Set up the Docling MCP server
  • Configure Claude Desktop to use Docling
  • Convert documents directly from Claude conversations
  • Integrate with other MCP-compatible clients

Prerequisites

  • Docling for IBM watsonx account with Service URL and API Key
  • Claude Desktop app (for Claude integration)
  • Python 3.8+ with uvx installed
  • Basic understanding of environment variables

Installation

Install the Docling MCP Server

The easiest way to install the Docling MCP server is using uvx:

uvx --from=docling-mcp docling-mcp-server

This will install the server from the docling-mcp package.

Set Environment Variables

The Docling MCP server requires two environment variables:

export DOCLING_SERVICE_URL="your-service-url"  # From Product UI
export DOCLING_SERVICE_API_KEY="your-api-key"  # From Product UI

Use your actual Service URL and API key from the Product UI.

Claude Desktop Configuration

Step 1: Locate Configuration File

Find your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Step 2: Add Docling Server

Edit the configuration file to add the Docling MCP server:

{
  "mcpServers": {
    "docling": {
      "command": "uvx",
      "args": [
        "--from=docling-mcp",
        "docling-mcp-server"
      ],
      "env": {
        "DOCLING_SERVICE_URL": "your-service-url",
        "DOCLING_SERVICE_API_KEY": "your-api-key"
      }
    }
  }
}

You can add multiple MCP servers to the configuration. Each server gets its own key under mcpServers.

Step 3: Restart Claude Desktop

After saving the configuration:

  1. Quit Claude Desktop completely
  2. Relaunch the application
  3. The Docling server will be available in new conversations

Using Docling in Claude

Once configured, you can ask Claude to convert documents:

Example Prompts

Convert a PDF from URL:

Can you convert this PDF for me? https://arxiv.org/pdf/2311.18481

Convert and analyze:

Please convert this document and summarize the key findings:
https://example.com/research-paper.pdf

Extract specific information:

Convert this PDF and extract all the tables:
https://example.com/financial-report.pdf

How It Works

  1. Claude receives your request
  2. Claude calls the Docling MCP server
  3. The server converts the document using your Docling API
  4. Claude receives the converted content
  5. Claude processes and responds with the information

Advanced Configuration

Custom Conversion Options

You can configure default conversion options in the MCP server:

{
  "mcpServers": {
    "docling": {
      "command": "uvx",
      "args": [
        "--from=docling-mcp",
        "docling-mcp-server"
      ],
      "env": {
        "DOCLING_SERVICE_URL": "your-service-url",
        "DOCLING_SERVICE_API_KEY": "your-api-key",
        "DOCLING_OUTPUT_FORMAT": "markdown",
        "DOCLING_LOW_LATENCY": "true"
      }
    }
  }
}

Multiple Instances

You can configure multiple Docling instances for different use cases:

{
  "mcpServers": {
    "docling-production": {
      "command": "uvx",
      "args": ["--from=docling-mcp", "docling-mcp-server"],
      "env": {
        "DOCLING_SERVICE_URL": "your-production-service-url",
        "DOCLING_SERVICE_API_KEY": "your-production-api-key"
      }
    },
    "docling-development": {
      "command": "uvx",
      "args": ["--from=docling-mcp", "docling-mcp-server"],
      "env": {
        "DOCLING_SERVICE_URL": "your-development-service-url",
        "DOCLING_SERVICE_API_KEY": "your-development-api-key"
      }
    }
  }
}

Other MCP Clients

The Docling MCP server works with any MCP-compatible client. Configuration steps are similar:

  1. Install the Docling MCP server
  2. Set environment variables
  3. Configure the client to use the server
  4. Restart the client

Refer to your MCP client's documentation for specific configuration instructions.

Troubleshooting

Server Not Starting

Problem: Claude can't connect to the Docling server

Solutions:

  • Verify uvx is installed: uvx --version
  • Check environment variables are set correctly
  • Ensure your API key is valid
  • Review Claude Desktop logs for error messages

Conversion Failures

Problem: Documents fail to convert

Solutions:

  • Verify your Service URL is correct
  • Check your API key has not expired
  • Ensure the document URL is accessible
  • Try converting the document directly via API to isolate the issue

Performance Issues

Problem: Conversions are slow

Solutions:

  • Enable low-latency mode: "DOCLING_LOW_LATENCY": "true"
  • Check your network connection
  • Verify your Docling plan supports your usage level

Security Best Practices

  1. Never commit credentials - Keep API keys out of version control
  2. Use environment variables - Store credentials securely
  3. Rotate keys regularly - Update API keys periodically
  4. Monitor usage - Track API calls through the Product UI
  5. Limit access - Only share credentials with authorized users

Example Use Cases

Research Assistant

Configure Claude with Docling to analyze research papers:

Analyze these three papers and compare their methodologies:
1. https://arxiv.org/pdf/paper1.pdf
2. https://arxiv.org/pdf/paper2.pdf
3. https://arxiv.org/pdf/paper3.pdf

Document Q&A

Ask questions about complex documents:

What are the key terms and conditions in this contract?
https://example.com/contract.pdf

Data Extraction

Extract structured data from documents:

Extract all financial figures from this annual report and create a summary table:
https://example.com/annual-report.pdf

Next Steps

Resources

On this page