Labsco
Y5ive9ine logo

DICOM MCP Server

from Y5ive9ine

Enables AI assistants to query, read, and move data on DICOM servers like PACS and VNA.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

DICOM MCP Server for Medical Imaging Systems ๐Ÿฅ

PyPI Downloads

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

๐Ÿค Contribute โ€ข ๐Ÿ“ Report Bug โ€ข

---------------------------------------------------------------------
๐Ÿง‘โ€โš•๏ธ 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.
  • ๐Ÿ“ฅ Download DICOM Files: Download DICOM instances from the server to a local directory using C-GET. Retrieve entire series or specific instances for local analysis and processing.
  • โžก๏ธ 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.

๐Ÿ“ฅ Download DICOM Files

  • retrieve_dicom_instances: Download DICOM instances from the server to a local directory using C-GET. Retrieve entire series or specific instances for local analysis and processing.

โžก๏ธ 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:

My Awesome Diagram

๐Ÿ“ˆ Contributing

Running Tests

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

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

Run tests using pytest:

# From the project root directory
pytest

Stop the Orthanc container:

cd tests
docker-compose down

Debugging

Use the MCP Inspector for debugging the server communication:

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

๐Ÿ™ Acknowledgments