openemr-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openemr-mcp Check for drug interactions in Jane Doe's medication list"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openemr-mcp
Model Context Protocol (MCP) server for OpenEMR — connect any MCP-compatible AI assistant (Claude Desktop, Cursor, VS Code Copilot) directly to your OpenEMR instance.
Features
17 MCP tools covering:
Category | Tools |
Patients |
|
Appointments |
|
Medications |
|
Providers |
|
FDA Safety |
|
Symptom Lookup |
|
Drug Safety Flags |
|
Clinical Trends |
|
Health Trajectory |
|
Visit Prep |
|
All tools work in mock mode out of the box — no OpenEMR installation required for evaluation.
Related MCP server: FHIR MCP Server
Quick Start
Install
pip install openemr-mcp
# or with uv:
uv add openemr-mcpRun (stdio transport)
# Mock mode — no OpenEMR needed
OPENEMR_DATA_SOURCE=mock openemr-mcp
# Against a live OpenEMR FHIR API
OPENEMR_DATA_SOURCE=api \
OPENEMR_API_BASE_URL=https://your-openemr/apis/default \
OPENEMR_OAUTH_SITE=default \
OPENEMR_OAUTH_CLIENT_ID=... \
OPENEMR_OAUTH_CLIENT_SECRET=... \
OPENEMR_OAUTH_USERNAME=admin \
OPENEMR_OAUTH_PASSWORD=... \
openemr-mcpClaude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"openemr": {
"command": "uvx",
"args": ["openemr-mcp"],
"env": {
"OPENEMR_DATA_SOURCE": "api",
"OPENEMR_API_BASE_URL": "https://your-openemr.example.com/apis/default",
"OPENEMR_OAUTH_SITE": "default",
"OPENEMR_OAUTH_CLIENT_ID": "your_client_id",
"OPENEMR_OAUTH_CLIENT_SECRET": "your_client_secret",
"OPENEMR_OAUTH_USERNAME": "admin",
"OPENEMR_OAUTH_PASSWORD": "your_password"
}
}
}
}For mock mode (demo / evaluation):
{
"mcpServers": {
"openemr": {
"command": "uvx",
"args": ["openemr-mcp"],
"env": {
"OPENEMR_DATA_SOURCE": "mock"
}
}
}
}Data Sources
Patient / Clinical Data (OPENEMR_DATA_SOURCE)
Value | Description |
| Built-in curated demo data — 24 patients, no network required |
| Direct MySQL connection to OpenEMR database |
| OpenEMR FHIR R4 REST API (recommended for production) |
Drug Interactions (DRUG_INTERACTION_SOURCE)
Value | Description |
| 10 built-in drug pairs — always works, no network |
| OpenFDA FAERS co-reporting heuristic — free, no API key required. Severity based on co-report volume (HIGH ≥ 50, MODERATE ≥ 5). Note: Co-reporting indicates correlation, not definitive causation. |
| ⚠️ DEPRECATED/UNAVAILABLE — RxNorm interaction API endpoints retired (returns 404) |
Symptom Checker (SYMPTOM_SOURCE)
Value | Description |
| Curated local dataset — 10 clinical groups |
| Infermedica Symptom Checker API (register here) — free tier 100 calls/day |
FDA Data (OPENFDA_SOURCE)
Value | Description |
| Built-in mock data for 6 common drugs |
| Live OpenFDA API — free, optional key for higher rate limits |
Environment Variables
See .env.example for the full list with comments.
Key variables:
# Data source
OPENEMR_DATA_SOURCE=mock # mock | db | api
# MySQL (when OPENEMR_DATA_SOURCE=db)
OPENEMR_DB_HOST=localhost
OPENEMR_DB_PORT=3306
OPENEMR_DB_USER=openemr
OPENEMR_DB_PASSWORD=openemr
OPENEMR_DB_NAME=openemr
# FHIR API (when OPENEMR_DATA_SOURCE=api)
OPENEMR_API_BASE_URL=https://your-openemr/apis/default
OPENEMR_OAUTH_SITE=default
OPENEMR_OAUTH_CLIENT_ID=...
OPENEMR_OAUTH_CLIENT_SECRET=...
OPENEMR_OAUTH_USERNAME=admin
OPENEMR_OAUTH_PASSWORD=...
# Optional external APIs
DRUG_INTERACTION_SOURCE=mock # mock | openfda | rxnorm (deprecated)
SYMPTOM_SOURCE=mock # mock | infermedica
INFERMEDICA_APP_ID=
INFERMEDICA_APP_KEY=
OPENFDA_SOURCE=mock # mock | live
OPENFDA_API_KEY=Tool Reference
openemr_patient_search
Search patients by name. Returns patient ID, DOB, sex, city.
{ "query": "Jane" }openemr_appointment_list
List upcoming appointments for a patient.
{ "patient_id": "p001" }openemr_medication_list
Return the current medication list for a patient.
{ "patient_id": "p001" }openemr_drug_interaction_check
Check a list of medications for known drug-drug interactions.
{ "medications": ["warfarin", "aspirin", "metformin"] }openemr_provider_search
Search healthcare providers by specialty and/or location.
{ "specialty": "Cardiology", "location": "Boston" }openemr_fda_adverse_events
Query FDA FAERS database for adverse event reports on a drug.
{ "drug_name": "metformin", "limit": 5 }openemr_fda_drug_label
Retrieve official FDA drug label including boxed warnings and contraindications.
{ "drug_name": "warfarin" }openemr_symptom_lookup
Look up possible conditions for a list of symptoms.
{ "symptoms": ["chest pain", "shortness of breath"] }openemr_drug_safety_flag_create
Create a drug safety flag for a patient.
{
"patient_id": "p001",
"drug_name": "warfarin",
"description": "Patient reported unusual bruising",
"flag_type": "adverse_event",
"severity": "HIGH"
}openemr_drug_safety_flag_list
List all drug safety flags for a patient.
{ "patient_id": "p001", "status_filter": "active" }openemr_drug_safety_flag_update
Update a drug safety flag's severity, description, or status.
{ "flag_id": "uuid-...", "severity": "MODERATE", "status": "resolved" }openemr_drug_safety_flag_delete
Delete a drug safety flag by ID.
{ "flag_id": "uuid-..." }openemr_lab_trends
Return longitudinal lab trajectories (A1c, LDL, eGFR).
{ "patient_id": "p001", "metrics": ["a1c", "ldl"], "window_months": 24 }openemr_vital_trends
Return longitudinal vital sign trajectories (weight, BP).
{ "patient_id": "p001", "metrics": ["weight", "bp_systolic", "bp_diastolic"] }openemr_questionnaire_trends
Return longitudinal questionnaire score trajectories (PHQ-9).
{ "patient_id": "p001", "instrument": "PHQ-9", "window_months": 24 }openemr_health_trajectory
Aggregate all metric trajectories and compute clinical drift alerts.
{ "patient_id": "p001", "window_months": 24 }openemr_visit_prep
Generate a pre-visit clinical brief: top risks, medication safety, care gaps, and suggested agenda.
{ "patient_id": "p001", "window_months": 24 }Development
# Clone and install in editable mode
git clone https://github.com/shruti-jn/openemr-mcp
cd openemr-mcp
pip install -e ".[dev]"
# Run tests (mock mode, no external dependencies)
pytest
# Start server locally
OPENEMR_DATA_SOURCE=mock openemr-mcpArchitecture
src/openemr_mcp/
├── server.py # MCP server — registers all 17 tools
├── config.py # Pydantic-settings configuration
├── schemas.py # All Pydantic response schemas
├── auth.py # OpenEMR OAuth2 token manager
├── data_source.py # Data source resolver
├── tools/ # 13 tool modules (17 MCP tools)
├── repositories/ # Data access (MySQL, FHIR R4, SQLite)
└── services/ # Business logic (OpenFDA, trajectory alerts, visit prep)Drug safety flags are persisted in a local SQLite database at ~/.openemr_mcp/drug_safety_flags.db.
License
MIT — see LICENSE.
Contributing
Pull requests welcome. Please open an issue first for major changes.
This project is part of the AgentForge OpenEMR AI toolkit.
Available Tools
17 toolsopenemr_appointment_listC
List upcoming appointments for a patient.
Inputs: patient_id (required).
openemr_drug_interaction_checkA
Check a list of medications for known drug-drug interactions. Returns severity-classified interactions.
Inputs: medications (required).
openemr_drug_safety_flag_createB
Create a drug safety flag for a patient (adverse event, recall, warning, contraindication, or custom note).
Inputs: patient_id (required), drug_name (required), description (required), flag_type, +2 more.
openemr_drug_safety_flag_deleteB
Delete a drug safety flag by ID.
Inputs: flag_id (required).
openemr_drug_safety_flag_listA
List all drug safety flags for a patient, optionally filtered by status.
Inputs: patient_id (required), status_filter.
openemr_drug_safety_flag_updateB
Update a drug safety flag's severity, description, or status.
Inputs: flag_id (required), severity, description, status.
openemr_fda_adverse_eventsB
Query FDA FAERS database for adverse event reports on a drug.
Inputs: drug_name (required), limit.
openemr_fda_drug_labelA
Retrieve official FDA drug label including boxed warnings, contraindications, and indications.
Inputs: drug_name (required).
openemr_health_trajectoryA
Aggregate all metric trajectories (labs, vitals, questionnaires) and compute clinical drift alerts for a patient.
Inputs: patient_id (required), window_months, metrics.
openemr_lab_trendsC
Return longitudinal lab trajectories for a patient (A1c, LDL, eGFR).
Inputs: patient_id (required), metrics, window_months.
openemr_medication_listA
Return the current medication list for a patient.
Inputs: patient_id (required).
openemr_patient_searchA
Search OpenEMR patients by name. Returns matching patient records with ID, DOB, sex, and city.
Inputs: query (required).
openemr_provider_searchA
Search for healthcare providers by specialty and/or location.
Inputs: specialty, location.
openemr_questionnaire_trendsA
Return longitudinal questionnaire score trajectories for a patient (PHQ-9 depression screening).
Inputs: patient_id (required), instrument, window_months.
openemr_symptom_lookupA
Look up possible conditions for a list of symptoms. Returns ranked conditions with urgency level and medical disclaimer.
Inputs: symptoms (required).
openemr_visit_prepA
Generate a pre-visit clinical brief for a patient: top risks, medication safety, care gaps, and suggested agenda. Evidence-linked, no hallucination.
Inputs: patient_id (required), window_months.
openemr_vital_trendsB
Return longitudinal vital sign trajectories for a patient (weight, BP systolic/diastolic).
Inputs: patient_id (required), metrics, window_months.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools target clearly distinct resources: patient lookup, medications, appointments, drug label/adverse events, symptom lookup, and safety flag CRUD. The only mild overlap is between health_trajectory and the three specific trend tools, but their descriptions make the aggregate-vs-specific distinction clear enough for a capable agent.
Naming is inconsistent: CRUD operations use an object_action pattern (drug_safety_flag_create, drug_safety_flag_update) while most reads use noun phrases like medication_list, provider_search, and vital_trends. All names share the openemr_ prefix and snake_case, but the placement of the action is not predictable across the toolset.
17 tools is slightly above the typical 3-15 range, but the count is defensible for a clinical workflow server that combines EHR data, FDA lookups, and medication safety. Each tool covers a distinct resource or operation, so none feel like filler.
The toolset forms a coherent clinical pre-visit and drug-safety workflow: patient search, medication/appointment review, interaction checks, symptom lookup, trend tracking, and visit prep. Gaps like patient creation or appointment scheduling exist, but the apparent focus on read-side analysis and safety flagging is well covered.
Maintenance
Related MCP Connectors
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Hosted MCP server for Cliniko — patients, appointments, availability, and invoices for AI agents.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA production-grade MCP server that enables AI assistants to securely manage healthcare data through clinical tools for patient vitals, lab results, and medication ordering. It prioritizes security and compliance with features like HIPAA-ready audit logging, PII redaction, and role-based access control.-
- FlicenseNot gradedqualityCmaintenanceA comprehensive MCP server that bridges AI applications with FHIR healthcare data systems, enabling patient data access, clinical data retrieval, and data quality assessment.4-
- AlicenseAqualityBmaintenanceMCP server for Tebra practice management that gives AI agents access to 45 tools for patients, appointments, billing, documents, and clinical data via SOAP and FHIR APIs.34199 npm1MIT

LangCare MCP FHIR Serverofficial
AlicenseNot gradedqualityDmaintenanceEnterprise-grade MCP Server for FHIR-based EMRs. Enables AI agents to read, search, create, and update any FHIR R4 resource across major EHR systems like EPIC, Cerner, and OpenEMR.311 npm71MIT