Agent♥︎Age
Catalog

Last EHR — Medplum

Official

by cbetz · TypeScript

FHIR chart tools for MCP: read-only by default, with elicitation-gated, human-approved writes.

io.github.cbetz/last-ehr MCP Server

This Model Context Protocol (MCP) server provides FHIR chart tools for MCP clients. It connects over a Medplum project or the Last EHR repository’s local HAPI evaluation stack (using FHIR_BACKEND=hapi with synthetic data only). Reads are available read-only by default, with optional elicitation-gated, human-approved writes.

🛠️ Key Features

  • FHIR chart tools for MCP clients
  • Read-only by default
  • Reads mirror the Last EHR web agent: search patients, show whole chart, read 23 patient-scoped chart sections with filters, and read a document’s text
  • Optional opt-in write proposals via LASTEHR_MCP_WRITES=proposal
  • Write actions require explicit human approval; writes are never saved without approval

🚀 Use Cases

  • Patient discovery through patient search
  • Retrieving an entire FHIR chart
  • Section-level chart reads using filters (23 patient-scoped sections)
  • Extracting text from a document

⚡ Developer Benefits

  • Predictable read-only behavior for chart retrieval
  • Human-in-the-loop control for write proposals
  • Uses MCP to expose chart-reading capabilities to clients

⚠️ Limitations

  • Synthetic data only in the local HAPI evaluation stack (FHIR_BACKEND=hapi)
  • Writes are opt-in and hidden unless enabled with LASTEHR_MCP_WRITES=proposal

Topics

ehrfhirmedplumai-agentshealthcarehealthcare-aihl7-fhirhuman-in-the-loopmcpmcp-servermodel-context-protocolnextjssmart-on-fhirtypescriptai-safetyaidboxhapi-fhiroystehrheadless-ehr