🐍 🏠 ☁️ - Connect to FHIR servers, for example to query patient history in natural language
FHIR MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Model Context Protocol (MCP) Server for Fast Healthcare Interoperability Resources (FHIR)
📋 Table of Contents
- 🔍 About
- 💡 Demo
- 🚀 Getting Started
- 📝 Usage
- 🔧 Configuration
- 🐳 Docker Setup
- 🛠️ MCP Tools
- 🗺️ Roadmap
- 👥 Contributors
- 📄 License
🔍 About The Project
**FHIR MCP Server** implements a complete Model Context Protocol (MCP) server, designed to facilitate seamless interaction between LLM-based agents and a FHIR-compliant backend. It provides a standardized interface that enables full CRUD operations on FHIR resources through a comprehensive suite of tools - accessible from MCP-compatible clients such as Claude Desktop, allowing users to query and manipulate clinical data using natural-language prompts.
✨ Key Features
- **🚀 FastMCP Framework**: Built on FastMCP for high-performance MCP server capabilities
- **🏥 FHIR Resource Management**: Full CRUD operations for all major FHIR resources
- **📄 Intelligent Document Processing**: AI-powered document ingestion and chunking for multiple formats including TXT, CSV, JSON, and PDF
- **🔍 Semantic Search**: Advanced document search using vector embeddings (via Pinecone)
- **🧠 RAG-Ready**: Retrieval-Augmented Generation pipeline with context-aware document queries
- **🔐 Secure Authentication**: OAuth2 token management for FHIR API integration
- **📊 LOINC Integration**: Standardized medical terminology lookup and validation
- **🐳 Container Ready**: Docker support for easy deployment and scaling
- **🔧 Configurable**: Extensive -based configuration options
🏗️ Architecture
The server is built with a modular architecture:
- **MCP Tools**: Dedicated tools for selected FHIR resource types, with others handled by a generic tool
- **Fhir Server Client**: Handles FHIR API communication and authentication (OAuth2 and more planned)
- **RAG Services**: Embedding-based document processing and semantic retrieval
- **Vector Store**: Pinecone integration for similarity-based search
- **LOINC Client**: Integration with LOINC API for terminology resolution and validation
( back to top )
💡 Demo
This demo shows how Claude uses the fhir-mcp-server to communicate with a FHIR server (in this case Medplum) to answer questions. You will see, among other things:
- utilization of the request_patient_resource tool which retrieves basic patient information
- utilization of the request_condition_resource tool to answer the question whether any of the previously diagnosed diseases may cause symptoms that the patient is currently complaining about
- utilization of the request_medication_resource, request_encounter_resource, request_generic_resource tools to answer the question whether the patient has already received any treatment for hypertension
You can observe how Claude automatically selects the tools worth using to answer the question based on the user's query.
https://github.com/user-attachments/assets/3a3a8ed3-f881-447d-af03-5f24432a2cdd
Lab History Analysis
Here you can observe how Claude first uses the tool searching for LOINC codes for the lipid panel specific codes, but not finding any related observations in FHIR server, it repeats the search for individual biomarkers that make up such a panel.
https://github.com/user-attachments/assets/2fb39801-d5d6-4461-bedd-9f58ab4d52ec
FHIR Synthetic Data Generator
Developers working with FHIR often need to generate specific test data to validate FHIR server functionality, such as search capabilities and data relationships. While you can use Synthea to generate synthetic data and then manually import the resulting bundles to your server, fhir-mcp-server streamlines this process by allowing you to generate and deploy test data directly through Claude.
This eliminates the typical workflow of running synthea separately, downloading bundles, and manually importing them to your FHIR server. Instead, you can create targeted test scenarios, generate appropriate synthetic data, and populate your server all within Claude's interface.