dicom-mcp

dicom-mcp

A Model Context Protocol server for managing and querying DICOM medical imaging data.

74
Stars
21
Forks
74
Watchers
7
Issues
dicom-mcp enables AI assistants and tools to query, read, and transfer data on DICOM servers, such as PACS and VNA systems. It integrates with MCP-compatible clients, offering tooling for searching patient records, retrieving medical reports, and sending image data to analysis endpoints. Configurable via YAML, it streamlines operations on DICOM databases for research and development in medical imaging. It is explicitly designed for interoperability with LLM-based AI workflows.

Key Features

MCP protocol server for DICOM systems
Query patient, study, series, and instance metadata
Extract PDF text from DICOM files
Send DICOM series or studies to other destinations
Configurable connections to multiple DICOM nodes
LLM integration for automated queries
YAML-based flexible configuration
Tool interface for external AI systems
Python 3.12+ support and PyPI distribution
Non-clinical use with privacy protection

Use Cases

Automated querying of patient imaging records
Extracting clinical reports from DICOM PDF files
Sending studies for remote AI segmentation or classification
Integrating medical imaging workflows with large language models
Data mining for research studies using DICOM metadata
Local hosting with open-weight LLMs to preserve privacy
Interfacing DICOM servers with healthcare assistant applications
Rapid development and prototyping of imaging AI tools
Educational exploration of DICOM query/retrieve standards
Batch data extraction for non-clinical analytics

README

DICOM MCP Server for Medical Imaging Systems πŸ₯

License: MIT Python Version PyPI Version PyPI Downloads

The dicom-mcp server enables AI assistants to query, read, and move data on DICOM servers (PACS, VNA, etc.).

🀝 Contribute β€’ πŸ“ Report Bug β€’ πŸ“ Blog Post 1

text
---------------------------------------------------------------------
πŸ§‘β€βš•οΈ User: "Any significant findings in John Doe's previous CT report?"

🧠 LLM β†’ βš™οΈ Tools:
   query_patients β†’ query_studies β†’ query_series β†’ extract_pdf_text_from_dicom

πŸ’¬ LLM Response: "The report from 2025-03-26 mentions a history of splenomegaly (enlarged spleen)"

πŸ§‘β€βš•οΈ User: "What's the volume of his spleen at the last scan and the scan today?"

🧠 LLM β†’ βš™οΈ Tools:
   (query_studies β†’ query_series β†’ move_series β†’ query_series β†’ extract_pdf_text_from_dicom) x2
   (The move_series tool sends the latest CT to a DICOM segmentation node, which returns volume PDF report)

πŸ’¬ LLM Response: "last year 2024-03-26: 412cmΒ³, today 2025-04-10: 350cmΒ³"
---------------------------------------------------------------------

✨ Core Capabilities

dicom-mcp provides tools to:

  • πŸ” Query Metadata: Search for patients, studies, series, and instances using various criteria.
  • πŸ“„ Read DICOM Reports (PDF): Retrieve DICOM instances containing encapsulated PDFs (e.g., clinical reports) and extract the text content.
  • ➑️ Send DICOM Images: Send series or studies to other DICOM destinations, e.g. AI endpoints for image segmentation, classification, etc.
  • βš™οΈ Utilities: Manage connections and understand query options.

πŸš€ Quick Start

πŸ“₯ Installation

Install using uv or pip:

bash
uv tool install dicom-mcp

Or by cloning the repository:

bash
# Clone and set up development environment
git clone https://github.com/ChristianHinge/dicom-mcp
cd dicom mcp

# Create and activate virtual environment
uv venv
source .venv/bin/activate

# Install with test dependencies
uv pip install -e ".[dev]"

βš™οΈ Configuration

dicom-mcp requires a YAML configuration file (config.yaml or similar) defining DICOM nodes and calling AE titles. Adapt the configuration or keep as is for compatibility with the sample ORTHANC Server.

yaml
nodes:
  main:
    host: "localhost"
    port: 4242 
    ae_title: "ORTHANC"
    description: "Local Orthanc DICOM server"

current_node: "main"
calling_aet: "MCPSCU" 

[!WARNING] DICOM-MCP is not meant for clinical use, and should not be connected with live hospital databases or databases with patient-sensitive data. Doing so could lead to both loss of patient data, and leakage of patient data onto the internet. DICOM-MCP can be used with locally hosted open-weight LLMs for complete data privacy.

(Optional) Sample ORTHANC server

If you don't have a DICOM server available, you can run a local ORTHANC server using Docker:

Clone the repository and install test dependencies pip install -e ".[dev]

bash
cd tests
docker ocmpose up -d
cd ..
pytest # uploads dummy pdf data to ORTHANC server

UI at http://localhost:8042

πŸ”Œ MCP Integration

Add to your client configuration (e.g. claude_desktop_config.json):

json
{
  "mcpServers": {
    "dicom": {
      "command": "uv",
      "args": ["tool","dicom-mcp", "/path/to/your_config.yaml"]
    }
  }
}

For development:

json
{
    "mcpServers": {
        "arxiv-mcp-server": {
            "command": "uv",
            "args": [
                "--directory",
                "path/to/cloned/dicom-mcp",
                "run",
                "dicom-mcp",
                "/path/to/your_config.yaml"
            ]
        }
    }
}

πŸ› οΈ Tools Overview

dicom-mcp provides four categories of tools for interaction with DICOM servers and DICOM data.

πŸ” Query Metadata

  • query_patients: Search for patients based on criteria like name, ID, or birth date.
  • query_studies: Find studies using patient ID, date, modality, description, accession number, or Study UID.
  • query_series: Locate series within a specific study using modality, series number/description, or Series UID.
  • query_instances: Find individual instances (images/objects) within a series using instance number or SOP Instance UID

πŸ“„ Read DICOM Reports (PDF)

  • extract_pdf_text_from_dicom: Retrieve a specific DICOM instance containing an encapsulated PDF and extract its text content.

➑️ Send DICOM Images

  • move_series: Send a specific DICOM series to another configured DICOM node using C-MOVE.
  • move_study: Send an entire DICOM study to another configured DICOM node using C-MOVE.

βš™οΈ Utilities

  • list_dicom_nodes: Show the currently active DICOM node and list all configured nodes.
  • switch_dicom_node: Change the active DICOM node for subsequent operations.
  • verify_connection: Test the DICOM network connection to the currently active node using C-ECHO.
  • get_attribute_presets: List the available levels of detail (minimal, standard, extended) for metadata query results.

Example interaction

The tools can be chained together to answer complex questions:

πŸ“ˆ Contributing

Running Tests

Tests require a running Orthanc DICOM server. You can use Docker:

bash
# Navigate to the directory containing docker-compose.yml (e.g., tests/)
cd tests
docker-compose up -d

Run tests using pytest:

bash
# From the project root directory
pytest

Stop the Orthanc container:

bash
cd tests
docker-compose down

Debugging

Use the MCP Inspector for debugging the server communication:

bash
npx @modelcontextprotocol/inspector uv run dicom-mcp /path/to/your_config.yaml --transport stdio

πŸ™ Acknowledgments

Star History

Star History Chart

Repository Owner

Repository Details

Language Python
Default Branch master
Size 1,440 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • PDF Tools MCP

    PDF Tools MCP

    Comprehensive PDF manipulation via MCP protocol.

    PDF Tools MCP provides an extensive suite of PDF manipulation operations using the Model Context Protocol framework. It supports both local and remote PDF tasks, such as rendering pages, merging, extracting metadata, retrieving text, and combining documents. The tool registers endpoints through the MCP protocol, enabling seamless server-based PDF processing for various clients. Built with Python, it emphasizes secure handling and compatibility with Claude Desktop via the Smithery ecosystem.

    • ⭐ 31
    • MCP
    • danielkennedy1/pdf-tools-mcp
  • Markdownify MCP Server

    Markdownify MCP Server

    Convert diverse files and web content into Markdown via the Model Context Protocol.

    Markdownify MCP Server offers a protocol-based server that transforms various file typesβ€”including PDF, images, audio, DOCX, XLSX, and PPTXβ€”as well as web content like YouTube videos, Bing search results, and web pages into Markdown format. The server exposes a suite of conversion tools through a standardized interface for easy integration with applications. Optional configuration allows retrieval of Markdown files from restricted directories, and the platform supports development customization for additional tool integration. Deployment and operation are straightforward with cross-platform support (with pending Windows improvements).

    • ⭐ 2,256
    • MCP
    • zcaceres/markdownify-mcp
  • Multi-Database MCP Server (by Legion AI)

    Multi-Database MCP Server (by Legion AI)

    Unified multi-database access and AI interaction server with MCP integration.

    Multi-Database MCP Server enables seamless access and querying of diverse databases via a unified API, with native support for the Model Context Protocol (MCP). It supports popular databases such as PostgreSQL, MySQL, SQL Server, and more, and is built for integration with AI assistants and agents. Leveraging the MCP Python SDK, it exposes databases as resources, tools, and prompts for intelligent, context-aware interactions, while delivering zero-configuration schema discovery and secure credential management.

    • ⭐ 76
    • MCP
    • TheRaLabs/legion-mcp
  • Ebook-MCP

    Ebook-MCP

    A Model Context Protocol server for conversational e-book interaction and AI integration.

    Ebook-MCP acts as a Model Context Protocol (MCP) server enabling seamless interaction between large language model (LLM) applications and electronic books such as EPUB and PDF. It standardizes APIs for AI-powered reading, searching, and managing digital libraries. Through natural language interfaces, it provides smart library management, content navigation, and interactive learning within digital books. Ebook-MCP integrates with modern AI-powered IDEs and supports multi-format digital book processing.

    • ⭐ 132
    • MCP
    • onebirdrocks/ebook-mcp
  • YDB MCP

    YDB MCP

    MCP server for AI-powered natural language database operations on YDB.

    YDB MCP acts as a Model Context Protocol server enabling YDB databases to be accessed via any LLM supporting MCP. It allows AI-driven and natural language interaction with YDB instances by bridging database operations with language model interfaces. Flexible deployment through uvx, pipx, or pip is supported, along with multiple authentication methods. The integration empowers users to manage YDB databases conversationally through standardized protocols.

    • ⭐ 24
    • MCP
    • ydb-platform/ydb-mcp
  • mcp-pandoc

    mcp-pandoc

    Seamless document format conversion via the Model Context Protocol.

    mcp-pandoc is a Model Context Protocol (MCP) server for document format conversion powered by Pandoc. It enables bidirectional transformation of content between various document formats while preserving structure and formatting. Designed for integration in AI workflows, it allows standardized and programmatic conversion suitable for large language models and tool-augmented assistants. The project exposes conversion functionality both by direct content submission and via input files.

    • ⭐ 445
    • MCP
    • vivekVells/mcp-pandoc
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results