Provides a universal MCP interface to multiple FHIR backends with AI-powered clinical insights.
Configuration
View docs{
"mcpServers": {
"kushagra-dutta-fhir-mcp": {
"url": "http://localhost:9090",
"headers": {
"OPENAI_API_KEY": "your-key-here"
}
}
}
}You can run and connect to a universal FHIR MCP server that centralizes access to multiple FHIR sources, performs AI-powered clinical insights, and exposes robust data retrieval capabilities. This server enables you to switch between FHIR endpoints, run patient searches, retrieve complete patient data, and leverage AI features for clinical analysis, all through a single MCP interface.
Set up your MCP client to connect to the FHIR MCP server and start performing common healthcare data tasks. You will switch between configured FHIR servers, search for patients, retrieve comprehensive patient information, and invoke AI-powered analyses such as keyword extraction, code mapping, and similar-patient matching. Use the MCP client to trigger actions and receive structured results that combine data from multiple FHIR sources with AI-derived insights.
Prerequisites: You need Python 3.11 or higher and access to FHIR servers. You will also need an OpenAI API key to enable AI features.
1. Clone the MCP project and navigate into the directory.
2. Install dependencies.
3. Configure environment variables for AI access.
4. Start the MCP server to begin serving requests.
The MCP server is configured to expose a single local MCP command that starts the server process. Use this entry to run the server locally and make it available to clients.
{
"mcpServers": {
"fhir_server": {
"command": "python",
"args": ["fhir_server.py"],
"env": {
"OPENAI_API_KEY": "your-key-here"
}
}
}
}Protect your OpenAI API key and other sensitive data. Use secure storage for environment variables and follow your organizationβs security practices for credentials, access control, and auditing.
This MCP server provides a suite of tools to manage and query FHIR data and apply AI-powered analysis. You can switch between servers, search for patients, retrieve and aggregate patient data, extract clinical keywords from notes, map terms to FHIR codes, and find similar patients.
If you encounter connectivity issues to a FHIR server, run diagnostics to verify server health, review logs for errors, and confirm that environment variables are set correctly. Use the MCP client to test server connectivity and to diagnose capabilities.
This MCP setup supports AI-assisted clinical workflows by combining data from multiple FHIR servers with AI-derived insights, enabling more informed patient care while maintaining secure access and auditability.
Switch between configured FHIR servers by selecting a target server name.
Test connectivity to a specified FHIR server and report health status.
Search for patients using criteria such as family name, given name, and birthdate.
Retrieve complete patient information including demographics, conditions, medications, encounters, and more.
Fetch the condition data associated with a patient.
Fetch the medication data associated with a patient.
Retrieve vital signs and time-series observations for a patient.
Fetch laboratory results for a patient.
Retrieve patient encounters and related context.
Retrieve allergy information for a patient.
Fetch procedures performed for a patient.
Extract clinical keywords and concepts from free text using AI.
Map clinical terms to standardized FHIR codes.
Find patients with similar clinical profiles based on criteria.
Extract all condition codes from FHIR data.
List all configured FHIR servers available to the MCP.
Provide a registry of all known FHIR servers and their configurations.
Diagnose capabilities and health of a specified FHIR server.
Clear the cache that stores condition codes for quick access.
Report statistics for the condition code cache.