clinical-fhir-agent
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
clinical-fhir-agent
An MCP server and LLM agent that answer clinical questions about synthetic FHIR R4 patients — with every answer cited, refusals when the data don't support an answer, and a reproducible evaluation of how often it gets things right.
⚠️ Not a medical device. This is an engineering and portfolio project. It uses synthetic data only (Synthea), is not certified, and must not be used with real patient data or to make health decisions. See intended use.
Why this project
Demos of LLM agents on medical data are easy; knowing how often they are wrong, and how is the hard part. This project treats the evaluation as the main deliverable:
a golden set whose expected answers are computed from the FHIR data, not written from memory or by an LLM;
a dev/test split by patient, so prompt tuning never sees the held-out data;
metrics for accuracy, hallucination, citation validity and correct refusal, per question category, with confidence intervals over repeated runs;
versioned, regenerable reports tied to a commit, a model ID and a dataset digest.
Development follows a lightweight version of the processes used for medical-device software (IEC 62304, ISO 14971): requirements, risk analysis with risk controls verified by evaluation metrics, SOUP list (the LLM included), and traceability enforced in CI.
Related MCP server: his-tools
System overview
Synthea cohort (pinned) ──► local HAPI FHIR R4 ◄── REST ── MCP server (read-only tools)
▲ MCP
LLM agent ────┘
→ {answer, citations[], refused}
▲
evaluation: oracle golden set → runner → scorers → reportDetails: architecture and ADRs.
Status
Milestone 0 (foundations) complete: a pinned synthetic cohort of 50 patients, loaded into a local FHIR server by a loader that accepts only verified synthetic data. Milestone 1 (MCP server) in progress. See milestones.
Milestone | Content |
M0 | Repository, CI, process documents, synthetic cohort, local FHIR server |
M1 | MCP server with read-only FHIR tools |
M2 | Agent with cited answers and refusals |
M3 | Evaluation v1: golden set, deterministic scorers, baseline report |
M4 | Evaluation v2: hallucinations, calibrated judge, adversarial cases, held-out run |
M5 | System card, final risk review, results |
Development
Requires uv and Docker.
uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run mypy
uv run python scripts/traceability.py --checkDocumentation
Document | Content |
Purpose, scope, foreseeable misuse, assumed safety class | |
Lifecycle, roles, verification strategy | |
What the software must do, and how each requirement is verified | |
Hazards of a wrong answer and their controls | |
Third-party software, services and models | |
Pending decisions and known gaps |
License
Code: Apache-2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and read patients, conditions, observations and prescriptions in Medplum.
Synthetic EHR: medications, labs, conditions, allergies, immunizations, FHIR R4. No API key.
Privacy-preserving synthetic health data generation. FHIR R4/R5 compliant.
Read patient-authorized EHR records: medications, labs, conditions, allergies. Consent-bounded.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes a FHIR endpoint as deterministic read-only tools, providing a context layer for retrieving clinical data from FHIR servers.MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to query de-identified FHIR-shaped hospital data through audited, read-only tools for patients, encounters, conditions, observations, medications, and interaction checks, while any medication write stays a draft that a clinician must confirm out-of-band.MIT
- AlicenseAqualityCmaintenanceGives AI agents read-only access to patient context on any FHIR R4 server, including journey timelines of encounters and appointments, open booking slots, and discharged patients whose follow-ups were never booked. Search, appointment, and follow-up tools return compact summaries, so agents can answer front-desk and outreach questions without write access.5MIT
- AlicenseAqualityBmaintenanceRead-only FHIR chart tools for agents, with opt-in human-approved write proposals through MCP elicitation.44Apache 2.0