Open-source clinical agent infrastructure

Add human-approved AI writeback to your FHIR app.

Last EHR is the open-source reference implementation for that boundary: the agent reads chart context, makes structured proposals, and stops until a person and the FHIR backend authorize the write.

Apache-2.0 reference implementationRead-only MCP surfaceSynthetic-first local evaluation
Inspect the implementation
Clinical action ledgerwrite / paused

Agent request

record_observation({
  patientId: "<synthetic-patient-id>",
  label: "Heart rate",
  value: 72,
  unit: "bpm"
})

needsApproval: true

  1. 01IntentRecord heart rate: 72 bpm
  2. 02ProposalFHIR Observation / not persisted
  3. 03DecisionExplicit reviewer approval required
  4. 04WriteBackend policy is still enforced
ResourceFHIR Observation
PersistenceBlocked pending review
AuthorityFHIR backend policy

The UI is not the authorization layer. It makes the proposed change inspectable before the backend receives it.

The safety contract

A clinical write is a workflow, not an API side effect.

Last EHR does not claim to replace backend policy or clinical judgment. It gives the agent a small, inspectable surface and makes the point of human review impossible to miss.

Read the approval model
01

Read a bounded chart surface

Search and chart reads are explicit tools over FHIR. The backend remains the system of record and access-control boundary.

02

Represent intent as a proposal

A note or observation is shown as a concrete FHIR-shaped change, not hidden as an agent side effect.

03

Require a human decision

The write tool pauses. A reviewer can inspect, approve, or cancel before anything reaches the chart.

System of recordFHIR backend
Agent layerInspectable proposal
DecisionReview + policy
The backend still decides what the signed-in identity can read or write. The local HAPI routes are synthetic evaluation tools, not an authorization model.

MCP, deliberately constrained

MCP should inspect, not quietly write.

The published package is Medplum-only and read-only. The checkout Local Lab lets a developer inspect the same bounded surface against four synthetic HAPI charts before connecting a real project.

No FHIR credential for the Local Lab server.

Fixture-only data on loopback HAPI.

Your client keeps its own model account.

Read the MCP boundary
MCP access pathsread-only

Use with Medplum

$ npx -y @lastehr/mcp init --client claude-code

Prints a client registration command for a least-privilege Medplum token. The published package exposes only reads.

Inspect locally

$ npm run mcp:demo -- --client claude-code

Starts loopback HAPI, resets synthetic fixtures, and prints a direct registration command without FHIR credentials.

Tool manifest

The same two inspectable read tools, with no write flag or arbitrary endpoint.

Published 0.1.x stays read-only.
  • search_patientsFind a seeded synthetic patient by name.READ
  • show_patient_infoOpen one fixture-restricted chart by id.READ
Published package: @lastehr/mcpSupport matrix →

Three useful first moves

Start with evidence, not a sales call.

The project is built for people who need to inspect the safety boundary before they bring an agent anywhere near a real chart. Pick the path that matches the question you have today.

01

See the decision point

Use the live synthetic demo to watch a clinical write become a visible proposal before it is saved.

Open /demoOpen the demo
02

Inspect MCP locally

Start loopback HAPI, reset four fixture charts, and connect Claude Code or Cursor to two read-only tools.

npm run mcp:demoRun the Local Lab
03

Run the Safety Eval

Create a scrubbed report for proposal, approval, denial, chart association, and cleanup on a disposable target.

npm run evalRead the evaluator

An integration should be able to explain itself

Make compatibility a testable claim.

Last EHR keeps the extension point small: a FHIR backend contract, an executable adapter starter, and real HAPI integration coverage. The Safety Eval runs on those same disposable synthetic workflows and writes a scrubbed report, not a broad marketing badge.

Read the adapter contract
Proof surfacesynthetic / CI-backed
01
Web agentTwo write tools are proposal-shaped and approval-gated.
verified
02
MCP Local LabA real stdio handshake reads only fixture-restricted HAPI charts.
verified
03
Adapter seamA reusable FHIR REST baseline and contract harness make the next backend testable.
verified
04
Safety EvalA disposable synthetic workflow report proves approval, denial, chart association, and cleanup mechanics.
verified
The evaluator proves deterministic workflow mechanics, not clinical correctness, HIPAA compliance, or backend RBAC.

Documentation as an operating manual

Make a responsible technical decision faster.

Each guide names the path, the support boundary, and what still needs proof. The docs are a product surface, not a dump of API notes after the fact.

Open the docs hub

Built in the open

Inspect the source before you trust the promise.

Last EHR is Apache-2.0. The code, safety notes, local paths, and support boundaries are public. A future managed offering is optional; the inspectable core is the point.

Not a medical device, a substitute for clinical judgment, an authorization layer, or a HIPAA-ready deployment by default.

Hosted updates

Join only for future managed-service news. Open-source updates ship in the repository first.