openehr-assistant-mcp
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 14 GitHub stars
Code Pass
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
This MCP server acts as a bridge between AI assistants and openEHR healthcare APIs, helping users navigate complex clinical models, terminology services, and syntax validation tasks.
Security Assessment
Overall Risk: Medium. The tool inherently interacts with openEHR healthcare APIs and Clinical Knowledge Manager (CKM) repositories, meaning it handles requests that could contain sensitive clinical data or protected health information. A light scan of 12 files found no dangerous patterns, hardcoded secrets, or malicious code execution mechanisms. It does not request dangerous local permissions. However, users should be aware of what clinical data is being sent to external APIs during operation and ensure proper network security controls are in place.
Quality Assessment
The project is actively maintained, with its most recent push occurring today. It uses a permissive MIT license and has established automated CI/CD workflows for PR validation and Docker image releases. The codebase requires PHP 8.4. While it has a small but respectable community backing with 14 GitHub stars, the README explicitly notes that the project is in a "pre-release state." Users should anticipate potential breaking changes to the architecture and features before version 1.0 is finalized.
Verdict
Use with caution — the code itself is clean and safe, but the pre-release status means it is still undergoing heavy changes, and handling healthcare data via external APIs always warrants strict operational oversight.
A Model Context Protocol (MCP) Server to assist you on various openEHR related tasks and APIs
The openEHR Assistant MCP Server
The MCP Server to assist end-user on various openEHR related tasks and APIs.
The Model Context Protocol (MCP) is an open standard that enables AI assistants to connect to external data sources and tools in a secure and standardized way. MCP servers act as bridges between AI clients (like Claude Desktop, Cursor, or LibreChat) and domain-specific APIs, databases, or knowledge bases.
The openEHR Assistant MCP Server brings this power to the healthcare informatics domain, specifically targeting openEHR modelers and developers.
Working with openEHR archetypes, templates, and specifications often involves navigating complex APIs, searching through Clinical Knowledge Manager (CKM) repositories, understanding intricate type systems, and ensuring compliance with ADL syntax rules.
Many of these workflows, such as archetype design, template composition, terminology resolution, and syntax validation, are repetitive, time-consuming, and sometimes too complex to automate.
This server augments these workflows by providing AI assistants with direct access to openEHR resources, terminology services, and CKM APIs, enabling them to assist with tasks like archetype exploration, semantic explanation, language translation, syntax correction, and design reviews.
NOTE:
This project is currently in a pre-release state. Expect frequent updates and potential breaking changes to the architecture and feature set until version 1.0.
Recommended: For the best experience, pair this MCP server with the openEHR Assistant Plugin, which adds skills, rules, and agents that guide AI assistants through openEHR workflows. Claude Code users can install it directly from the Cadasto Plugin Marketplace.
Table of Contents
- Features
- Available MCP Elements
- Transports
- Quick Start
- Common client configurations
- Development tips
- Contributing
- Acknowledgments
Features
- Works with MCP clients such as Claude Desktop, Cursor, LibreChat, etc.
- Exposes tools for openEHR Archetypes and specifications.
- Guided Prompts help orchestrate multi-step workflows.
- Run remotely (endpoint URL: https://openehr-assistant-mcp.apps.cadasto.com/) or locally (transports: streamable HTTP and stdio)
Implementation aspects
- Made with PHP 8.4; PSR-compliant codebase
- Attribute-based MCP tool discovery (via https://github.com/mcp/sdk) with file-based cache
- Attribute-based MCP prompt discovery (seeded conversations for complex tasks) with file-based cache
- MCP Resource templates and Completion Providers for better UX in MCP clients
- Transports: streamable HTTP and stdio (for development)
- Docker images for production and development
- Structured logging with Monolog
Available MCP Elements
Tools
CKM (Clinical Knowledge Manager)
ckm_archetype_search- List Archetypes from the CKM server matching search criteriackm_archetype_get- Get a CKM Archetype by its identifierckm_template_search- List Templates (OET/OPT) from the CKM server matching search criteriackm_template_get- Get a CKM Template (OET/OPT) by its identifier
openEHR Terminology
terminology_resolve- Resolve an openEHR terminology concept ID to its rubric, or find the ID for a given rubric across groups.
Guides (model-reachable)
guide_search- Search bundled guides by query and return short snippets with canonical openehr://guides URIs.guide_get- Retrieve guide content by URI or (category, name) with chunked sections by default.guide_adl_idiom_lookup- Lookup targeted ADL idiom snippets from the cheatsheet for common modelling patterns.
openEHR Type specification
type_specification_search- List bundled openEHR Type specifications matching search criteria.type_specification_get- Retrieve an openEHR Type specification (as BMM JSON).
Prompts
Optional prompts that guide AI assistants through common openEHR and CKM workflows using the tools above.
ckm_archetype_explorer- Explore CKM Archetypes by discovering and fetching definitions (ADL/XML/Mindmap), usingckm_archetype_searchandckm_archetype_gettools.ckm_template_explorer- Explore CKM Templates by discovering and fetching definitions (OET/OPT), usingckm_template_searchandckm_template_gettools.type_specification_explorer- Discover and fetch openEHR Type specifications (as BMM JSON) usingtype_specification_searchandtype_specification_gettools.terminology_explorer- Discover and retrieve openEHR terminology definitions (groups and codesets) using terminology resources.guide_explorer- Discover and retrieve openEHR implementation guides usingguide_search,guide_get, andguide_adl_idiom_lookuptools.explain_archetype- Explain an archetype’s semantics (audiences, elements, constraints).explain_template- Explain openEHR Template semantics.explain_aql- Explain the intent, structure, and semantics of an AQL query (containment, archetype paths, filters, deployed OPT assumptions).translate_archetype_language- Translate an archetype’s terminology section between languages with safety checks.fix_adl_syntax- Correct or improve Archetype syntax without changing semantics; provides before/after and notes.design_or_review_archetype- Design or review task for a specific concept/RM class with structured outputs.design_or_review_template- Design or review task for an openEHR Template (OET).design_or_review_aql- Design or review task for an AQL query, using AQL guides (principles, syntax, idioms, checklist).design_or_review_simplified_format- Design or review a Flat or Structured (simplified) format instance, using Simplified Formats guides.explain_simplified_format- Explain context, paths, and data elements of a Flat or Structured JSON payload.
Completion Providers
Completion providers supply parameter suggestions in MCP clients when invoking tools or resources.
Guides- suggests guide{name}values for categoriesarchetypes,templates,aql, andsimplified_formats(resource URIopenehr://guides/{category}/{name})SpecificationComponents- suggests{component}values based on directories inresources/bmmresource URI
Resources
MCP Server Resources are exposed via #[McpResource] annotated methods and can be fetched by MCP clients using openehr://... URIs.
They are used to provide access to openEHR resources (guides, specifications, terminology) and to orchestrate complex workflows.
Guides (Markdown)
- URI template:
openehr://guides/{category}/{name} - On-disk mapping:
resources/guides/{category}/{name}.md - Model access: use
guide_searchandguide_getto retrieve guide content in short, task-relevant chunks. - Examples:
openehr://guides/archetypes/checklistopenehr://guides/archetypes/adl-syntaxopenehr://guides/aql/principlesopenehr://guides/aql/syntaxopenehr://guides/simplified_formats/rules
Type Specifications (BMM JSON)
- URI template:
openehr://spec/type/{component}/{name} - On-disk mapping:
resources/bmm/{COMPONENT}/{NAME}.bmm.json - Examples:
openehr://spec/type/RM/COMPOSITIONopenehr://spec/type/AM/ARCHETYPEopenehr://spec/type/AM2/ARCHETYPE_HRID
Terminologies (JSON)
- URI:
openehr://terminologycontains all terminology groups and codesets - Provides access to both terminology groups (concepts/rubrics) and codesets.
- On-disk mapping:
resources/terminology/openehr_terminology.xml
Transports
MCP Transports are used to communicate with MCP clients.
streamable-http(default): HTTPS (port 443); dev setup exposes an additional HTTP port8343via Caddy.stdio: Suitable for process-based MCP clients, or for local development.- Start option: pass
--transport=stdiotopublic/index.php.
- Start option: pass
Quick Start
To get started, use one of the following options:
- No local setup (fastest): use our hosted endpoint.
- Local via Docker (recommended for contributors): run the server with
docker compose. - Local via stdio: run as a process for MCP clients that prefer stdio.
Option 1: Use our hosted server (no install)
If you just want to use this MCP server with minimal setup, start here.
Use this MCP server URL directly in your client:
- URL:
https://openehr-assistant-mcp.apps.cadasto.com/ - Transport:
streamable-http
Example MCP config:
{
"mcpServers": {
"openehr-assistant-remote": {
"type": "streamable-http",
"url": "https://openehr-assistant-mcp.apps.cadasto.com/"
}
}
}
See below for more specific client configurations.
Option 2: Run locally with Docker (recommended for contributors)
Use this when editing tools/prompts/resources and wanting immediate feedback.
Prerequisites
- Docker + Docker Compose
- Git
1) Clone the repository
git clone https://github.com/cadasto/openehr-assistant-mcp.git
cd openehr-assistant-mcp
2) Prepare environment
cp .env.example .env
Tip: Default values work for most users. You usually only need to edit
.envif you want to change domain, logging, or CKM endpoint.
3) Start dev containers
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml up -d --build --force-recreate
# or
make up-dev
4) Install Composer dependencies
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec -u 1000:1000 app composer install
# or
make install
5) Connect your MCP client
- Default local endpoint (streamable HTTP):
https://openehr-assistant-mcp.local/; set also this name in your host file, asscociating it with127.0.0.1 openehr-assistant-mcp.local. - Dev endpoint (with dev override):
http://localhost:8343/
If
openehr-assistant-mcp.localdoes not resolve on your machine, use the dev setup below and connect tohttp://localhost:8343/.
Alternatively, use stdio by running a similar command to the following when you want your MCP client to launch the server process directly.
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec app php public/index.php --transport=stdio
Option 3: Run locally via stdio
Use stdio when your MCP client launches the server process directly.
Make sure your MCP client supports stdio transport and runs one of the following commands.
1) From dev containers
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec app php public/index.php --transport=stdio
2) From a published Docker image
docker run --rm -i ghcr.io/cadasto/openehr-assistant-mcp:latest php public/index.php --transport=stdio
Common client configurations
Typical configuration
In most cases, add one of the following server configurations:
{
"mcpServers": {
"openehr-assistant-mcp": {
"type": "streamable-http",
"url": "https://openehr-assistant-mcp.apps.cadasto.com/"
},
"openehr-assistant-mcp-stdio": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"ghcr.io/cadasto/openehr-assistant-mcp:latest",
"php", "public/index.php", "--transport=stdio"
]
},
"openehr-assistant-mcp-http": {
"type": "streamable-http",
"url": "http://host.docker.internal:8343/"
}
}
}
Claude Desktop (mcpServers)
Add the remote URL https://openehr-assistant-mcp.apps.cadasto.com/ in Menu > Settings > Connectors > Add custom connector.
Alternatively, use Menu → Developer → Edit Config to add one of the server configurations – see above.
LibreChat (streamable HTTP)
mcpServers:
openehr-assistant-mcp:
type: streamable-http
url: http://host.docker.internal:8343/
Cursor
- Open Cursor Settings → MCP.
- Add a new MCP server.
- Choose one of these connection options:
- Hosted:
type=streamable-http,url=https://openehr-assistant-mcp.apps.cadasto.com/ - Local dev:
type=streamable-http,url=http://host.docker.internal:8343/ - Local stdio: run with Docker – see above.
- Hosted:
IntelliJ Junie
- Open Settings/Preferences → Tools → Junie → MCP Servers (wording may vary by version).
- Add a server using either:
- Streamable HTTP URL (
https://openehr-assistant-mcp.apps.cadasto.com/orhttp://host.docker.internal:8343/), or - Stdio command (Docker command above).
- Streamable HTTP URL (
- Save configuration and refresh/restart Junie so tools are discovered.
Development tips
MCP Inspector
Run the MCP Inspector to inspect requests/responses and debug behavior:
make inspector
The terminal may show http://0.0.0.0:6274/; open it as http://localhost:6274/ (or your machine IP) in your browser.
Makefile shortcuts
- Build images:
make build(prod) ormake build-dev(dev) - Start services:
make up(prod) ormake up-dev(dev override with live volume mounts) - Prepare
.env:make env - Install dependencies in dev container:
make install - Tail logs:
make logs - Open shell in dev container:
make sh - Run MCP server (stdio):
make run-stdio - Run MCP conformance (requires
make up-dev):make conformance - Run MCP inspector:
make inspector - Show help:
make help
Environment Variables
APP_ENV: application environment (development/testing/production). Default:productionLOG_LEVEL: Monolog level (debug,info,warning,error, etc.). Default:infoCKM_API_BASE_URL: base URL for the openEHR CKM REST API. Default:https://ckm.openehr.org/ckm/restHTTP_TIMEOUT: HTTP client timeout in seconds (float). Default:3.0HTTP_SSL_VERIFY: set tofalseto disable verification or provide a CA bundle path. Default:trueXDG_DATA_HOME: directory for application data, including cache and sessions. Default:/tmp(the app usesXDG_DATA_HOME/appor/tmp/app)
Note: Authorization headers are not required nor configured by default. If you need to add auth to your upstream openEHR/CKM server, extend the HTTP client in src/Apis to add the appropriate headers.
Testing and QA
- Unit tests:
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec app composer test(PHPUnit 12) - Test with coverage:
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec app composer test:coverage - Static analysis:
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml exec app composer check:phpstan
MCP Conformance
The MCP Conformance test framework checks the server against the MCP specification. It talks to the server over HTTP only (not stdio). Some scenarios require test tools (e.g. test_tool_with_logging) or optional features this server does not implement; those are listed in tests/conformance-baseline.yml so that make conformance exits 0 when only known failures occur, and fails on new regressions. To see all server scenarios: docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml run --rm node npx -y @modelcontextprotocol/conformance list --server. Ensure the dev stack is running (make up-dev), then run:
make conformance
This runs the conformance suite inside the node service (Node + curl) in Docker, so you do not need Node on the host. Results are printed to the terminal and written to conformance/ in the repo (subdirectories like conformance/server-<scenario>-<timestamp>/ with checks.json). To run a single scenario or pass options (e.g. --verbose), use:
docker compose --env-file .env -f .docker/docker-compose.yml -f .docker/docker-compose.dev.yml run --rm node npx -y @modelcontextprotocol/conformance server --url http://ingress:8343/ -o conformance --expected-failures conformance-baseline.yml --scenario server-initialize --verbose
Tips
- You can also
make shand runcomposer testinside the container interactively.
Project Structure
public/index.php: MCP server entry pointresources/: various resources used or exposed by the serversrc/Tools/: MCP Tools (Definition, EHR, Composition, Query)Prompts/: MCP Prompts (includingAbstractPromptfor loading Markdown-based prompts)Resources/: MCP Resources and Resource TemplatesCompletionProviders/: MCP Completion ProvidersHelpers/: Internal helpers (e.g., content type and ADL mapping)Apis/: Internal API clientsconstants.php: loads env and defaults
.docker/: Docker assets —docker-compose.yml,docker-compose.dev.yml,Dockerfile,Caddyfile, PHP/php-fpm config.docker/docker-compose.yml: services (app,ingress) for production-like run (Caddy on 443).docker/docker-compose.dev.yml: dev overrides (port 8343,nodeservice for npx/curl and MCP conformance).docker/Dockerfile: multi-stage build (development, production, andnodefor MCP conformance / npx+curl)Makefile: handy shortcutstests/: PHPUnit and PHPStan config and tests
Contributing
We welcome contributions! Please read CONTRIBUTING.md for guidelines on setting up your environment, coding style, testing, and how to propose changes. Most routine tasks can be executed via the Makefile.
See CHANGELOG.md for notable changes and update it with every release.
License
MIT License - see LICENSE.
Acknowledgments
This project is inspired by and is grateful to:
- The original Python openEHR MCP Server: https://github.com/deak-ai/openehr-mcp-server
- Seref Arikan, Sidharth Ramesh - for inspiration on MCP integration
- The PHP MCP Server framework: https://github.com/modelcontextprotocol/php-sdk
- Ocean Health Systems for the Clinical Knowledge Manager (CKM), an essential tool for the openEHR community that enables collaborative development and sharing of archetypes and templates.
- freshEHR for the CGEM framework (Contextual situation, Global background, Event assessment, Managed response), which informs our template-design guides on splitting datasets and composition semantics (CC-BY).
- Silje Ljosland Bakke - for the contribution to the archetype and language related guides.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found