agentcare-mcp
by: Kartha-AI
MCP Server for EMRs with FHIR
📌Overview
Purpose: To provide an MCP server that enables seamless interaction with FHIR data and healthcare resources within Electronic Medical Records (EMR) systems like Cerner and Epic.
Overview: Agent Care serves as a robust tool for healthcare professionals by allowing them to harness FHIR data efficiently. It leverages various integrations, including OAuth2 for EMR authentication and the Anthropic Claude and Goose Desktop interfaces for enhanced interaction and analysis of medical data.
Key Features:
-
EMR Integration: Facilitates integration with EMRs using SMART on FHIR APIs, improving data access and interoperability.
-
Comprehensive Medical Research Tools: Includes tools that allow healthcare providers to access medical literature and clinical trial data, aiding in better-informed clinical decisions.
Agent Care: An MCP Server for EMRs like Cerner and Epic
A Model Context Protocol (MCP) server that provides healthcare tools for interacting with FHIR data and medical resources on EMRs like Cerner and Epic.
Demo
Visit the Demo Video
Features
- EMR integration using SMART on FHIR APIs
- OAuth2 authentication with EMRs
- Integration with Anthropic Claude Desktop
- Medical research integration (PubMed, Clinical Trials, FDA)
- Response caching and error handling
- Null-safe data formatting
- Comprehensive clinical analysis
Tools
FHIR Tools
find_patient
- Search for a patient by identifiersget_patient_observations
- Retrieve patient observations/vital signsget_patient_conditions
- Get patient's active conditionsget_patient_medications
- Get patient's current medicationsget_patient_encounters
- Get patient's clinical encountersget_patient_allergies
- Get patient's allergies and intolerancesget_patient_procedures
- Get patient's proceduresget_patient_careteam
- Get patient's care team membersget_patient_careplans
- Get patient's active care plansget_vital_signs
- Get patient's vital signsget_lab_results
- Get patient's laboratory resultsget_medications_history
- Get patient's medication historyclinical_query
- Execute custom FHIR queries
Medical Research Tools
search-pubmed
- Search PubMed articles related to medical conditionssearch-trials
- Find relevant clinical trialsdrug-interactions
- Check drug-drug interactions
Usage
Each tool requires specific parameters:
Required Parameters
- Most tools require
patientId
- Some tools have additional parameters, such as:
lab_trend_analysis
: requireslabType
search-pubmed
: requiresquery
search-trials
: requirescondition
drug-interactions
: requiresdrugs
array
Development Configuration
To use with Cerner or Epic, create a sandbox account and obtain the clientId/secret.
Cerner Configuration
OAUTH_CLIENT_ID="XXXXX"
OAUTH_CLIENT_SECRET="XXXXXXX"
OAUTH_TOKEN_HOST="https://authorization.cerner.com"
OAUTH_AUTHORIZE_PATH="/tenants/{tenant_id}/protocols/oauth2/profiles/smart-v1/personas/provider/authorize"
OAUTH_TOKEN_PATH="/tenants/{tenant_id}/hosts/api.cernermillennium.com/protocols/oauth2/profiles/smart-v1/token"
FHIR_BASE_URL="https://fhir-ehr.cerner.com/r4/{tenant_id}"
PUBMED_API_KEY=your_pubmed_api_key
CLINICAL_TRIALS_API_KEY=your_trials_api_key
FDA_API_KEY=your_fda_api_key
Epic Configuration
OAUTH_CLIENT_ID="XXXXXXX"
OAUTH_CLIENT_SECRET=""
OAUTH_TOKEN_HOST="https://fhir.epic.com"
OAUTH_AUTHORIZE_PATH="/interconnect-fhir-oauth/oauth2/authorize"
OAUTH_TOKEN_PATH="/interconnect-fhir-oauth/oauth2/token"
FHIR_BASE_URL="https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
PUBMED_API_KEY=your_pubmed_api_key
CLINICAL_TRIALS_API_KEY=your_trials_api_key
FDA_API_KEY=your_fda_api_key
Start MCP Server Locally
git clone {agentcare-mcp-github path}
cd agentcare-mcp
npm install
npm run build
Use Claude Desktop
Configure the claude_desktop_config.json
file with your environment variables.
Use MCP Inspector
Make sure to update the .env file with the correct values.
npm install -g @modelcontextprotocol/inspector
mcp-inspector build/index.js
http://localhost:5173
Test User Logins
- Cerner: portal | portal
- Epic: FHIRTWO | EpicFhir11!
Troubleshooting
Terminate any process using port 3456:
kill -9 $(lsof -t -i:3456)
Use Goose
Goose is an open-source AI Agent framework that can be configured to work with MCP servers. For more information, visit Goose Documentation.