# Last EHR — Medplum

> Last EHR — Medplum is an open-source MCP server for health and science. Read-only FHIR chart tools for MCP, with human-approved writes. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://www.lastehr.com/docs/mcp
- **Repository:** https://github.com/cbetz/last-ehr/tree/HEAD/packages/mcp
- **MCP Registry name:** io.github.cbetz/last-ehr
- **Categories:** health and science, developer tools
- **Listing updated:** 2026-11-14

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
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
```

### Claude Desktop (claude_desktop_config.json)

```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>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```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>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```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>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```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>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```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>"
      }
    }
  }
}
```

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Tooluniverse](https://ai-powered.com/mcp/tooluniverse): Tooluniverse is an open-source MCP server for health and science.

---
Source: https://ai-powered.com/mcp/last-ehr-medplum
