医疗AI助手协议服务器

Suncture Healthcare MCP Server是一个为AI助手提供医疗相关工具的服务,包括健康建议、药物信息查询、疾病信息查询、BMI计算和症状检查等功能。

  • by wilforlan
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 wilforlan/suncture-mcp

使用说明

Suncture Healthcare MCP服务器

一个模型上下文协议(MCP)服务器,为人工智能助手提供医疗相关的工具,使它们能够为用户提供实用的医疗信息。

特性

这个MCP服务器包含以下医疗保健工具:

  1. 健康建议工具(get-health-recommendations根据上面的信息,执行如下指令: 根据年龄、性别和怀孕状态获取个性化的健康筛查和预防保健建议。

  2. 药物信息工具(lookup-medication) 查询药物的全面信息,包括用法、剂量、副作用及相互作用。

  3. 疾病信息工具(find-disease-info根据上面的信息,执行如下指令: 查找有关疾病和医疗状况的信息,包括症状、治疗方法和预防策略。

  4. BMI计算工具calculate-bmi根据上面的信息,执行如下指令: 计算身体质量指数(BMI)并根据结果获得个性化的健康建议。

  5. 症状检查工具symptom-checker) 分析报告的症状,获取初步建议、可能的状况以及何时寻求医疗护理的指导。

安装

NPM包安装

你可以全局安装该包:

npm install -g suncture-healthcare-mcp

或者作为项目依赖项:

npm install suncture-healthcare-mcp

先决条件

  • Node.js(v18或更高版本)
  • npm(v7或更高版本)

本地开发

# Clone the repository
git clone https://github.com/your-username/suncture-healthcare-mcp.git
cd suncture-healthcare-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

用法

命令行使用方法

如果全局安装,您可以直接从命令行运行服务器:

suncture-healthcare-mcp

您可以使用环境变量来配置服务器:

# Run in REST mode
MCP_MODE=rest MCP_PORT=8080 suncture-healthcare-mcp

程序化使用

您也可以在您的Node.js应用程序中通过编程方式使用该包:

import { server, runServer } from 'suncture-healthcare-mcp';

// Run with default settings (stdio mode)
runServer();

// Or with custom settings
runServer({
  mode: 'rest',    // 'stdio' or 'rest'
  port: 8080,      // Only used in REST mode
  endpoint: '/api' // Only used in REST mode
});

// You can also access the server instance directly
console.log(server.name); // 'suncture-healthcare'

使用启用MCP的人工智能模型

此MCP服务器可与支持模型上下文协议的AI模型一起使用。该服务器提供了与医疗保健相关的工具,模型可调用这些工具为用户提供信息。

使用Claude 3.5 Sonnet的示例

import { Anthropic } from "@anthropic-ai/sdk";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

// Connect to the healthcare MCP server
const healthcareMcp = new Client({ name: "healthcare-client", version: "1.0.0" });
const transport = new StdioClientTransport({
  command: "suncture-healthcare-mcp", // Use the installed package
  args: [],
});
healthcareMcp.connect(transport);

// Get available tools
const { tools } = await healthcareMcp.listTools();

// Initialize Anthropic client
const anthropic = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
});

// Example: Use the symptom checker tool
const response = await anthropic.messages.create({
  model: "claude-3-5-sonnet-20240620",
  max_tokens: 1000,
  messages: [
    {
      role: "user",
      content: "I've been having a headache and fever for the past two days. What could it be?"
    }
  ],
  tools,
});

// Process tool calls from the model
for (const content of response.content) {
  if (content.type === "tool_use") {
    const result = await healthcareMcp.callTool({
      name: content.name,
      arguments: content.input,
    });
    console.log(result.content);
  }
}

Docker 使用方法

你也可以使用 Docker 来运行服务器:

# Build the Docker image
docker build -t suncture-healthcare-mcp .

# Run the container
docker run -i --rm suncture-healthcare-mcp

MCP.so 托管服务

这个服务器设计为可托管于 MCP.so,便于与支持的AI模型轻松集成。

免责声明

此MCP服务器提供的医疗信息仅供教育用途,不能替代专业医疗建议、诊断或治疗。如有任何关于医疗状况的问题,请务必咨询您的医生或其他合格的医疗保健提供者。

许可证

MIT 许可证