HealthChain
Typed, validated FHIR tools for healthcare AI agents — build, read, validate, and code FHIR resources from a patient bundle, with terminology lookup and machine-readable validation reports built for fix-and-retry.
README
<!-- mcp-name: io.github.healthchainai/healthchain -->
<div align="center" style="margin-bottom: 1em;">
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/brand/lockup/lockup-stacked-white.png"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/brand/lockup/lockup-stacked-black.png" alt="HealthChain" width="400"> </picture>
<!-- Project Badges -->
</div>
<h2 align="center" style="border-bottom: none">Open-Source Python SDK for Healthcare AI</h2>
<div align="center">
Agents read clinical data fine — writing it back correctly is the hard part, and generic agent frameworks don't check it. HealthChain gives any model or agent typed, validated FHIR tools they can trust: the right code from the right system, on the right patient, with a valid status. Plus real-time EHR connectivity and production deployment — so what you build holds up outside the demo.
</div>
Installation
pip install healthchain
Quick Start
# Scaffold a FHIR Gateway project
healthchain new my-app -t fhir-gateway
cd my-app
# Run locally
healthchain serve
<div align="center"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/demo.gif" alt="HealthChain CLI demo" width="700"> </div>
Edit app.py to add your model, and healthchain.yaml to configure deployment settings.
See the CLI reference for all commands.
Building with an AI assistant? Point it at llms.txt for a map of the current API docs.
Core Features
The quickest way for AI developers and researchers to ship healthcare AI — everything you need out of the box, built to scale with you.
<table> <tr> <td width="50%" valign="top"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-aggregation-dark.svg"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-aggregation-light.svg" alt="Epic, Cerner and your EHR flow through FHIRGateway into one patient record; manual extracts are crossed out" width="100%"> </picture> <div align="center"> <br> <a href="https://healthchainai.github.io/HealthChain/reference/gateway/gateway/"><strong>🔌 Multi-EHR Data Aggregation</strong></a> <br><br> <div>Connect to live FHIR APIs across Epic, Cerner, and more — and move research pipelines off manual database extracts onto data infrastructure that scales past one site</div><br> <a href="https://healthchainai.github.io/HealthChain/cookbook/multi_ehr_aggregation/">Getting Started →</a> <br><br> </div> </td> <td width="50%" valign="top"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-fhir-dark.svg"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-fhir-light.svg" alt="Messy model output goes through validate_resource and comes out as FHIR you can trust" width="100%"> </picture> <div align="center"> <br> <a href="https://healthchainai.github.io/HealthChain/reference/utilities/fhir_helpers/"><strong>🔥 FHIR as a Superpower</strong></a> <br><br> <div>Type-safe FHIR resources, validation that catches broken data before it ships, and terminology lookups — the strict schema that turns healthcare data into a built-in unit test</div><br> <a href="https://healthchainai.github.io/HealthChain/reference/utilities/fhir_helpers/">Getting Started →</a> <br><br> </div> </td> </tr> <tr> <td width="50%" valign="top"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-agent-tools-dark.svg"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-agent-tools-light.svg" alt="FHIRToolkit serves typed FHIR tools to Claude over MCP and to LangChain agents" width="100%"> </picture> <div align="center"> <br> <a href="https://healthchainai.github.io/HealthChain/reference/utilities/tools/"><strong>🤖 Tools Your Agents Can Trust</strong></a> <br><br> <div>Hand any agent typed, validated FHIR tools from one toolkit — served to Claude over MCP or dropped into LangChain, so what your agent writes is valid and correctly coded</div><br> <a href="https://healthchainai.github.io/HealthChain/reference/utilities/tools/">Getting Started →</a> <br><br> </div> </td> <td width="50%" valign="top"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-fhir-qa-dark.svg"> <img src="https://raw.githubusercontent.com/healthchainai/HealthChain/main/docs/assets/images/cards/hc-card-fhir-qa-light.svg" alt="A patient question plus the live FHIR record produces a grounded answer" width="100%"> </picture> <div align="center"> <br> <a href="https://healthchainai.github.io/HealthChain/cookbook/fhir_qa/"><strong>💬 FHIR-Grounded Patient Q&A</strong></a> <br><br> <div>Answer patient questions from their live clinical record — the foundational pattern for portal chatbots and care-plan assistants, with a schema for truth</div><br> <a href="https://healthchainai.github.io/HealthChain/cookbook/fhir_qa/">Getting Started →</a> <br><br> </div> </td> </tr> </table>
Why HealthChain?
Every serious healthcare AI project builds the same integration infrastructure from scratch. Whether you're deploying a logistic regression, a 70B-parameter model, or an agentic workflow, the wall between a trained model and a live clinical system is the same: real FHIR APIs, validated writes, multi-site deployments, auditable governance. No off-the-shelf solution exists, and engineers who understand both AI and healthcare protocols are scarce and hard to retain.
HealthChain handles that complexity so you can focus on what actually matters: the model and the patient.
- Optimized for real-time - Connect to live FHIR APIs and integration points instead of stale data exports
- Validation built in - Type-safe FHIR resources and validation reports that catch broken data before it ships — including spec-invalid clinical codes that type checks alone let through
- No invented facts - Helpers never add clinical claims you didn't pass: no auto-generated timestamps, no guessed statuses — what enters the record is exactly what your model produced
- Bring any model or agent - LLMs, agents, or classical ML — and output validated FHIR
- Works with your existing stack - Integrates with FastAPI, MCP, and LangChain
- Production-ready foundations - Dockerized deployment, configurable security, and an architecture built for NHS and HIPAA environments
🏆 Recognition & Community
Featured & Presented:
- Featured in TLDR AI Newsletter (900K+ developers)
- Featured by Medplum for open source integration with Epic
- Presented at NHS Python Open Source Conference (watch talk)
- Built from NHS AI deployment experience – read the origin story
🤝 Partnerships & Production Use
Exploring HealthChain for your product or organization? Get in touch to discuss integrations, pilots, or collaborations, or join our Discord to connect with the community.
Usage Examples
Creating a Gateway [Docs]
from healthchain.gateway import HealthChainAPI, FHIRGateway
from healthchain.fhir.r4b import Patient
# Create healthcare application
app = HealthChainAPI(title="Multi-EHR Patient Data")
# Connect to multiple FHIR sources
fhir = FHIRGateway()
fhir.add_source("epic", "fhir://fhir.epic.com/r4?client_id=epic_client_id")
fhir.add_source("cerner", "fhir://fhir.cerner.com/r4?client_id=cerner_client_id")
@fhir.aggregate(Patient)
def enrich_patient_data(id: str, source: str) -> Patient:
"""Get patient data from any connected EHR and add AI enhancements"""
bundle = fhir.search(
Patient,
{"_id": id},
source,
add_provenance=True,
provenance_tag="ai-enhanced",
)
return bundle
app.register_gateway(fhir)
# Available at: GET /fhir/transform/Patient/123?source=epic
# Available at: GET /fhir/transform/Patient/123?source=cerner
if __name__ == "__main__":
app.run(port=8888)
Giving an Agent FHIR Tools [Docs]
from healthchain.tools import FHIRToolkit
# One toolkit: build, validate, read, and code FHIR — as typed agent tools
kit = FHIRToolkit(bundle="patient_bundle.json")
kit.as_mcp().run() # serve to Claude or any MCP client
tools = kit.as_langchain() # or drop into a LangChain agent
Or straight from the terminal, no code:
healthchain mcp --bundle patient_bundle.json
🛣️ What we're building towards
- [x] 🔒 Security foundations — API-key authentication, audit logging, and TLS, configured via
healthchain.yamland enforced by the gateway middleware - [ ] 📋 Governance as config — clinical safety, data access agreements, and compliance standards for NHS/HIPAA deployments as a first-class deployment artifact in
healthchain.yaml - [ ] 🔌 Deeper EHR connectivity — more FHIR sources, live data patterns, and real-world integration examples from pilot deployments
- [ ] 📊 Observability — deployment telemetry and audit trails for healthcare systems
- [x] 🤖 A toolkit for clinical AI agents — typed FHIR tools with validation and terminology built in, served over MCP and LangChain
🤝 Contributing
HealthChain is built by and for the next generation of healthcare developers — researchers moving models from retrospective data into live systems, AI developers who don't want to spend months learning FHIR before they can ship anything. The best contributions come from people who have hit a real problem and have something specific to say about it.
Get started:
- Working with healthcare or research data? Contribute a cookbook — bring your use case, I'll personally support you through it
- Read CONTRIBUTING.md for guidelines
- Technical questions and ideas → GitHub Discussions
- Pilots and partnerships → email
🤗 Acknowledgements
This project builds on fhir.resources and CDS Hooks standards developed by HL7 and Boston Children's Hospital.
See also groundeval — the open-source eval harness for healthcare AI agents.
© 2024–2026 dotimplement ai. HealthChain is an open source project maintained by dotimplement ai.
<!-- Badge Links -->
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。