This guide explains how to configure and use different FHIR servers with the DICOM MCP server.
URL: https://server.fire.ly
Features:
- Public test server (no API key required)
- FHIR R4 compliant
- Reliable and always available
- Good for testing and development
Configuration:
fhir_servers:
firely:
base_url: "https://server.fire.ly"
description: "Firely FHIR Test Server (public, no API key needed)"
current_fhir: "firely"Reference: Firely Server
URL: https://hackathon.siim.org/fhir
Features:
- SIIM-specific FHIR server
- Requires API key authentication
- May require VPN or network access
Configuration:
fhir_servers:
siim:
base_url: "https://hackathon.siim.org/fhir"
api_key: "${SIIM_API_KEY}" # Set in .env file
description: "SIIM Hackathon FHIR server"
current_fhir: "siim"Setup:
- Add
SIIM_API_KEY=your-key-hereto your.envfile - Set
current_fhir: "siim"inconfiguration.yaml
URL: http://localhost:8080/fhir
Features:
- Full control over the server
- No network dependencies
- Good for local development and testing
- Can load test data
Setup:
- Start HAPI FHIR Server:
cd tests
docker-compose -f docker-compose-fhir.yaml up -d- Verify it's running:
curl http://localhost:8080/fhir/metadata- Configure in
configuration.yaml:
fhir_servers:
hapi_local:
base_url: "http://localhost:8080/fhir"
description: "Local HAPI FHIR server"
current_fhir: "hapi_local"- Access HAPI UI:
- HAPI JPA Server UI: http://localhost:8080/hapi-fhir-jpaserver/
- Base FHIR endpoint: http://localhost:8080/fhir
Stop HAPI Server:
docker-compose -f docker-compose-fhir.yaml downYou can configure multiple FHIR servers in configuration.yaml:
fhir_servers:
firely:
base_url: "https://server.fire.ly"
description: "Firely FHIR Test Server"
siim:
base_url: "https://hackathon.siim.org/fhir"
api_key: "${SIIM_API_KEY}"
description: "SIIM Hackathon FHIR server"
hapi_local:
base_url: "http://localhost:8080/fhir"
description: "Local HAPI FHIR server"
current_fhir: "firely" # Switch to firely, siim, or hapi_localYou can switch between configured FHIR servers in two ways:
Use the switch_fhir_server tool to change servers without restarting:
# Example: Switch to SIIM server
switch_fhir_server(server_name="siim")
# Verify the switch
verify_fhir_connection()This is the preferred method as it doesn't require restarting the MCP server.
-
Update
configuration.yaml:- Change
current_fhir: "server_name"to the desired server
- Change
-
Restart MCP Server:
- The MCP server needs to be restarted for the change to take effect
-
Verify with tools:
- Use
list_fhir_serversto see available servers - Use
verify_fhir_connectionto test the current server
- Use
Once a FHIR server is configured, you'll have access to:
verify_fhir_connection- Test FHIR server connectivitylist_fhir_servers- List configured FHIR serversswitch_fhir_server- Switch to a different FHIR server without restartingfhir_search_patient- Search for Patient resourcesfhir_search_imaging_study- Search for ImagingStudy resourcesfhir_read_resource- Read any FHIR resource by type and IDfhir_create_resource- Create new FHIR resourcesfhir_update_resource- Update existing FHIR resources
If you see connection timeouts:
- Check network/firewall settings
- Verify the server URL is correct
- Test with
curlto see if the server is reachable - For SIIM, check if VPN or IP whitelisting is required
If you see SSL errors:
- The code already has SSL verification disabled for development
- Try HTTP instead of HTTPS if the server supports it
- Check if the server requires specific TLS versions
If authentication fails:
- Verify the API key is set in
.envfile - Check that the environment variable name matches (
SIIM_API_KEY) - Ensure the API key format is correct for the server