Last EHR — Medplum
Read-only FHIR chart tools for MCP, with human-approved writes
- Pricing
- Open source
- Platforms
- CLI, self-hosted
- Runs
- Locally
- Version
- 0.5.4
- Listing updated
- 3 days ago
About Last EHR — Medplum
Last EHR — Medplum is an open-source MCP server for health and science. It runs locally on your machine and is started by your AI client.
The notable choice here is that writes are opt-in and gated by a person. By default the package offers four read tools: patient search, chart overview, a filtered chart section covering 23 patient-scoped sections that report incomplete or unsupported reads, and inline document text. Setting LASTEHR_MCP_WRITES=proposal adds four write tools for notes (Communication), measurements and linked corrections (Observation) and follow-up tasks (Task). Each needs a human approval prompt, so a client without MCP elicitation support gets no write tools. Existing records are never updated or deleted.
It works with hosted or self-hosted Medplum, a no-auth HAPI stack for local synthetic testing, and an in-memory synthetic store started with init --demo that needs no account or Docker. Experimental adapters reach the Epic and Oracle Health sandboxes and generic SMART Backend Services, which the project says are not a supported production setup.
The server returns chart data to your MCP client, which may pass it to its model provider; the package itself calls no model. The project states that its notes are not a clinical or compliance claim and suggests starting with synthetic records.
Install
Run in a terminal
claude mcp add last-ehr --env MEDPLUM_ACCESS_TOKEN='<MEDPLUM_ACCESS_TOKEN>' --env MEDPLUM_CLIENT_SECRET='<MEDPLUM_CLIENT_SECRET>' --env LASTEHR_PRIVATE_KEY='<LASTEHR_PRIVATE_KEY>' -- npx -y @lastehr/mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"last-ehr": {
"command": "npx",
"args": [
"-y",
"@lastehr/mcp"
],
"env": {
"MEDPLUM_ACCESS_TOKEN": "<MEDPLUM_ACCESS_TOKEN>",
"MEDPLUM_CLIENT_SECRET": "<MEDPLUM_CLIENT_SECRET>",
"LASTEHR_PRIVATE_KEY": "<LASTEHR_PRIVATE_KEY>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"last-ehr": {
"command": "npx",
"args": [
"-y",
"@lastehr/mcp"
],
"env": {
"MEDPLUM_ACCESS_TOKEN": "<MEDPLUM_ACCESS_TOKEN>",
"MEDPLUM_CLIENT_SECRET": "<MEDPLUM_CLIENT_SECRET>",
"LASTEHR_PRIVATE_KEY": "<LASTEHR_PRIVATE_KEY>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"last-ehr": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@lastehr/mcp"
],
"env": {
"MEDPLUM_ACCESS_TOKEN": "<MEDPLUM_ACCESS_TOKEN>",
"MEDPLUM_CLIENT_SECRET": "<MEDPLUM_CLIENT_SECRET>",
"LASTEHR_PRIVATE_KEY": "<LASTEHR_PRIVATE_KEY>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"last-ehr": {
"command": "npx",
"args": [
"-y",
"@lastehr/mcp"
],
"env": {
"MEDPLUM_ACCESS_TOKEN": "<MEDPLUM_ACCESS_TOKEN>",
"MEDPLUM_CLIENT_SECRET": "<MEDPLUM_CLIENT_SECRET>",
"LASTEHR_PRIVATE_KEY": "<LASTEHR_PRIVATE_KEY>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"last-ehr": {
"command": "npx",
"args": [
"-y",
"@lastehr/mcp"
],
"env": {
"MEDPLUM_ACCESS_TOKEN": "<MEDPLUM_ACCESS_TOKEN>",
"MEDPLUM_CLIENT_SECRET": "<MEDPLUM_CLIENT_SECRET>",
"LASTEHR_PRIVATE_KEY": "<LASTEHR_PRIVATE_KEY>"
}
}
}
}Configuration
MEDPLUM_ACCESS_TOKENFHIR 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_CLIENT_IDFHIR 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_CLIENT_SECRETFHIR 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_BASE_URLFHIR 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_BACKENDepic, oracle, or smart. Requires LASTEHR_EXPERIMENTAL_FHIR_ADAPTERS=1. Sandbox writes are approval-gated and persist because those sandboxes do not support delete.LASTEHR_EXPERIMENTAL_FHIR_ADAPTERSSet to 1 to enable LASTEHR_BACKEND epic, oracle, or smart.LASTEHR_CLIENT_IDSMART Backend Services client id. Not a secret.LASTEHR_PRIVATE_KEYPKCS#8 PEM for SMART private_key_jwt. Never log it.LASTEHR_PRIVATE_KEY_PATHPath to the PKCS#8 PEM. Alternative to LASTEHR_PRIVATE_KEY.LASTEHR_KEY_IDJWT kid. Must match the public JWKS.LASTEHR_JWKS_URLhttps URL of the public JWKS. doctor checks that LASTEHR_KEY_ID is present. Optional.LASTEHR_SCOPESSpace-delimited SMART scopes. Required for Oracle. Omit for Epic unless overriding the app registration.LASTEHR_FHIR_BASE_URLFHIR base URL. Epic and Oracle default to their public sandboxes when unset.LASTEHR_TOKEN_URLSMART token URL. Epic and Oracle default to their public sandboxes when unset.LASTEHR_ENCOUNTEREncounter/{id} added to Epic observations when the tool call omits encounter.LASTEHR_PERFORMERPractitioner/{id} filed as legal authenticator on Oracle observations.
What it does
- Four read tools
- Patient search, chart overview, filtered section and inline document text.
- Approval-gated writes
- Notes, observations and tasks need a human approval prompt.
- Demo mode
- init --demo runs synthetic patients in-process with no account.
- Medplum and HAPI
- Works with Medplum projects and a local HAPI evaluation stack.
- SMART sandboxes
- Experimental Epic and Oracle Health sandbox adapters.
- 23 chart sections
- The section reader covers 23 patient-scoped sections.
Good for
- Prototype a chart-summary agent on synthetic patients
- Let an agent draft a note that a clinician approves
- Explore a FHIR record set through natural language
- Test SMART Backend Services against vendor sandboxes
Pricing
Open source
Open-source package
Prices change. Check lastehr.com before you buy.
Last EHR — Medplum FAQ
Are writes enabled by default?
No. It is read-only unless LASTEHR_MCP_WRITES=proposal is set, and each write needs approval.
Where does patient data go?
It goes from the FHIR backend to your MCP client, which may send it to its model provider.
Can I try it without a backend?
Yes, init --demo uses a synthetic in-memory store.
Which backends work?
Medplum, a local HAPI stack, and experimental Epic, Oracle Health and SMART sandbox adapters.
Is Last EHR — Medplum free?
Yes. Last EHR — Medplum is open source, so you can use and self-host it for free.
How do I add Last EHR — Medplum to Claude Code?
Run this command in your terminal: claude mcp add last-ehr --env MEDPLUM_ACCESS_TOKEN='<MEDPLUM_ACCESS_TOKEN>' --env MEDPLUM_CLIENT_SECRET='<MEDPLUM_CLIENT_SECRET>' --env LASTEHR_PRIVATE_KEY='<LASTEHR_PRIVATE_KEY>' -- npx -y @lastehr/mcp
What are the best alternatives to Last EHR — Medplum?
The closest alternatives to Last EHR — Medplum are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Last EHR — Medplum

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools