# Last EHR > Open-source AI tools for FHIR patient charts: a web app and MCP server for chart reads and human-approved writes. Last EHR is alpha software. Start with synthetic data. Medplum is the supported authenticated backend; other adapters have synthetic evaluation paths. In external model modes, messages and chart context go to the configured provider. The backend remains the system of record. ## Project and overview - [Last EHR](https://www.lastehr.com/): What the tools do, a synthetic example, and current backend support. - [Documentation](https://www.lastehr.com/docs): Setup, architecture, support boundaries, and implementation guides. - [Headless EHR](https://www.lastehr.com/headless-ehr): How a FHIR backend and the application fit together. - [Chart reads](https://www.lastehr.com/chat-with-fhir-data): How chart tools work, incomplete results, and the model-provider data flow. - [Write approvals](https://www.lastehr.com/approval-gated-writes): Proposal, review, cancellation, backend permissions, and MCP approval. - [Medplum setup](https://www.lastehr.com/medplum-ai-agent): Connect a Medplum project, use SMART launch, or install MCP tools. - [Roadmap](https://www.lastehr.com/roadmap): Shipped capabilities and remaining work. - [FHIR MCP servers compared](https://www.lastehr.com/compare/fhir-mcp-servers): Alphabetical comparison of open-source FHIR MCP servers, checked on 2026-11-11. Not a ranking. - [Source repository](https://github.com/cbetz/last-ehr): Apache-2.0 source, tests, releases, and contributions. ## Evaluate - [Quickstart](https://www.lastehr.com/docs/quickstart): Run the zero-key local demo or connect the authenticated Medplum path. - [Supported configurations](https://www.lastehr.com/docs/support): See exactly what is supported, local-only, or still needs an adapter. - [FHIR Coverage](https://www.lastehr.com/docs/fhir-coverage): What the agent can and cannot reach in FHIR, counted against US Core — including the ceiling and the two things that will never be added. ## Understand - [Architecture](https://www.lastehr.com/docs/architecture): Trace the chat route, FHIR tool surface, backend adapters, and data boundary. - [Approval-Gated Writes](https://www.lastehr.com/docs/approval-gates): Understand the proposal-and-review boundary, including its real limits. - [Approval-Gated Agent Writes on FHIR](https://www.lastehr.com/docs/agent-write-protocol): A small, framework-neutral protocol for agent-initiated, human-approved FHIR writes — v0.1 draft, extracted from this repository's two running implementations. - [Threat Model](https://www.lastehr.com/docs/threat-model): Review the assets, trust boundaries, intended controls, and known limitations. ## Build & integrate - [Backend Adapters](https://www.lastehr.com/docs/adapters): Build a verified FHIR backend adapter with the shared contract harnesses. - [Epic and Oracle Health sandboxes](https://www.lastehr.com/docs/epic-cerner): Flag-gated SMART Backend Services adapters for the Epic and Oracle Health sandboxes. Approval-gated Observation writes, synthetic patients only. - [FHIR MCP Server](https://www.lastehr.com/docs/mcp): Connect Claude Code or Cursor to bounded FHIR chart tools for Medplum or local HAPI. Read-only by default, with opt-in human-approved writes. - [Remote FHIR MCP: HTTP and OAuth](https://www.lastehr.com/docs/remote-mcp): Configure optional HTTP transport and per-caller OAuth. Includes the real Keycloak and local Medplum test report, plus remaining deployment and reviewer-verification limits. - [Assistant Work Lab](https://www.lastehr.com/docs/assistant-work): Run a local synthetic work proposal with durable state, separate assistant and reviewer credentials, and a verified FHIR Task result. - [Work MCP Connector](https://www.lastehr.com/docs/work-mcp): Connect an external assistant to local synthetic work with a durable Work ID, separate review, and a verified FHIR Task receipt. - [Grok Bot with Last EHR](https://www.lastehr.com/docs/grok-bot): Connect native Grok Bot to synthetic Work MCP, review a draft in Last, and inspect the recorded human-approved Task result. Self-hosting and the allowlisted pilot have separate setup requirements. - [FHIR Agent Safety Eval](https://www.lastehr.com/docs/evals): Run a disposable synthetic workflow evaluation for the web agent's proposal, approval, denial, and cleanup mechanics. - [Protocol Conformance Suite](https://www.lastehr.com/docs/conformance): Test any implementation of the agent-write protocol with a scripted reviewer and independent FHIR verification. ## Operate & maintain - [Deployment](https://www.lastehr.com/docs/deployment): Configure environment, rate limits, Docker, and public-demo hardening. - [HIPAA Deployment Groundwork](https://www.lastehr.com/docs/hipaa-deployment): Map patient-data flows, qualify exact services and agreements, and identify the evidence still needed before a clinical pilot. - [Adoption Metrics](https://www.lastehr.com/docs/metrics): Measure OSS adoption without collecting chart content or PHI. - [Hosted Synthetic Work](https://www.lastehr.com/docs/hosted-work): Host authenticated MCP with separate human review. Native Grok Bot drafted synthetic work and retrieved its verified receipt; renewal after token expiry is unverified. - [OVHcloud Work Pilot](https://www.lastehr.com/docs/ovh-work): Set up the synthetic Work pilot on an OVHcloud VPS with Auth0, public HTTPS, private FHIR storage, and separate reviewer sign-in. ## Optional - [Full documentation text](https://www.lastehr.com/llms-full.txt): The complete published guide collection, with absolute source and resource links. - [Synthetic demo](https://www.lastehr.com/demo): Interactive chart tools; the demo uses synthetic patients. - [Privacy](https://www.lastehr.com/privacy): Hosted-site analytics, cookies, signup form, and demo processing. ## FAQ ### How do I connect Claude/Cursor to a FHIR server? Run npx -y @lastehr/mcp@0.5.4 init --client claude-code, or npx -y @lastehr/mcp@0.5.4 init --client cursor. The Claude Code command prints a claude mcp add line. The Cursor command prints JSON for ~/.cursor/mcp.json or .cursor/mcp.json, including type stdio. Point that server at a FHIR backend you operate: a Medplum access token (MEDPLUM_ACCESS_TOKEN), or MEDPLUM_CLIENT_ID and MEDPLUM_CLIENT_SECRET, or this repository's local HAPI stack with FHIR_BACKEND=hapi and FHIR_BASE_URL such as http://localhost:8080/fhir. Claude or Cursor supplies the model. The MCP server talks to the FHIR server. Start with synthetic records. Setup: https://www.lastehr.com/docs/mcp ### Can an AI agent write to Epic? Only the public Epic FHIR sandbox, and only with the experimental adapter flag LASTEHR_EXPERIMENTAL_FHIR_ADAPTERS=1. The MCP package selects that sandbox with LASTEHR_BACKEND=epic. The web app selects it with FHIR_BACKEND=epic and the same flag. A write still waits for a person to approve it. The sandbox does not support delete, so an approved Observation stays on that shared sandbox. This is not a connection to a production Epic system. Setup: https://github.com/cbetz/last-ehr/blob/main/docs/adapters/epic-cerner.md ### How does human approval of agent writes work? Writes are off until LASTEHR_MCP_WRITES=proposal. That profile can create a note (Communication), a measurement or a linked correction (Observation), or a follow-up task (Task). Each write pauses until a person approves it in a client that supports MCP elicitation. Approve sends that proposal to the FHIR server. Cancel, or no answer, saves nothing. A client that cannot show the prompt is not offered the write tools. The web app shows the same decision on an approval card. The FHIR server can still reject the write. Approving saves the proposal. It does not review the proposal for clinical correctness. ### Does it use real patient data? No. The public demo and the local HAPI walkthrough use synthetic patients. The Epic and Oracle Health paths use those vendors' public sandboxes and their synthetic sandbox patients. Do not point this alpha software at real patient records while you are evaluating it.