返回市场
代理关怀-mcp

代理关怀-mcp

作者:Kartha-AI97 星标更新:2025-04-08

项目介绍

Agent Care:用于Cerner和Epic等EMR的MCP服务器

这是一个模型上下文协议(MCP)服务器,提供与Cerner和Epic等电子病历系统中的FHIR数据和医疗资源交互的医疗工具和提示,通过Claude Desktop和Goose Desktop实现。

smithery徽章

演示

演示

特性

  • 使用SMART on FHIR API集成EMR
  • 使用OAuth2进行EMR认证
  • 集成Anthropic Claude Desktop
  • 医学研究集成(PubMed,Clinical Trials,FDA)
  • 响应缓存
  • 错误处理
  • 安全的数据格式化
  • 全面的临床分析

截图

<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笔记" width="700"> <img src="screenshots/timeline.png" alt="时间线" width="700">

工具

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:需要labType
    • search-pubmed:需要query,可选maxResults
    • search-trials:需要condition,可选location
    • drug-interactions:需要drugs数组

开发配置

对于本地测试,在根目录创建一个.env文件或在claude desktop启动配置中使用这些环境变量。

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路径}
cd agentcare-mcp
npm install
npm run build

使用claude desktop

对于claude desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
(使用上面显示的环境变量)

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/你的用户名/Desktop"
      ]
    },
    "agent-care": {
      "command": "node",
      "args": [
        "/Users/你的用户名/{agentcare下载路径}/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 Inspector

(使用Inspector的MCP服务器。确保更新.env文件以包含正确的值。)

npm install -g @modelcontextprotocol/inspector
mcp-inspector  build/index.js
http://localhost:5173

测试用户登录

(通常用于沙盒/开发)

  • Cerner: portal | portal
  • Epic: FHIRTWO | EpicFhir11!

故障排除:

如果Claude desktop正在运行,它会使用端口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/你的用户名/{agentcare下载路径}/agent-care-mcp/build/index.js)

<img src="screenshots/goose-extension.png" alt="Cerner"> <img src="screenshots/goose-env.png" alt="Epic"> <img src="screenshots/goose-model.png" alt="Converse" > <img src="screenshots/goose-in-action.png" alt="SOAP笔记">