# dicom-mcp

> MCP Server

The dicom-mcp repository provides a Model Context Protocol server for DICOM, enabling LLMs to query and interact with medical imaging metadata from DICOM servers. It supports patient data retrieval and

## Overview

- **Category:** AI
- **Language:** Python
- **Stars:** 99
- **Forks:** 2
- **Owner:** ChristianHinge
- **GitHub:** https://github.com/ChristianHinge/dicom-mcp
- **Created:** 2025-03-11T16:58:30+00:00
- **Updated:** 2025-03-28T09:43:38+00:00
- **Source:** https://model-context-protocol.com/servers/dicom-llm-medical-imaging-metadata-protocol

## Setup

## Setup

### Prerequisites

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

### Using pip

Install via pip:

```bash
pip install dicom-mcp
```

dicom-mcp requires a YAML configuration file that defines the DICOM nodes and calling AE titles; create a configuration file with the specified structure.

To run the server, use the command `dicom-mcp /path/to/configuration.yaml` or `uv run dicom-mcp /path/to/configuration.yaml`.

To use with Claude Desktop, add the provided configuration to `claude_desktop_config.json`.

To use with Zed, add the provided configuration to your Zed settings.json.

For development:

1. Clone the repository: `git clone https://github.com/yourusername/dicom-mcp.git` and `cd dicom-mcp`.
2. Create a virtual environment: `python -m venv .venv` and activate it with `source .venv/bin/activate` (or `.venv\Scripts\activate` on Windows).
3. Install dependencies: `pip install -e .`.

To run tests, start an Orthanc server using Docker with `cd tests` and `docker-compose up -d`, then run tests with `pytest tests/test_dicom_mcp.py` or `pytest tests/test_dicom_pdf.py`.

## Tools

## Available Tools

1. `list_dicom_nodes` (Lists all configured DICOM nodes and calling AE titles)
2. `switch_dicom_node` (Switches to a different configured DICOM node)
3. `switch_calling_aet` (Switches to a different configured calling AE title)
4. `verify_connection` (Tests connectivity to the configured DICOM node using C-ECHO)
5. `query_patients` (Search for patients matching specified criteria)
6. `query_studies` (Search for studies matching specified criteria)
7. `query_series` (Search for series within a study)
8. `query_instances` (Search for instances within a series)
9. `get_attribute_presets` (Lists available attribute presets for queries)
10. `retrieve_instance` (Retrieves a specific DICOM instance and saves it to the local filesystem)
11. `extract_pdf_text_from_dicom` (Retrieves a DICOM instance containing an encapsulated PDF and extracts its text content)
