DI

Dicom MCP Server: Query Images, Read DICOM Docs

Query and retrieve medical images and parse DICOM-encapsulated documents (PDFs) with this MCP server for fast, reliable access.

Quick Install
npx -y @ChristianHinge/dicom-mcp

Overview

Dicom MCP Server is a small server that implements the Model Context Protocol (MCP) to make DICOM image and document data available to downstream AI models and tooling. It acts as a bridge between DICOMweb-capable PACS (QIDO/WADO) and an MCP-compliant runtime, exposing operations to query studies/series/instances and to fetch DICOM-encapsulated documents (for example, PDFs embedded in DICOM objects). The server simplifies access to medical image assets by normalizing queries, handling DICOMweb interactions, and returning model-friendly payloads (images, metadata, or extracted PDFs).

This server is useful when you need reliable, programmatic access to imaging data for model context, annotation pipelines, or document processing. It reduces the boilerplate of talking directly to PACS (authentication, paging, content negotiation, encapsulation parsing) and presents a consistent API that MCP-aware applications can call to retrieve images and DICOM-encapsulated documents quickly.

Features

  • Query DICOM studies, series, and instances via DICOMweb (QIDO-RS) for rapid discovery
  • Retrieve image frames and derived renderings via WADO-RS/WADO-URI
  • Parse DICOM-encapsulated documents (e.g., PDFs) and return them as application/pdf
  • Configurable DICOMweb endpoint, authentication, and TLS options
  • Optional caching and size limits to improve throughput and protect downstream models
  • Returns MCP-friendly responses (metadata and binary resources) suitable for model context injection

Installation / Configuration

Prerequisites:

  • A DICOMweb-capable PACS or gateway (QIDO/WADO)
  • Docker (recommended) or a compatible runtime
  • Environment variables for your DICOMweb endpoint and credentials

Clone the repository:

git clone https://github.com/ChristianHinge/dicom-mcp.git
cd dicom-mcp

Build and run with Docker:

# Build the local image
docker build -t dicom-mcp .

# Run with environment variables for your DICOMweb server
docker run -p 8080:8080 \
  -e DICOMWEB_BASE_URL="https://pacs.example.org/dicomweb" \
  -e DICOMWEB_USER="username" \
  -e DICOMWEB_PASSWORD="secret" \
  -e CACHE_MAX_ITEMS=100 \
  dicom-mcp

Or run directly (if the repo contains a script/entrypoint):

# Install dependencies if applicable (node/pip/etc)
# Example generic start command
./start-server.sh --port 8080 --dicomweb https://pacs.example.org/dicomweb

Common environment variables (table):

VariablePurposeExample
DICOMWEB_BASE_URLBase URL of the DICOMweb API (QIDO/WADO)https://pacs.example.org/dicomweb
DICOMWEB_USER / DICOMWEB_PASSWORDBasic auth credentials (optional)user / secret
DICOMWEB_TOKENBearer token alternative to user/passwordeyJhbGci…
CACHE_MAX_ITEMSMax objects to hold in cache100
PORTServer listen port8080

Authentication: the server supports simple Basic and Bearer token headers for upstream DICOMweb; for other auth flows (mutual TLS, OAuth) configure a gateway or proxy in front of the DICOMweb endpoint.

Available Tools

The server exposes a small set of MCP-style tools that your model runtime can call. These tools map to common DICOM actions:

  • dicom.query

    • Purpose: search for studies/series/instances using QIDO-RS query parameters.
    • Input: a key-value dictionary of DICOM query keys (PatientID, StudyDate, ModalitiesInStudy, etc.)
    • Output: JSON list of matching resources (study/series/instance metadata)
  • dicom.readDocument

    • Purpose: retrieve a DICOM instance that encapsulates a document (PDF) and return the extracted PDF bytes.
    • Input: identifiers (StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID) or a full WADO URI.
    • Output: application/pdf binary (or a link to a PDF resource) plus metadata.

Example tool invocation payloads (MCP-style):

// Query example
{
  "tool": "dicom.query",
  "input": {
    "StudyInstanceUID": "1.2.840.113619.2.55.3.604688432.783.1596730551.467",
    "limit": 10
Tags:media