Back to catalog
FHIR MCP Server
An MCP server that provides seamless integration with FHIR API, acting as a bridge between AI/LLM tools and medical data for searching, retrieving, and analyzing clinical information.
Get this MCP server
An MCP server that provides seamless integration with FHIR API, acting as a bridge between AI/LLM tools and medical data for searching, retrieving, and analyzing clinical information.
Installation
PyPI Package
uvx fhir-mcp-server
From Source
git clone <repository_url>
cd <repository_directory>
uv venv
source .venv/bin/activate
uv pip sync requirements.txt
uv run fhir-mcp-server
Docker
docker pull wso2/fhir-mcp-server:latest
docker run --env-file .env -p 8000:8000 fhir-mcp-server
Docker Compose
docker-compose up -d
Configuration
Claude Desktop - Streamable HTTP
{
"mcpServers": {
"fhir": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8000/mcp"
]
}
}
}
Claude Desktop - STDIO
{
"mcpServers": {
"fhir": {
"command": "uv",
"args": [
"--directory",
"/path/to/fhir-mcp-server",
"run",
"fhir-mcp-server",
"--transport",
"stdio"
],
"env": {
"FHIR_SERVER_ACCESS_TOKEN": "Your FHIR Access Token"
}
}
}
}
VS Code - Streamable HTTP
"mcp": {
"servers": {
"fhir": {
"type": "http",
"url": "http://localhost:8000/mcp",
}
}
}
Available Tools
| Tool | Description |
|---|---|
get_capabilities |
Retrieves metadata about a specific FHIR server |
Features
- MCP-compatible transport via stdio, SSE, or streamable HTTP
- SMART-on-FHIR authentication support for secure connection to FHIR servers
- Tool integration with VS Code, Claude Desktop, and MCP Inspector
- OAuth 2.0 Authorization Code Grant flow support
- Integration with Epic EHR ecosystem and HAPI FHIR servers
Environment Variables
Required
FHIR_SERVER_BASE_URL- Base URL of the FHIR server
Optional
FHIR_SERVER_CLIENT_ID- OAuth2 client ID used for authorizing MCP clients with the FHIR serverFHIR_SERVER_CLIENT_SECRET- Client secret corresponding to the FHIR client IDFHIR_SERVER_SCOPES- Space-separated list of OAuth2 scopes to request authorization from the FHIR serverFHIR_SERVER_DISABLE_AUTHORIZATION- When set to True, disables authorization checks on the MCP serverFHIR_MCP_HOST- Hostname or IP address that the MCP server should bind toFHIR_MCP_PORT- Port on which the MCP server will listen for incoming client requestsFHIR_SERVER_ACCESS_TOKEN- Access token for authenticating requests to the FHIR server
Notes
Supports Python 3.8+, requires uv for dependency management. When running locally via Docker, authorization should be disabled by setting FHIR_SERVER_DISABLE_AUTHORIZATION=True. Includes demo integrations with HAPI FHIR server and Epic Sandbox.
