FHIR MCP Server — Claude Code MCP server: setup
Connect an AI coding client to a FHIR API to search and retrieve clinical data. Use it when you need FHIR access from Claude Code or another supported client.
claude mcp add fhir-mcp-server -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-serverWhat FHIR MCP Server does
This server connects MCP clients to FHIR APIs over stdio, SSE, or streamable HTTP. Results from read and search can be narrowed with FHIRPath expressions. You need an accessible FHIR API, Python 3.8+, and uv for dependency management.
To run the PyPI package, set FHIR_SERVER_BASE_URL and launch uvx fhir-mcp-server. Authorization starts enabled; configure FHIR_SERVER_CLIENT_ID, FHIR_SERVER_CLIENT_SECRET, and FHIR_SERVER_SCOPES for it. Local Docker and Docker Compose runs require FHIR_SERVER_DISABLE_AUTHORIZATION=True; otherwise authorization prevents the documented local setup from working.
What it helps with
- connect an AI client to a FHIR API
- search clinical resources on a FHIR server
- retrieve FHIR data with the
readoperation - filter resource fields with FHIRPath
Example prompts for the agent
- Search the connected FHIR server for patient resources matching these criteria.
- Retrieve this resource from FHIR and return only the fields needed for the task.
- Search for resources and filter the results with a FHIRPath expression.
How to install FHIR MCP Server
Platform CLI
claude mcp add fhir-mcp-server -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-serverReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>
Platform CLI
codex mcp add fhir-mcp-server --env FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-serverReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>
Config file
{
"mcpServers": {
"fhir-mcp-server": {
"command": "uvx",
"args": [
"fhir-mcp-server"
],
"env": {
"FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>
Config file
{
"servers": {
"fhir-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"fhir-mcp-server"
],
"env": {
"FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>
Platform CLI
gemini mcp add -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> fhir-mcp-server uvx fhir-mcp-serverReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about FHIR MCP Server
How do I install FHIR MCP Server in Claude Code?
Set the FHIR API address with claude mcp add fhir-mcp-server -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-server. This registers the server over stdio.
What does FHIR MCP Server do?
It lets an MCP client search and retrieve information through a FHIR API. You can also apply FHIRPath expressions to read and search results.
What does FHIR MCP Server need to run?
It needs an accessible FHIR API, Python 3.8+, and uv for dependency management. Authorization is enabled by default and uses client credentials and scopes.