Medplum integration

Connect Last EHR to your Medplum project

Search patients, read their charts, and propose notes, observations, and follow-up tasks. Medplum stores the records and enforces access; Last EHR supplies the chat interface and write approval cards.

Run against your project

You need a Medplum project and a supported model credential. Start from the repository's environment example:

git clone https://github.com/cbetz/last-ehr.git
cd last-ehr
npm install
cp .env.example .env.local

Configure the Medplum client credentials, backend URL if self-hosted, and model provider in .env.local. Follow the quickstart to seed a dedicated synthetic project and start the app. The agent's FHIR calls use the authenticated identity for the active session and remain subject to Medplum's AccessPolicy.

Last EHR is alpha software. Use synthetic records for evaluation. Messages and chart context go to the configured model provider; review the data boundary before connecting a project.

Launch from a Medplum patient chart

Register a ClientApplication in your Medplum project with these values, replacing the example host with your deployment:

launchUri:   https://your-deployment.example/launch
redirectUri: https://your-deployment.example/launch/callback

Set SMART_CLIENT_ID to that application's ID. Launching from the Medplum Apps tab opens Last EHR with the selected patient and reuses the Medplum sign-in. The resulting session follows the granted SMART scopes and backend permissions. Writes still require approval.

Read the full Medplum quickstart

Use chart tools in your own MCP client

For an existing agent client, use the standalone MCP package instead of the web interface:

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

Configure a least-privilege Medplum identity using the MCP guide. The package offers patient search, chart sections, and document text through the same readers as the web agent. It is read-only by default; the optional write profile requires a compatible client and approval for each action.