The dicom-mcp server enables AI assistants to query, read, and move data on DICOM servers (PACS, VNA, etc.). ๐ค Contribute โข ๐ Report Bug โข ๐ Blog Post 1 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
Add this skill
npx mdskills install ChristianHinge/dicom-mcpWell-documented MCP server enabling AI agents to query and manipulate medical DICOM data with comprehensive tooling
1# DICOM MCP Server for Medical Imaging Systems ๐ฅ23[](https://opensource.org/licenses/MIT)4[](https://www.python.org/downloads/)5 [](https://pypi.org/project/dicom-mcp/) [](https://pypi.org/project/dicom-mcp/)67The `dicom-mcp` server enables AI assistants to query, read, and move data on DICOM servers (PACS, VNA, etc.).89<div align="center">1011๐ค **[Contribute](#contributing)** โข12๐ **[Report Bug](https://github.com/ChristianHinge/dicom-mcp/issues)** โข13๐ **[Blog Post 1](https://www.christianhinge.com/projects/dicom-mcp/)**1415</div>1617```text18---------------------------------------------------------------------19๐งโโ๏ธ User: "Any significant findings in John Doe's previous CT report?"2021๐ง LLM โ โ๏ธ Tools:22 query_patients โ query_studies โ query_series โ extract_pdf_text_from_dicom2324๐ฌ LLM Response: "The report from 2025-03-26 mentions a history of splenomegaly (enlarged spleen)"2526๐งโโ๏ธ User: "What's the volume of his spleen at the last scan and the scan today?"2728๐ง LLM โ โ๏ธ Tools:29 (query_studies โ query_series โ move_series โ query_series โ extract_pdf_text_from_dicom) x230 (The move_series tool sends the latest CT to a DICOM segmentation node, which returns volume PDF report)3132๐ฌ LLM Response: "last year 2024-03-26: 412cmยณ, today 2025-04-10: 350cmยณ"33---------------------------------------------------------------------34```353637## โจ Core Capabilities3839`dicom-mcp` provides tools to:4041* **๐ Query Metadata**: Search for patients, studies, series, and instances using various criteria.42* **๐ Read DICOM Reports (PDF)**: Retrieve DICOM instances containing encapsulated PDFs (e.g., clinical reports) and extract the text content.43* **โก๏ธ Send DICOM Images**: Send series or studies to other DICOM destinations, e.g. AI endpoints for image segmentation, classification, etc.44* **โ๏ธ Utilities**: Manage connections and understand query options.4546## ๐ Quick Start47### ๐ฅ Installation48Install using uv or pip:4950```bash51uv tool install dicom-mcp52```53Or by cloning the repository:5455```bash56# Clone and set up development environment57git clone https://github.com/ChristianHinge/dicom-mcp58cd dicom mcp5960# Create and activate virtual environment61uv venv62source .venv/bin/activate6364# Install with test dependencies65uv pip install -e ".[dev]"66```676869### โ๏ธ Configuration7071`dicom-mcp` requires a YAML configuration file (`config.yaml` or similar) defining DICOM nodes and calling AE titles. Adapt the configuration or keep as is for compatibility with the sample ORTHANC Server.7273```yaml74nodes:75 main:76 host: "localhost"77 port: 424278 ae_title: "ORTHANC"79 description: "Local Orthanc DICOM server"8081current_node: "main"82calling_aet: "MCPSCU"83```84> [!WARNING]85DICOM-MCP is not meant for clinical use, and should not be connected with live hospital databases or databases with patient-sensitive data. Doing so could lead to both loss of patient data, and leakage of patient data onto the internet. DICOM-MCP can be used with locally hosted open-weight LLMs for complete data privacy.8687### (Optional) Sample ORTHANC server88If you don't have a DICOM server available, you can run a local ORTHANC server using Docker:8990Clone the repository and install test dependencies `pip install -e ".[dev]`9192```bash93cd tests94docker ocmpose up -d95cd ..96pytest # uploads dummy pdf data to ORTHANC server97```98UI at [http://localhost:8042](http://localhost:8042)99100### ๐ MCP Integration101102Add to your client configuration (e.g. `claude_desktop_config.json`):103104```json105{106 "mcpServers": {107 "dicom": {108 "command": "uvx",109 "args": ["dicom-mcp", "/path/to/your_config.yaml"]110 }111 }112}113```114115For development:116117```json118{119 "mcpServers": {120 "arxiv-mcp-server": {121 "command": "uv",122 "args": [123 "--directory",124 "path/to/cloned/dicom-mcp",125 "run",126 "dicom-mcp",127 "/path/to/your_config.yaml"128 ]129 }130 }131}132```133134135## ๐ ๏ธ Tools Overview136137`dicom-mcp` provides four categories of tools for interaction with DICOM servers and DICOM data.138139### ๐ Query Metadata140141* **`query_patients`**: Search for patients based on criteria like name, ID, or birth date.142* **`query_studies`**: Find studies using patient ID, date, modality, description, accession number, or Study UID.143* **`query_series`**: Locate series within a specific study using modality, series number/description, or Series UID.144* **`query_instances`**: Find individual instances (images/objects) within a series using instance number or SOP Instance UID145### ๐ Read DICOM Reports (PDF)146147* **`extract_pdf_text_from_dicom`**: Retrieve a specific DICOM instance containing an encapsulated PDF and extract its text content.148149### โก๏ธ Send DICOM Images150151* **`move_series`**: Send a specific DICOM series to another configured DICOM node using C-MOVE.152* **`move_study`**: Send an entire DICOM study to another configured DICOM node using C-MOVE.153154### โ๏ธ Utilities155156* **`list_dicom_nodes`**: Show the currently active DICOM node and list all configured nodes.157* **`switch_dicom_node`**: Change the active DICOM node for subsequent operations.158* **`verify_connection`**: Test the DICOM network connection to the currently active node using C-ECHO.159* **`get_attribute_presets`**: List the available levels of detail (minimal, standard, extended) for metadata query results.<p>160161162### Example interaction163The tools can be chained together to answer complex questions:164165166<div align="center">167<img src="images/example.png" alt="My Awesome Diagram" width="700">168</div>169170171## ๐ Contributing172### Running Tests173174Tests require a running Orthanc DICOM server. You can use Docker:175176```bash177# Navigate to the directory containing docker-compose.yml (e.g., tests/)178cd tests179docker-compose up -d180```181182Run tests using pytest:183184```bash185# From the project root directory186pytest187```188189Stop the Orthanc container:190191```bash192cd tests193docker-compose down194```195196### Debugging197198Use the MCP Inspector for debugging the server communication:199200```bash201npx @modelcontextprotocol/inspector uv run dicom-mcp /path/to/your_config.yaml --transport stdio202```203204## ๐ Acknowledgments205206* Built using [pynetdicom](https://github.com/pydicom/pynetdicom)207* Uses [PyPDF2](https://pypi.org/project/PyPDF2/) for PDF text extraction208
Full transparency โ inspect the skill content before installing.