{
  "markdown": "<p align=\"center\">\n  <a href=\"https://github.com/docling-project/docling-mcp\">\n    <img loading=\"lazy\" alt=\"Docling\" src=\"https://github.com/docling-project/docling-mcp/raw/main/docs/assets/docling_mcp.png\" width=\"40%\"/>\n  </a>\n</p>\n\n# Docling MCP: making docling agentic\n\n[![CI](https://github.com/docling-project/docling-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/docling-project/docling-mcp/actions/workflows/ci.yml)\n[![PyPI version](https://img.shields.io/pypi/v/docling-mcp)](https://pypi.org/project/docling-mcp/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/docling-mcp)](https://pypi.org/project/docling-mcp/)\n[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![License MIT](https://img.shields.io/github/license/docling-project/docling-mcp)](https://opensource.org/licenses/MIT)\n[![PyPI Downloads](https://static.pepy.tech/badge/docling-mcp/month)](https://pepy.tech/projects/docling-mcp)\n[![LF AI & Data](https://img.shields.io/badge/LF%20AI%20%26%20Data-003778?logo=linuxfoundation&logoColor=fff&color=0094ff&labelColor=003778)](https://lfaidata.foundation/projects/)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-green?logo=modelcontextprotocol)](https://registry.modelcontextprotocol.io)\n[![docling-mcp MCP server](https://glama.ai/mcp/servers/docling-project/docling-mcp/badges/score.svg)](https://glama.ai/mcp/servers/docling-project/docling-mcp)\n[![MCP Toplist](https://mcptoplist.com/badge/io.github.docling-project%2Fdocling-mcp.svg)](https://mcptoplist.com/server/io.github.docling-project%2Fdocling-mcp)\n\nA document processing service using the Docling-MCP library and MCP (Model Context Protocol) for tool integration.\n\n\n## Overview\n\n[Docling](https://github.com/docling-project/docling) MCP is a service that provides tools for document conversion, processing and generation. It uses the Docling library to convert PDF documents into structured formats and provides a caching mechanism to improve performance. The service exposes functionality through a set of tools that can be called by client applications.\n\n## Compatibility\n\n| docling-mcp | MCP Python SDK |\n|---|---|\n| `>=3.0.0` | `mcp>=2.0.0` |\n| `>=2.0.0,<3.0.0` | `mcp>=1.9.4,<2.0.0` |\n\nIf your MCP client application has not yet migrated to MCP SDK v2, pin:\n\n```bash\npip install \"docling-mcp<3.0.0\"\n```\n\nSee [MIGRATION.md](MIGRATION.md) for the full migration guide.\n\n## Installation Options\n\n### Remote Mode (Recommended - Lightweight)\n\nFor users with access to Docling Serve API:\n\n> **Getting Docling Serve**: Visit [docling-serve](https://github.com/docling-project/docling-serve) for installation guides. You can deploy it from published container images or look for managed Docling SaaS offerings.\n\n```bash\npip install docling-mcp\n```\n\nThen configure your environment:\n```bash\nexport DOCLING_MCP_SERVICE_URL=https://your-docling-service.example.com\nexport DOCLING_MCP_SERVICE_API_KEY=your-api-key-here\nexport DOCLING_MCP_CONVERSION_MODE=remote\n```\n\n### Local Mode (Full Features)\n\nFor users who need local conversion or don't have Docling Serve access:\n\n```bash\npip install docling-mcp[local]\n```\n\nThen configure your environment:\n```bash\nexport DOCLING_MCP_CONVERSION_MODE=local\n```\n\n### Hybrid Mode (Best of Both)\n\nInstall with local support and enable automatic fallback:\n\n```bash\npip install docling-mcp[local]\n```\n\nConfigure for remote with fallback:\n```bash\nexport DOCLING_MCP_SERVICE_URL=https://your-docling-service.example.com\nexport DOCLING_MCP_CONVERSION_MODE=remote\nexport DOCLING_MCP_FALLBACK_TO_LOCAL=true\n```\n\n## Features\n\n- Conversion tools:\n    - PDF document conversion to structured JSON format ([DoclingDocument][docling_document])\n- Generation tools:\n    - Document generation in DoclingDocument, which can be exported to multiple formats\n- Local document caching for improved performance\n- Support for local files and URLs as document sources\n- Memory management for handling large documents\n- Logging system for debugging and monitoring\n- RAG applications with Milvus upload and retrieval\n\n## Configuration\n\nAll settings use the `DOCLING_MCP_` prefix and can be supplied as environment\nvariables, in a `.env` file in the working directory, or via the `env` block of\nyour MCP client config. Copy [`.env.example`](.env.example) as a starting point.\n\n### Conversion mode\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_CONVERSION_MODE` | `remote` | `remote` or `local` |\n\n### Remote service (required when `DOCLING_MCP_CONVERSION_MODE=remote`)\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_SERVICE_URL` | — | URL of the Docling Serve instance |\n| `DOCLING_MCP_SERVICE_API_KEY` | — | API key for the service |\n| `DOCLING_MCP_SERVICE_TIMEOUT` | `300.0` | Timeout in seconds for a whole conversion job |\n| `DOCLING_MCP_SERVICE_MAX_RETRIES` | `3` | Max retry attempts |\n| `DOCLING_MCP_FALLBACK_TO_LOCAL` | `false` | Fall back to local if service is unreachable (requires `docling-mcp[local]`) |\n\n### Conversion pipeline (applies to both modes)\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_KEEP_IMAGES` | `false` | Retain page images in output |\n| `DOCLING_MCP_IMAGES_SCALE` | `1.0` | Image scale factor (increase to avoid tensor padding errors) |\n| `DOCLING_MCP_DO_OCR` | `true` | Run OCR pipeline |\n| `DOCLING_MCP_DO_TABLE_STRUCTURE` | `true` | Detect table structure |\n\n### Markdown export\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_IMAGE_EXPORT_MODE` | `placeholder` | How images are rendered in Markdown output: `placeholder` (emits `<!-- image -->`), `embedded` (base64 data-URI), `referenced` (file path / URL) |\n\n### LlamaIndex RAG (`--tools llama-index-rag`)\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_LI_API_BASE` | `http://127.0.0.1:1234/v1` | OpenAI-compatible LLM endpoint |\n| `DOCLING_MCP_LI_API_KEY` | `none` | API key for the LLM endpoint |\n| `DOCLING_MCP_LI_MODEL_ID` | `ibm/granite-3.2-8b` | LLM model identifier |\n| `DOCLING_MCP_LI_EMBEDDING_MODEL` | `BAAI/bge-base-en-v1.5` | HuggingFace embedding model |\n\n### LlamaStack (`--tools llama-stack-rag` / `--tools llama-stack-ie`)\n\n| Variable | Default | Description |\n|---|---|---|\n| `DOCLING_MCP_LLS_URL` | `http://localhost:8321` | LlamaStack server URL |\n| `DOCLING_MCP_LLS_VDB_EMBEDDING` | `all-MiniLM-L6-v2` | Embedding model for vector DB |\n| `DOCLING_MCP_LLS_EXTRACTION_MODEL` | `openai/gpt-oss-20b` | Model used for structured extraction |\n\n### Setting variables in an MCP client config\n\n```json\n{\n  \"mcpServers\": {\n    \"docling\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"--from=docling-mcp\",\n        \"docling-mcp-server\"\n      ],\n      \"env\": {\n        \"DOCLING_MCP_CONVERSION_MODE\": \"remote\",\n        \"DOCLING_MCP_SERVICE_URL\": \"https://your-docling-service.example.com\",\n        \"DOCLING_MCP_SERVICE_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\n## Getting started\n\nThe easiest way to install Docling MCP and connect it to your client is by launching it via [uvx](https://docs.astral.sh/uv/).\n\nDepending on the transfer protocol required, specify the argument `--transport`, for example\n\n- **`stdio`** used e.g. in Claude for Desktop and LM Studio \n\n    ```sh\n    uvx --from docling-mcp docling-mcp-server --transport stdio\n    ```\n\n- **`sse`** used e.g. in Llama Stack\n\n    ```sh\n    uvx --from docling-mcp docling-mcp-server --transport sse\n    ```\n\n\n- **`streamable-http`** used e.g. in containers setup\n\n    ```sh\n    uvx --from docling-mcp docling-mcp-server --transport streamable-http\n    ```\n\nMore options are available, e.g. the selection of which toolgroup to launch. Use the `--help` argument to inspect all the CLI options.\n\nFor developing the MCP tools further, please refer to the [Developing](CONTRIBUTING.md#developing) section of CONTRIBUTING.md for instructions.\n\n## Integration with MCP clients\n\nOne of the easiest ways to experiment with the tools provided by Docling MCP is to leverage an AI desktop client with MCP support.\nMost of these clients use a common config interface. Adding Docling MCP in your favorite client is usually as simple as adding the following entry in the configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"docling\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"--from=docling-mcp\",\n        \"docling-mcp-server\"\n      ]\n    }\n  }\n} \n```\n\nWhen using **[Claude for Desktop](https://claude.ai/download)**, simply edit the config file `claude_desktop_config.json` with the snippet above or the example provided [here](docs/integrations/claude_desktop_config.json).\n\nIn **[LM Studio](https://lmstudio.ai/)**, edit the `mcp.json` file with the appropriate section or simply click on the button below for a direct install.\n\n[![Add MCP Server docling to LM Studio](https://files.lmstudio.ai/deeplink/mcp-install-light.svg)](https://lmstudio.ai/install-mcp?name=docling&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb209ZG9jbGluZy1tY3AiLCJkb2NsaW5nLW1jcC1zZXJ2ZXIiXX0%3D)\n\nOther integrations are described in the [integrations] page.\n\n## Examples\n\n### Converting documents\n\nExample of prompt for converting PDF documents:\n\n```prompt\nConvert the PDF document at <provide file-path> into DoclingDocument and return its document-key.\n```\n\n### Generating documents\n\nExample of prompt for generating new documents:\n\n```prompt\nI want you to write a Docling document. To do this, you will create a document first by invoking `create_new_docling_document`. Next you can add a title (by invoking `add_title_to_docling_document`) and then iteratively add new section-headings and paragraphs. If you want to insert lists (or nested lists), you will first open a list (by invoking `open_list_in_docling_document`), next add the list_items (by invoking `add_listitem_to_list_in_docling_document`). After adding list-items, you must close the list (by invoking `close_list_in_docling_document`). Nested lists can be created in the same way, by opening and closing additional lists.\n\nDuring the writing process, you can check what has been written already by calling the `export_docling_document_to_markdown` tool, which will return the currently written document. At the end of the writing, you must save the document and return me the filepath of the saved document.\n\nThe document should investigate the impact of tokenizers on the quality of LLMs.\n```\n\n## Contributing\n\nWe welcome external contributions. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to get started.\n\n## License\n\nThe Docling MCP codebase is under MIT license. For individual model usage, please refer to the model licenses found in the original packages.\n\n## LF AI & Data\n\nDocling and Docling MCP is hosted as a project in the [LF AI & Data Foundation](https://lfaidata.foundation/projects/).\n\n**IBM ❤️ Open Source AI**: The project was started by the AI for knowledge team at IBM Research Zurich.\n\n[docling_document]: https://docling-project.github.io/docling/concepts/docling_document/\n[integrations]: https://docling-project.github.io/docling-mcp/integrations/\n\n<!-- MCP registry ownership marker (proves this PyPI package maps to the server name). -->\n<!-- mcp-name: io.github.docling-project/docling-mcp -->\n",
  "bytes": 11753,
  "sha": "2469cb9020d396b50f9438658c4b1e4860cb21efd7089fe08ffc58fd7c809bc0",
  "repo_slug": "docling-project/docling-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_docling_project_docling_mcp_52719d2c/readme"
}