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.
npx -y @ChristianHinge/dicom-mcpOverview
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:
Build and run with Docker:
# Build the local image
# Run with environment variables for your DICOMweb server
Or run directly (if the repo contains a script/entrypoint):
# Install dependencies if applicable (node/pip/etc)
# Example generic start command
Common environment variables (table):
| Variable | Purpose | Example |
|---|---|---|
| DICOMWEB_BASE_URL | Base URL of the DICOMweb API (QIDO/WADO) | https://pacs.example.org/dicomweb |
| DICOMWEB_USER / DICOMWEB_PASSWORD | Basic auth credentials (optional) | user / secret |
| DICOMWEB_TOKEN | Bearer token alternative to user/password | eyJhbGci… |
| CACHE_MAX_ITEMS | Max objects to hold in cache | 100 |
| PORT | Server listen port | 8080 |
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