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.
Install via pip:
pip install dicom-mcp
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"
Run the server using the command line:
dicom-mcp /path/to/configuration.yaml
If using uv:
uv run dicom-mcp /path/to/configuration.yaml
Add to your claude_desktop_config.json:
"mcpServers": {
"dicom": {
"command": "uv",
"args": ["--directory", "/path/to/dicom-mcp", "run", "dicom-mcp", "/path/to/configuration.yaml"]
}
}
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"]
}
}
],
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()
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"
)
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"
)
Get available attribute presets:
get_attribute_presets()
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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