DICOM MCP server

Enables interaction with medical imaging systems through DICOM networking protocols for querying patient information, studies, series, and instances, as well as extracting text from encapsulated PDF documents.
Back to servers
Setup instructions
Provider
Christian Hinge
Release date
Mar 20, 2025
Language
Python
Stats
56 stars

The DICOM-MCP server enables Large Language Models to interact with DICOM medical imaging servers, allowing access to patient information, studies, series, and instances using standard DICOM networking protocols. It can also extract text from encapsulated PDF documents stored in DICOM format.

Prerequisites

  • Python 3.12 or higher
  • A DICOM server to connect to (e.g., Orthanc, dcm4chee)

Installation

Install via pip:

pip install dicom-mcp

Configuration

Create a YAML configuration file that defines DICOM nodes and calling AE titles:

# DICOM nodes configuration
nodes:
  orthanc:
    host: "localhost"
    port: 4242
    ae_title: "ORTHANC"
    description: "Local Orthanc DICOM server"
  
  clinical:
    host: "pacs.hospital.org"
    port: 11112
    ae_title: "CLIN_PACS"
    description: "Clinical PACS server"

# Local calling AE titles
calling_aets:
  default:
    ae_title: "MCPSCU"
    description: "Default calling AE title"
  
  modality:
    ae_title: "MODALITY"
    description: "Simulating a modality"

# Currently selected node
current_node: "orthanc"

# Currently selected calling AE title
current_calling_aet: "default"

Usage

Starting the Server

Run the server using the command line:

dicom-mcp /path/to/configuration.yaml

If using uv:

uv run dicom-mcp /path/to/configuration.yaml

Integration with Claude Desktop

Add to your claude_desktop_config.json:

"mcpServers": {
  "dicom": {
    "command": "uv",
    "args": ["--directory", "/path/to/dicom-mcp", "run", "dicom-mcp", "/path/to/configuration.yaml"]
  }
}

Integration with Zed

Add to your Zed settings.json:

"context_servers": [
  "dicom-mcp": {
    "command": {
      "path": "uv",
      "args": ["--directory", "/path/to/dicom-mcp", "run", "dicom-mcp", "/path/to/configuration.yaml"]
    }
  }
],

Using DICOM-MCP Tools

Connection Management

List available DICOM nodes:

list_dicom_nodes()

Switch to a different node:

switch_dicom_node(node_name="clinical")

Switch to a different calling AE title:

switch_calling_aet(aet_name="modality")

Verify connection with C-ECHO:

verify_connection()

Querying DICOM Data

Search for patients:

query_patients(
  name_pattern="SMITH*", 
  patient_id="12345", 
  birth_date="19700101",
  attribute_preset="standard"
)

Search for studies:

query_studies(
  patient_id="12345", 
  study_date="20230101-20231231", 
  modality_in_study="CT",
  study_description="CHEST*",
  attribute_preset="extended"
)

Search for series in a study:

query_series(
  study_instance_uid="1.2.3.4.5.6.7.8.9", 
  modality="CT", 
  series_description="*CONTRAST*"
)

Search for instances in a series:

query_instances(
  series_instance_uid="1.2.3.4.5.6.7.8.9.10", 
  instance_number="1"
)

Retrieving DICOM Data

Retrieve a DICOM instance:

retrieve_instance(
  study_instance_uid="1.2.3.4.5.6.7.8.9",
  series_instance_uid="1.2.3.4.5.6.7.8.9.10",
  sop_instance_uid="1.2.3.4.5.6.7.8.9.10.11",
  output_directory="./my_retrieved_files"
)

Extract text from a DICOM encapsulated PDF:

extract_pdf_text_from_dicom(
  study_instance_uid="1.2.3.4.5.6.7.8.9",
  series_instance_uid="1.2.3.4.5.6.7.8.9.10",
  sop_instance_uid="1.2.3.4.5.6.7.8.9.10.11"
)

Attribute Management

Get available attribute presets:

get_attribute_presets()

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dicom" '{"command":"dicom-mcp","args":["/path/to/configuration.yaml"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dicom": {
            "command": "dicom-mcp",
            "args": [
                "/path/to/configuration.yaml"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your 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

2. Add this to your configuration file:

{
    "mcpServers": {
        "dicom": {
            "command": "dicom-mcp",
            "args": [
                "/path/to/configuration.yaml"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later