Last EHR — Medplum
MCP server by cbetz Community
Last EHR is an MCP server that lets an AI assistant read a FHIR chart and propose writes that a human must approve before anything is saved. It is aimed at developers and teams building agent workflows on FHIR backends, and it is in early alpha with synthetic data only.
Install Last EHR — Medplum
Built from the published package, never by AI.
claude mcp add last-ehr-medplum -- npx -y @lastehr/mcpRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"last-ehr-medplum": {
"args": [
"-y",
"@lastehr/mcp"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"last-ehr-medplum": {
"args": [
"-y",
"@lastehr/mcp"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"last-ehr-medplum": {
"args": [
"-y",
"@lastehr/mcp"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add last-ehr-medplum -- npx -y @lastehr/mcp{
"mcpServers": {
"last-ehr-medplum": {
"args": [
"-y",
"@lastehr/mcp"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add last-ehr-medplum npx -y @lastehr/mcpGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the last-ehr-medplum block.
About
Last EHR is the agent layer for a headless FHIR EHR. It reads the chart across 25 of US Core 9.0.0's 27 readable resource types and follows references, and it reports when a read was capped or a lookup was refused. Every write is treated as a proposal. The human sees the exact resource, makes an explicit decision, and the approved content is committed and recorded. The gate follows a published draft protocol, Approval-Gated Agent Writes on FHIR, and a conformance suite tests implementations. The published package runs with a Medplum access token, or with a local no-auth HAPI FHIR stack for synthetic records. Experimental Epic and Oracle Health sandbox adapters are available behind a flag. The project is intended for developers and evaluators working with synthetic data. The source states it is not a clinical or compliance tool.
Written from the project's README and checked against it.
Tools it gives your assistant
Chart readsSearches patients, views a patient chart, and reads one filtered chart section.Reference followingFollows references so authors, encounters, and provenance are returned with the read.Approved writesProposes notes, observations, and follow-up tasks that save only after a human approves them.Write conformance checkTests an MCP stdio server's approval gate with independent FHIR reads.Connection checkRuns doctor --connect to check FHIR R4 metadata and a count-only Patient search.
What you need
- Node.js 22.18+ or 24.2+
- Docker daemon for the local HAPI stack
- Medplum project and access token for the authenticated path
- Model API key for a real agent
- Epic or Oracle Health sandbox credentials for the experimental adapters
| Setting | Needed | What it is |
|---|---|---|
MEDPLUM_Environment variable, secret | Optional | FHIR chart tools over Medplum or a local HAPI stack: read-only by default, with an opt-in elicitation-gated write profile (human-approved per action). |
MEDPLUM_Environment variable | Optional | FHIR chart tools over Medplum or a local HAPI stack: read-only by default, with an opt-in elicitation-gated write profile (human-approved per action). |
MEDPLUM_Environment variable, secret | Optional | FHIR chart tools over Medplum or a local HAPI stack: read-only by default, with an opt-in elicitation-gated write profile (human-approved per action). |
MEDPLUM_Environment variable | Optional | FHIR chart tools over Medplum or a local HAPI stack: read-only by default, with an opt-in elicitation-gated write profile (human-approved per action). |
LASTEHR_Environment variable | Optional | epic, oracle, or smart. Requires LASTEHR_EXPERIMENTAL_FHIR_ADAPTERS=1. Sandbox writes are approval-gated and persist because those sandboxes do not support delete. |
LASTEHR_Environment variable | Optional | Set to 1 to enable LASTEHR_BACKEND epic, oracle, or smart. |
LASTEHR_Environment variable | Optional | SMART Backend Services client id. Not a secret. |
LASTEHR_Environment variable, secret | Optional | PKCS#8 PEM for SMART private_key_jwt. Never log it. |
LASTEHR_Environment variable | Optional | Path to the PKCS#8 PEM. Alternative to LASTEHR_PRIVATE_KEY. |
LASTEHR_Environment variable | Optional | JWT kid. Must match the public JWKS. |
LASTEHR_Environment variable | Optional | https URL of the public JWKS. doctor checks that LASTEHR_KEY_ID is present. Optional. |
LASTEHR_Environment variable | Optional | Space-delimited SMART scopes. Required for Oracle. Omit for Epic unless overriding the app registration. |
LASTEHR_Environment variable | Optional | FHIR base URL. Epic and Oracle default to their public sandboxes when unset. |
LASTEHR_Environment variable | Optional | SMART token URL. Epic and Oracle default to their public sandboxes when unset. |
LASTEHR_Environment variable | Optional | Encounter/{id} added to Epic observations when the tool call omits encounter. |
LASTEHR_Environment variable | Optional | Practitioner/{id} filed as legal authenticator on Oracle observations. |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Find patients named Smith
- Record a heart rate of 72 bpm for Maria Garcia
- Show the chart for a synthetic patient
Good to know
- Early alpha; APIs and scope will change.
- Use synthetic data only. Not a clinical or compliance claim.
- Epic and Oracle adapters stay behind LASTEHR_EXPERIMENTAL_FHIR_ADAPTERS=1 and cannot delete sandbox writes.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to Last EHR — Medplum
All alternatives →Standardizes lab test names to LOINC codes and units to UCUM, and symptoms and diagnoses to ICPC-3, offline and with no API key. Built for people who want their health records on their own machine and queryable by an AI agent over MCP.
RuView is a WiFi sensing platform and MCP server that uses low-cost ESP32 sensors to detect people, breathing and heart rate. It is for developers and operators who want room sensing without cameras or wearables.
ToolUniverse is an MCP server that gives AI assistants access to more than 2,700 scientific tools for life science, research and literature. It is aimed at AI scientists, researchers and developers building research systems.
Mirobody is a self-hosted engine that turns lab reports, wearable data and genetic files into a single health record. Its built-in MCP server lets an AI assistant query that record and trace each number back to its source file. It is for people who want their health data on their own machine.
ScanSci PDF gets academic papers for AI agents. Give it a DOI, arXiv ID, article link, reference list or research question, and it searches candidate sources and tries to fetch accessible full texts. It is for students, researchers and labs.
Searches CNKI and Web of Science through an MCP server, returning records with impact factors. It can also open a paper in the user's signed-in browser and read its full text. Built for researchers who want AI answers on science topics backed by the source article.
Compare with Mirobody, Ruview or tooluniverse
Last EHR — Medplum: common questions
How does the approval gate work?
The agent proposes a write and shows the exact resource. Nothing is saved until a human explicitly approves it, and the approved content is what gets committed.
Can I try it without an account?
The source describes a no-account local path that runs a HAPI FHIR stack with synthetic patients through Docker. The published package can also print client configuration without creating an account.
Which FHIR backends are supported?
Medplum is the supported backend for authenticated deployments. HAPI FHIR, Firely Server, Aidbox, and Oystehr are used for synthetic evaluation, and Epic and Oracle Health sandboxes are experimental.
How do I install Last EHR — Medplum?
In Claude Code run claude mcp add last-ehr-medplum -- npx -y @lastehr/mcp. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Last EHR — Medplum the official server?
Last EHR — Medplum is a community project by cbetz, not verified by a company domain.
Is Last EHR — Medplum free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is Last EHR — Medplum safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Last EHR — Medplum?
Similar MCP servers: Mirobody, Ruview, tooluniverse, Mirobody.
Does Last EHR — Medplum work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
