Agent Care MCP
Integrates with EMRs like Cerner and Epic via FHIR to retrieve patient data, and provides medical research tools (PubMed, clinical trials, FDA) for clinical analysis.
README
Agent Care: An MCP Server for EMRs like Cerner and Epic
A Model Context Protocol (MCP) server that provides healthcare tools and prompts for interacting with FHIR data and medical resources on EMRs like Cerner and Epic.
Demo
Features
- EMR integrartion using SMART on FHIR APIs
- Uses OAuth2 to authenticate with EMRs
- Anthropic Claude Desktop integration
- Medical research integration (PubMed, Clinical Trials, FDA)
- Response caching
- Error handling
- Null-safe data formatting
- Comprehensive clinical analysis
Screenshots
<img src="screenshots/cerner.png" alt="Cerner" width="700"> <img src="screenshots/epic.png" alt="Epic" width="700"> <img src="screenshots/converse.png" alt="Converse" width="700"> <img src="screenshots/soap.png" alt="Soap Notes" width="700"> <img src="screenshots/timeline.png" alt="Timeline" width="700">
Tools
FHIR Tools
find_patient- Search for a patient by name, DOB, or other 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:
lab_trend_analysis: requireslabTypesearch-pubmed: requiresqueryand optionalmaxResultssearch-trials: requiresconditionand optionallocationdrug-interactions: requiresdrugsarray
Development Configuration
-
To use with Cerener: Go to https://code-console.cerner.com and create a sandbox account, create a new provider app and get the clientId/secret. (note: ec2458f2-1e24-41c8-b71b-0e701af7583d below is the tenant id for cerner developer sandbox)
-
To use with Epic: Go to https://fhir.epic.com/Developer/Apps , sign up as developer and create a new app and get the clientId/secret.
-
For PubMed, Clinical Trials and FDA, you need to get the API keys from the respective websites.
- https://clinicaltrials.gov/api/v2/studies
- https://eutils.ncbi.nlm.nih.gov/entrez/eutils
- https://api.fda.gov/drug/ndc.json
For local testing Create a .env file in the root directory or use these environment variables in claude desktop launch configuration.
Cerner
clientId="XXXXX",
clientSecret="XXXXXXX",
tokenHost="https://authorization.cerner.com",
authorizePath="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/personas/provider/authorize",
authorizationMethod='header',
tokenPath="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/hosts/api.cernermillennium.com/protocols/oauth2/profiles/smart-v1/token",
audience="https://fhir-ehr.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d",
callbackURL="http://localhost:3456/oauth/callback",
scopes="user/Patient.read user/Condition.read user/Observation.read user/MedicationRequest.read user/AllergyIntolerance.read user/Procedure.read user/CarePlan.read user/CareTeam.read user/Encounter.read user/Immunization.read",
callbackPort="3456"
FHIR_BASE_URL:any = "https://fhir-ehr.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d"
PUBMED_API_KEY=your_pubmed_api_key
CLINICAL_TRIALS_API_KEY=your_trials_api_key
FDA_API_KEY=your_fda_api_key
Epic
clientId="XXXXXXX",
clientSecret="",
tokenHost="https://fhir.epic.com",
authorizePath="/interconnect-fhir-oauth/oauth2/authorize",
authorizationMethod='body',
tokenPath="/interconnect-fhir-oauth/oauth2/token",
audience="https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
callbackURL="http://localhost:3456/oauth/callback",
scopes="user/Patient.read user/Observation.read user/MedicationRequest.read user/Condition.read user/AllergyIntolerance.read user/Procedure.read user/CarePlan.read user/CareTeam.read user/Encounter.read user/Immunization.read",
callbackPort=3456
FHIR_BASE_URL:any = "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4" //EPIC
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
for claude desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
(use the env variables as shown above)
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/your-username/Desktop"
]
},
"agent-care": {
"command": "node",
"args": [
"/Users/your-username/{agentcare-download-path}/agent-care-mcp/build/index.js"
],
"env": {
"clientId": XXXXXX,
"clientSecret":XXXXXXX,
"tokenHost":,
"tokenPath":,
"authorizePath",
"authorizationMethod": ,
"audience":,
"callbackURL":,
"scopes":,
"callbackPort":,
"FHIR_BASE_URL":,
"PUBMED_API_KEY":,
"CLINICAL_TRIALS_API_KEY":,
"FDA_API_KEY":
}
}
}
}
Use MCP Inspectopr
(MCP Server using 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
(commonly used for sandbox/dev)
- Cerner: portal | portal
- Epic: FHIRTWO | EpicFhir11!
Troubleshooting:
If Claude desktop is running it uses port 3456 for Auth. You need to terminate that process using the following command:
kill -9 $(lsof -t -i:3456)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
