Specialist fields

HealthChain: self-checking FHIR tools for agents

A healthcare AI Python SDK with an MCP server: agents build FHIR resources from flat fields, validate value sets, look up real codes and read patient bundles.

Project and installation docs

View project

https://github.com/healthchainai/HealthChain

Ask a model to write FHIR JSON directly and the usual failure is a valid structure with invented codes: a plausible SNOMED code that doesn’t exist, which type checks won’t catch. HealthChain’s FHIRToolkit closes the build, validate and correct loop. The agent fills flat fields, the tools assemble and validate the resource, and codes can only come from a terminology lookup. HealthChain is a Python SDK for healthcare AI from a team with NHS deployment experience, with about 230 stars as of 2026-10-06.

What it does

  • build_resource: builds Condition, MedicationStatement, Observation, AllergyIntolerance and Patient resources from flat fields, with dosage split into dose_value, dose_unit and frequency_per_day, and validates the result immediately.
  • validate_resource: checks any FHIR resource, required value-set bindings included, and reports issues the model can fix.
  • Patient bundles: load_bundle loads one, get_resources returns a resource type, get_coded_entries flattens coded entries into code, display, status and value, and resolve_reference follows references.
  • Terminology: lookup_code and list_codes search a code catalog, which you can swap for your own terminology service.
  • Errors as values: every tool returns problems as {"ok": false, ...} instead of raising, so one bad call doesn’t kill the agent loop.

Who it’s for

  • Engineers building clinical documentation or record-structuring apps whose model output must be valid FHIR.
  • Researchers prototyping healthcare agents on Synthea synthetic data.

Setup

Needs Python. Install the MCP extra, start it on a patient bundle, and register it with Claude Code:

pip install healthchain[mcp]
healthchain mcp --bundle synthea_patient.json
claude mcp add healthchain -- healthchain mcp

Our take

It does a different job from WSO2’s FHIR MCP Server. WSO2’s is a general interface to a live FHIR server; HealthChain checks whether what the model writes is correct, working on local bundles, which suits the generation and validation step. MCP is one part of a larger SDK, and the gateway and sandbox features have their own docs. The toolkit holds one bundle at a time, so multi-patient work needs the host app to swap bundles. Generated clinical records still need review by qualified staff and aren’t medical advice. Licensed Apache-2.0.