A Model Context Protocol implementation for FHIR
[!WARNING] This is an experimental demo not intended for production use.
This is a TypeScript-based MCP server that connects to a FHIR server. It provides core MCP functionality for interacting with FHIR resources by:
[!TIP] "Resources" here refers to the MCP definition not the FHIR one. MCP Resources are a core primitive in the Model Context Protocol (MCP) that allow servers to expose data and content that can be read by clients and used as context for LLM interactions.
fhir:// URIssearch_fhir - Search FHIR resources
resourceType and searchParams as parametersread_fhir - Read an individual FHIR resource
uri as a parameterThe server requires the following environment variables:
FHIR_BASE_URL: The base URL of your FHIR serverFHIR_ACCESS_TOKEN: A SMART on FHIR access token for authenticationInstall dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"fhir": {
"command": "/path/to/@flexpa/mcp-fhir/build/index.js"
},
"env": {
"FHIR_BASE_URL": "<FHIR_BASE_URL>",
"FHIR_ACCESS_TOKEN": "<FHIR_ACCESS_TOKEN>"
}
}
}
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
{
"mcpServers": {
"mcp-fhir": {
"command": "/path/to/@flexpa/mcp-fhir/build/index.js",
"args": []
}
}
}Related projects feature coming soon
Will recommend related projects based on sub-categories