OpenEHR MCP Server

# openEHR MCP Server An MCP (Model Context Protocol) server designed to interface with openEHR REST APIs, specifically the EHRbase implementation.

Local serverstdioPython

What is the OpenEHR MCP server?

openEHR MCP Server An MCP (Model Context Protocol) server designed to interface with openEHR REST APIs, specifically the EHRbase implementation. This server enables MCP clients like Claude Desktop to create compositions for openEHR. The openehr mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 13 defined tools rather than through you.

Its toolset

Everything the assistant can do here goes through one of these:

  • openehr_template_list — List all available openEHR templates from the EHRbase server
  • openehr_template_get — Retrieve a specific openEHR template by its unique identifier
  • openehr_template_example_composition — Generate an example openEHR composition based on a specific template
  • openehr_ehr_create — Create a new EHR in the system
  • openehr_ehr_get — Retrieve an EHR by its ID
  • openehr_ehr_list — List all available EHRs in the system
  • openehr_ehr_get_by_subject — Get an EHR by subject ID and namespace
  • openehr_composition_create — Create a new openEHR composition in the Electronic Health Record
  • openehr_composition_get — Retrieve an existing openEHR composition by its unique identifier
  • openehr_composition_update — Update an existing openEHR composition in the Electronic Health Record
  • openehr_composition_delete — Delete an existing openEHR composition from the Electronic Health Record
  • openehr_query_adhoc — Execute an ad-hoc AQL query against the openEHR server

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Configuration

You will need one environment variable: EHRBASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • A working Docker installation * Python 3 (this project was built with python 3.12, earlier versions might work) * A Python virtual environment (pip, conda or uv) * Install the required dependencies in your Python environment:

When to reach for it

Plenty of cloud and infrastructure servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. OpenEHR's toolset — openehr_template_list, openehr_template_get, openehr_template_example_composition and 10 more — is a fair guide to whether it matches your workflow. It is maintained by deak-ai; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 13 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch OpenEHR.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the openehr mcp server does with a few real requests.

Available tools

ToolWhat it does
openehr_template_listList all available openEHR templates from the EHRbase server
openehr_template_getRetrieve a specific openEHR template by its unique identifier
openehr_template_example_compositionGenerate an example openEHR composition based on a specific template
openehr_ehr_createCreate a new EHR in the system
openehr_ehr_getRetrieve an EHR by its ID
openehr_ehr_listList all available EHRs in the system
openehr_ehr_get_by_subjectGet an EHR by subject ID and namespace
openehr_composition_createCreate a new openEHR composition in the Electronic Health Record
openehr_composition_getRetrieve an existing openEHR composition by its unique identifier
openehr_composition_updateUpdate an existing openEHR composition in the Electronic Health Record
openehr_composition_deleteDelete an existing openEHR composition from the Electronic Health Record
openehr_query_adhocExecute an ad-hoc AQL query against the openEHR server
PrerequisitesThe Prerequisites tool exposed by this server.

How to install the OpenEHR MCP server

{
  "mcpServers": {
    "openEHR": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--network=host",
        "-e","EHRBASE_URL=http://localhost:8080/ehrbase/rest",
        "-e","EHRBASE_JSON_FORMAT=wt_flat",
        "ctodeakai/openehr-mcp-server:latest"
      ]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • A working Docker installation * Python 3 (this project was built with python 3.12, earlier versions might work) * A Python virtual environment (pip, conda or uv) * Install the required dependencies in your Python environment:
VariableDescriptionRequired
EHRBASE_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use OpenEHR to openehr template list.
  • Use OpenEHR to openehr template get.
  • Use OpenEHR to openehr template example composition.

Frequently asked questions

An EHRbase server, an openEHR template uploaded to that server, and an existing EHR with its ID for compositions.