Labsco
ChristianHinge logo

DICOM MCP Server

β˜… 99

from ChristianHinge

Enables AI assistants to query, read, and move data on DICOM servers such as PACS and VNA for medical imaging.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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.).

<div align="center">

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

</div>
Copy & paste β€” that's it
---------------------------------------------------------------------
πŸ§‘β€βš•οΈ 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.

πŸ› οΈ 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.<p>

Example interaction

The tools can be chained together to answer complex questions:

<div align="center"> <img src="images/example.png" alt="My Awesome Diagram" width="700"> </div>

πŸ“ˆ Contributing

Running Tests

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

Copy & paste β€” that's it
# Navigate to the directory containing docker-compose.yml (e.g., tests/)
cd tests
docker-compose up -d

Run tests using pytest:

Copy & paste β€” that's it
# From the project root directory
pytest

Stop the Orthanc container:

Copy & paste β€” that's it
cd tests
docker-compose down

Debugging

Use the MCP Inspector for debugging the server communication:

Copy & paste β€” that's it
npx @modelcontextprotocol/inspector uv run dicom-mcp /path/to/your_config.yaml --transport stdio

πŸ™ Acknowledgments