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
uvxinstalled - 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-serverThis 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 UIUse 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:
- Quit Claude Desktop completely
- Relaunch the application
- 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.18481Convert and analyze:
Please convert this document and summarize the key findings:
https://example.com/research-paper.pdfExtract specific information:
Convert this PDF and extract all the tables:
https://example.com/financial-report.pdfHow It Works
- Claude receives your request
- Claude calls the Docling MCP server
- The server converts the document using your Docling API
- Claude receives the converted content
- 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:
- Install the Docling MCP server
- Set environment variables
- Configure the client to use the server
- 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
uvxis 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
- Never commit credentials - Keep API keys out of version control
- Use environment variables - Store credentials securely
- Rotate keys regularly - Update API keys periodically
- Monitor usage - Track API calls through the Product UI
- 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.pdfDocument Q&A
Ask questions about complex documents:
What are the key terms and conditions in this contract?
https://example.com/contract.pdfData Extraction
Extract structured data from documents:
Extract all financial figures from this annual report and create a summary table:
https://example.com/annual-report.pdfNext Steps
- Explore the Docling MCP GitHub repository
- Learn about Agentic Workflows
- Check out RAG Applications
- Review the API Reference for advanced options