FHIR MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FHIR MCP ServerSearch for patients with diabetes and show their medications."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FHIR MCP Server
A comprehensive Model Context Protocol (MCP) server that provides FHIR (Fast Healthcare Interoperability Resources) functionality with advanced data quality assessment and error handling capabilities.
🎯 Overview
This MCP server bridges the gap between AI applications and FHIR healthcare data systems, providing robust tools for accessing patient information, clinical data, and assessing data quality across different FHIR servers. Perfect for healthcare AI development, clinical research, and testing FHIR implementations.
Related MCP server: FHIR Careplan
✨ Key Features
🏥 Comprehensive FHIR Resource Access
Patient Management: Search, retrieve, and analyze patient demographics
Clinical Data: Access observations, conditions, medications, diagnostic reports
Care Coordination: Retrieve care plans and treatment information
Server Capabilities: Query FHIR server metadata and supported features
🔍 Advanced Data Quality Assessment
Quality Scoring: 0-100 data quality scores for FHIR servers
Integrity Checks: Detect orphaned references and disconnected data
Validation: Comprehensive FHIR response validation
Issue Detection: Identify data consistency problems automatically
🛡️ Enhanced Error Handling
HTTP Status Handling: Proper 404, 401, 403, timeout responses
FHIR OperationOutcome: Standards-compliant error reporting
Detailed Logging: Request/response debugging information
Graceful Degradation: Continues operation despite server issues
🧰 Developer-Friendly Tools
Async Architecture: High-performance async/await implementation
Pagination Support: Handle large datasets efficiently
Flexible Configuration: Environment-based server configuration
MCP Integration: Seamless Claude Desktop integration
🚀 Quick Start
Prerequisites
Python 3.11 or newer
Claude Desktop (for MCP integration)
Installation
Clone the repository
git clone https://github.com/jcafazzo/fhir-mcp.git cd fhir-mcpInstall dependencies
pip install -r requirements.txtConfigure Claude Desktop
Add to your
claude_desktop_config.json:{ "mcpServers": { "fhir-server": { "command": "python3", "args": ["/path/to/fhir-mcp/fhir_mcp_server.py"], "env": { "FHIR_BASE_URL": "https://r4.smarthealthit.org" } } } }Restart Claude Desktop
🔧 Configuration
Environment Variables
Variable | Description | Default |
| FHIR server endpoint |
|
| Bearer token for authentication | None |
Recommended FHIR Servers
Server | URL | Quality | Use Case |
SMART Health IT |
| ⭐⭐⭐⭐⭐ | Production testing |
Firely Server |
| ⭐⭐⭐⭐ | Development |
HAPI Test |
| ⭐⭐ | Basic testing |
🛠️ Available Tools
Core Patient Tools
get_patient- Retrieve specific patient by IDsearch_patients- Search patients by name/familysearch_all_patients- Get all patients (paginated)
Clinical Data Tools
search_observations- Find lab results, vital signs, measurementssearch_conditions- Access diagnoses and medical conditionssearch_medication_requests- Retrieve prescriptions and medicationssearch_diagnostic_reports- Get lab reports and diagnostic studiessearch_care_plans- Access treatment and care plans
Quality & Diagnostics
assess_data_quality- Comprehensive server quality assessmentfind_patients_with_conditions- Identify patients with clinical dataget_capability_statement- Query server capabilities
📊 Usage Examples
Basic Patient Search
"Search for patients named 'Smith' and show their demographics"Diabetes Management Workflow
"Find all patients with diabetes conditions, then show their:
- Current medications
- Recent glucose observations
- Active care plans
- Latest diagnostic reports"Data Quality Assessment
"Assess the data quality of this FHIR server and identify any issues"Research Query
"Find patients with conditions containing 'diabetes' and analyze their
medication patterns over time"🏥 Healthcare Use Cases
Clinical Research
Population Studies: Analyze patient cohorts across multiple conditions
Treatment Outcomes: Track medication effectiveness and care plan adherence
Data Quality: Validate FHIR implementations before production use
AI Development
Training Data: Access clean, validated healthcare datasets
Model Testing: Evaluate AI models against real clinical scenarios
Integration Testing: Verify FHIR API compatibility
Quality Assurance
Server Validation: Assess FHIR server implementations
Data Integrity: Identify orphaned records and missing references
Compliance Testing: Verify standards adherence
🔒 Security & Privacy
No PHI Storage: Server operates read-only, no data retention
Configurable Auth: Support for Bearer token authentication
Audit Logging: Comprehensive request/response logging
Error Handling: Secure error responses without data leakage
🧪 Testing
Test Server Quality
# Test different FHIR servers
python3 fhir_mcp_server.pyUse the assess_data_quality tool to evaluate:
Data completeness (0-100 score)
Reference integrity
Resource availability
Error rates
Synthetic Data Testing
Works excellently with:
Synthea: Realistic synthetic patient data
MIMIC-IV FHIR: Real anonymized hospital data
Custom datasets: Load your own test data
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
# Clone and setup development environment
git clone https://github.com/jcafazzo/fhir-mcp.git
cd fhir-mcp
pip install -r requirements.txt
python3 fhir_mcp_server.py # Test locallyRoadmap
Bulk FHIR operations support
Temporal data analysis tools
Enhanced MIMIC-IV integration
Performance optimization
Additional FHIR resource types
📚 Documentation
CLAUDE.md - Claude Code integration guide
FHIR R4 Specification - Official FHIR documentation
MCP Protocol - Model Context Protocol specification
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
HL7 FHIR Community for the FHIR specification
Anthropic for the Model Context Protocol
SMART Health IT for excellent test servers
Synthea Project for realistic synthetic data
📞 Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: Check CLAUDE.md for detailed setup
Built with ❤️ for the healthcare AI community
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA Model Context Protocol server that connects AI tools to Electronic Health Records using SMART on FHIR, allowing secure searching, querying, and analysis of patient data from compatible EHRs.Last updated84MIT
- Flicense-qualityDmaintenanceA comprehensive Model Context Protocol server that provides universal access to multiple FHIR servers with AI-powered clinical analysis capabilities for healthcare data integration and patient care planning.Last updated3
- AlicenseAqualityCmaintenanceAn MCP server that connects AI assistants to OpenEMR instances to manage patient records, clinical trends, and medication safety. It provides 17 tools for tasks such as patient search, drug interaction checks, and generating comprehensive health trajectories and visit preparations.Last updated17MIT
- Alicense-qualityCmaintenanceA clean-room SHARP-on-MCP compliant FHIR R4 MCP server that enables AI agents to interact with any FHIR R4 endpoint using SHARP context headers, without server-side OAuth. It provides clinical tools, lab results, imaging, and interactive MCP-UI dashboards.Last updatedMIT
Related MCP Connectors
Hosted MCP server exposing US hospital procedure cost data to AI assistants
MCP Hub: AI service discovery, per-user OAuth, and multi-service workflow orchestration
MCP gateway federating 21 biomedical MCP servers behind one endpoint: gnomAD, ClinVar, HPO, VEP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcafazzo/fhir-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server