MCP健康助手
一种提供与FHIR数据和电子病历(如Cerner和Epic)上的医疗资源交互的医疗保健工具的MCP服务器
服务介绍
Agent Care: 适用于 Cerner 和 Epic 等 EMR 的 MCP 服务器
这是一个模型上下文协议(MCP)服务器,它通过 Claude Desktop 和 Goose Desktop 提供医疗工具和提示,以便与 Cerner 和 Epic 等 EMR 中的 FHIR 数据和医疗资源进行交互。
演示
功能
- 使用 SMART on FHIR API 进行 EMR 集成
- 使用 OAuth2 对 EMR 进行身份验证
- Anthropic Claude Desktop 集成
- 医学研究集成(PubMed、临床试验、FDA)
- 响应缓存
- 错误处理
- 空值安全的数据格式化
- 全面的临床分析
屏幕截图
工具
FHIR 工具
find_patient- 根据姓名、出生日期或其他标识符搜索患者get_patient_observations- 获取患者的观察/生命体征get_patient_conditions- 获取患者的当前疾病get_patient_medications- 获取患者的当前用药get_patient_encounters- 获取患者的临床就诊记录get_patient_allergies- 获取患者的过敏和不耐受情况get_patient_procedures- 获取患者的手术记录get_patient_careteam- 获取患者的护理团队成员get_patient_careplans- 获取患者的活跃护理计划get_vital_signs- 获取患者的生命体征get_lab_results- 获取患者的实验室结果get_medications_history- 获取患者的用药历史clinical_query- 执行自定义 FHIR 查询
医学研究工具
search-pubmed- 搜索与医学状况相关的 PubMed 文章search-trials- 查找相关的临床试验drug-interactions- 检查药物之间的相互作用
使用方法
每个工具都需要特定的参数:
必需参数
- 大多数工具需要
patientId - 一些工具有额外的参数:
lab_trend_analysis: 需要labTypesearch-pubmed: 需要query并可选maxResultssearch-trials: 需要condition并可选locationdrug-interactions: 需要drugs数组
开发配置
-
要与Cerner一起使用:请访问 https://code-console.cerner.com 并创建一个沙箱账户,创建一个新的提供者应用程序并获取clientId/secret。
(注意:下面的ec2458f2-1e24-41c8-b71b-0e701af7583d是Cerner开发者沙箱的租户ID) -
要与Epic一起使用:请访问 https://fhir.epic.com/Developer/Apps ,注册为开发者并创建一个新的应用并获取clientId/secret。
-
对于PubMed、Clinical Trials和FDA,你需要从各自的网站获取API密钥。
为了本地测试,请在根目录下创建一个.env文件,或在Claude桌面启动配置中使用这些环境变量。
Cerner
OAUTH_CLIENT_ID="XXXXX",
OAUTH_CLIENT_SECRET="XXXXXXX",
OAUTH_TOKEN_HOST="https://authorization.cerner.com",
OAUTH_AUTHORIZE_PATH="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/personas/provider/authorize",
OAUTH_AUTHORIZATION_METHOD='header',
OAUTH_TOKEN_PATH="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/hosts/api.cernermillennium.com/protocols/oauth2/profiles/smart-v1/token",
OAUTH_AUDIENCE="https://fhir-ehr.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d",
OAUTH_CALLBACK_URL="http://localhost:3456/oauth/callback",
OAUTH_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",
OAUTH_CALLBACK_PORT="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
OAUTH_CLIENT_ID="XXXXXXX",
OAUTH_CLIENT_SECRET="",
OAUTH_TOKEN_HOST="https://fhir.epic.com",
OAUTH_AUTHORIZE_PATH="/interconnect-fhir-oauth/oauth2/authorize",
OAUTH_AUTHORIZATION_METHOD='body',
OAUTH_TOKEN_PATH="/interconnect-fhir-oauth/oauth2/token",
OAUTH_AUDIENCE="https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
OAUTH_CALLBACK_URL="http://localhost:3456/oauth/callback",
OAUTH_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",
OAUTH_CALLBACK_PORT=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
本地启动MCP服务器
git clone {agentcare-mcp-github path}
cd agentcare-mcp
npm install
npm run build
使用Claude桌面版
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": {
"OAUTH_CLIENT_ID": XXXXXX,
"OAUTH_CLIENT_SECRET":XXXXXXX,
"OAUTH_TOKEN_HOST":,
"OAUTH_TOKEN_PATH":,
"OAUTH_AUTHORIZE_PATH",
"OAUTH_AUTHORIZATION_METHOD": ,
"OAUTH_AUDIENCE":,
"OAUTH_CALLBACK_URL":,
"OAUTH_SCOPES":,
"OAUTH_CALLBACK_PORT":,
"FHIR_BASE_URL":,
"PUBMED_API_KEY":,
"CLINICAL_TRIALS_API_KEY":,
"FDA_API_KEY":
}
}
}
}
使用MCP检查器
(使用检查器的MCP服务器。确保更新.env文件中的正确值。)
npm install -g @modelcontextprotocol/inspector
mcp-inspector build/index.js
http://localhost:5173
测试用户登录
(通常用于沙箱/开发)
- Cerner: portal | portal
- Epic: FHIRTWO | EpicFhir11!
故障排除:
如果Claude桌面版正在运行,它会使用端口3456进行身份验证。你需要使用以下命令终止该进程:
kill -9 $(lsof -t -i:3456)
使用Goose
Goose是来自Block(Stripe)的一个开源AI代理框架,可以与MCP服务器配合工作。Goose Desktop类似于Claude Desktop,能够与MCP服务器配合工作。但Goose还可以被配置成使用Anthropic以外的模型。更多信息见:https://block.xyz/inside/block-open-source-introduces-codename-goose
查看下面Goose Desktop如何与Agent Care一起工作:
(将通过命令配置goose扩展程序:/Users/your-username/{agentcare-download-path}/agent-care-mcp/build/index.js)
