Last EHR — Medplum

v0.5.6
io.github.cbetz/last-ehr Checked 20 hours ago Published 3 days ago

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

Values you need

VariableWhat it is
MEDPLUM_ACCESS_TOKENoptional secret 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_CLIENT_IDoptional 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_CLIENT_SECREToptional secret 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_BASE_URLoptional 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_BACKENDoptional 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_EXPERIMENTAL_FHIR_ADAPTERSoptional Set to 1 to enable LASTEHR_BACKEND epic, oracle, or smart.
LASTEHR_CLIENT_IDoptional SMART Backend Services client id. Not a secret.
LASTEHR_PRIVATE_KEYoptional secret PKCS#8 PEM for SMART private_key_jwt. Never log it.
LASTEHR_PRIVATE_KEY_PATHoptional Path to the PKCS#8 PEM. Alternative to LASTEHR_PRIVATE_KEY.
LASTEHR_KEY_IDoptional JWT kid. Must match the public JWKS.
LASTEHR_JWKS_URLoptional https URL of the public JWKS. doctor checks that LASTEHR_KEY_ID is present. Optional.
LASTEHR_SCOPESoptional Space-delimited SMART scopes. Required for Oracle. Omit for Epic unless overriding the app registration.
LASTEHR_FHIR_BASE_URLoptional FHIR base URL. Epic and Oracle default to their public sandboxes when unset.
LASTEHR_TOKEN_URLoptional SMART token URL. Epic and Oracle default to their public sandboxes when unset.
LASTEHR_ENCOUNTERoptional Encounter/{id} added to Epic observations when the tool call omits encounter.
LASTEHR_PERFORMERoptional Practitioner/{id} filed as legal authenticator on Oracle observations.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add last-ehr -- npx -y --package=@lastehr/mcp@0.5.6 lastehr-mcp
Add to claude_desktop_config.json
{
  "mcpServers": {
    "last-ehr": {
      "args": [
        "-y",
        "--package=@lastehr/mcp@0.5.6",
        "lastehr-mcp"
      ],
      "command": "npx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "last-ehr": {
      "args": [
        "-y",
        "--package=@lastehr/mcp@0.5.6",
        "lastehr-mcp"
      ],
      "command": "npx"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "last-ehr": {
      "args": [
        "-y",
        "--package=@lastehr/mcp@0.5.6",
        "lastehr-mcp"
      ],
      "command": "npx",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.last-ehr]
command = "npx"
args = ["-y", "--package=@lastehr/mcp@0.5.6", "lastehr-mcp"]

For AI agents

  1. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  2. Restart or reload the client so it starts the server.
  3. Verify: the server should expose these tools: search_patients, show_patient_info, read_chart_section, read_document.
  4. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json