Skip to content

Use the MCP server

pacs-mcp is a standalone MCP server. It exposes three tools over FHIR R4 REST and IRIS vector search. It does not call the KomPACS API.

  • Python 3.12 or later and uv.
  • A FHIR R4 server. For search_reports: IRIS with the vec.ReportSentence table.
  • The pacs-mcp package source.
VariableRequiredUse
PACS_MCP_DATAyessynthetic (test data) or eu-data-zone (real data, EU Data Zone client only). The server refuses to start without it.
FHIR_BASEyesFHIR R4 base URL
FHIR_USER, FHIR_PASSWORDnoBasic auth for the FHIR server
IRIS_HOST, IRIS_PORT, IRIS_NAMESPACE, IRIS_USER, IRIS_PASSWORDfor search_reportsIRIS SQL connection. Use a least-privilege user.
Terminal window
PACS_MCP_DATA=synthetic FHIR_BASE=http://localhost:52773/fhir/r4 uv run pacs-mcp

The transport is stdio. The client starts the server as a child process.

Example client config, for a synthetic FHIR server only:

{
"mcpServers": {
"pacs": {
"command": "uv",
"args": ["run", "--directory", "mcp", "pacs-mcp"],
"env": {
"FHIR_BASE": "http://localhost:52773/fhir/r4",
"PACS_MCP_DATA": "synthetic"
}
}
}
}

Inspect the tools with the MCP Inspector:

Terminal window
PACS_MCP_DATA=synthetic FHIR_BASE=http://localhost:52773/fhir/r4 \
npx @modelcontextprotocol/inspector uv run pacs-mcp

A typical agent loop:

  1. The agent lists the tools and sends them with the question to the LLM.
  2. The LLM asks for a tool call, for example get_case_summary.
  3. The agent calls the tool and returns the result.
  4. After up to 6 rounds, the LLM answers with FHIR references.

The LLM never calls MCP directly. The agent is the MCP client.

Tools: MCP tools reference.