dicom.com
dicom.com logo

DICOM

Enables interaction with medical imaging systems through DICOM networking protocols for querying patient information, st...

Created byApr 22, 2025

dicom-mcp: A DICOM Model Context Protocol Server

This repo is part of a blog post: Agentic Healthcare LLMs

Overview

A Model Context Protocol server for DICOM (Digital Imaging and Communications in Medicine) interactions. This server provides tools to query and interact with DICOM servers, enabling Large Language Models to access and analyze medical imaging metadata.
dicom-mcp allows AI assistants to query patient information, studies, series, and instances from DICOM servers using standard DICOM networking protocols. It also supports extracting text from encapsulated PDF documents stored in DICOM format, making it possible to analyze clinical reports. It's built on pynetdicom and follows the Model Context Protocol specification.

Tools

  1. list_dicom_nodes
  1. switch_dicom_node
  1. switch_calling_aet
  1. verify_connection
  1. query_patients
  1. query_studies
  1. query_series
  1. query_instances
  1. get_attribute_presets
  1. retrieve_instance
  1. extract_pdf_text_from_dicom

Installation

Prerequisites

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

Using pip

Install via pip:

Configuration

dicom-mcp requires a YAML configuration file that defines the DICOM nodes and calling AE titles. Create a configuration file with the following structure:

Usage

Command Line

Run the server using the script entry point:
If using uv:

Configuration with Claude Desktop

Add this to your claude_desktop_config.json:

Usage with Zed

Add to your Zed settings.json:

Example Queries

List available DICOM nodes

Switch to a different node

Switch to a different calling AE title

Verify connection

Search for patients

Search for studies

Search for series in a study

Search for instances in a series

Retrieve a DICOM instance

Extract text from a DICOM encapsulated PDF

Debugging

You can use the MCP inspector to debug the server:

Development

Setup Development Environment

  1. Clone the repository:
  1. Create a virtual environment:
  1. Install dependencies:

Running Tests

The tests require a running Orthanc server. You can start one using Docker:
Then run the tests:
To test PDF extraction functionality:

Project Structure

  • src/dicom_mcp/: Main package

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Uses PyPDF2 for PDF text extraction

dicom-mcp: A DICOM Model Context Protocol Server

This repo is part of a blog post: Agentic Healthcare LLMs

Overview

A Model Context Protocol server for DICOM (Digital Imaging and Communications in Medicine) interactions. This server provides tools to query and interact with DICOM servers, enabling Large Language Models to access and analyze medical imaging metadata.
dicom-mcp allows AI assistants to query patient information, studies, series, and instances from DICOM servers using standard DICOM networking protocols. It also supports extracting text from encapsulated PDF documents stored in DICOM format, making it possible to analyze clinical reports. It's built on pynetdicom and follows the Model Context Protocol specification.

Tools

  1. list_dicom_nodes
  1. switch_dicom_node
  1. switch_calling_aet
  1. verify_connection
  1. query_patients
  1. query_studies
  1. query_series
  1. query_instances
  1. get_attribute_presets
  1. retrieve_instance
  1. extract_pdf_text_from_dicom

Installation

Prerequisites

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

Using pip

Install via pip:

Configuration

dicom-mcp requires a YAML configuration file that defines the DICOM nodes and calling AE titles. Create a configuration file with the following structure:

Usage

Command Line

Run the server using the script entry point:
If using uv:

Configuration with Claude Desktop

Add this to your claude_desktop_config.json:

Usage with Zed

Add to your Zed settings.json:

Example Queries

List available DICOM nodes

Switch to a different node

Switch to a different calling AE title

Verify connection

Search for patients

Search for studies

Search for series in a study

Search for instances in a series

Retrieve a DICOM instance

Extract text from a DICOM encapsulated PDF

Debugging

You can use the MCP inspector to debug the server:

Development

Setup Development Environment

  1. Clone the repository:
  1. Create a virtual environment:
  1. Install dependencies:

Running Tests

The tests require a running Orthanc server. You can start one using Docker:
Then run the tests:
To test PDF extraction functionality:

Project Structure

  • src/dicom_mcp/: Main package

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Uses PyPDF2 for PDF text extraction