Skip to main content
Glama

医疗保健 MCP 服务器

模型上下文协议 (MCP) 服务器为 AI 助手提供访问医疗保健数据和医疗信息工具的权限。

概述

医疗保健 MCP 服务器是一款专用服务器,它实现了模型上下文协议 (MCP),为 AI 助手提供访问医疗保健数据和医疗信息工具的权限。它使 AI 模型能够从权威来源检索准确、最新的医疗信息。

Related MCP server: MCP Toolkit

特征

  • FDA 药品信息:从 FDA 数据库搜索和检索全面的药品信息

  • PubMed 研究:从 PubMed 的科学文章数据库中搜索医学文献

  • 健康主题:从 Health.gov 获取循证健康信息

  • 临床试验:搜索正在进行和已完成的临床试验

  • 医学术语:查找 ICD-10 代码和医学术语定义

  • 缓存:高效的缓存系统,具有连接池,可减少 API 调用并提高性能

  • 使用情况跟踪:匿名使用情况跟踪,监控 API 使用情况

  • 错误处理:强大的错误处理和日志记录

  • 多接口:支持 stdio(用于 CLI)和 HTTP/SSE 接口

  • API 文档:使用 Swagger UI 进行交互式 API 文档

  • 全面测试:带有 pytest 和覆盖率报告的广泛测试套件

安装

手动安装

  1. 克隆存储库:

    git clone https://github.com/Cicatriiz/healthcare-mcp-public.git
    cd healthcare-mcp-public
  2. 创建虚拟环境:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. 安装依赖项:

    pip install -r requirements.txt
  4. 设置环境变量(可选):

    # Create .env file from example
    cp .env.example .env
    # Edit .env with your API keys (optional)
  5. 运行服务器:

    python run.py

用法

在不同的交通方式下运行

  • stdio 模式(对于 Cline 来说,默认):

    python run.py
  • HTTP/SSE 模式(适用于 Web 客户端):

    python run.py --http --port 8000

测试工具

您可以使用新的基于 pytest 的测试套件来测试 MCP 工具:

# Run all tests with pytest and coverage
python -m tests.run_tests --pytest

# Run a specific test file
python -m tests.run_tests --test test_fda_tool.py

# Test the HTTP server
python -m tests.run_tests --server --port 8000

为了向后兼容,您仍然可以运行旧的测试:

# Run all tests (old style)
python -m tests.run_tests

# Test individual tools (old style)
python -m tests.run_tests --fda        # Test FDA drug lookup
python -m tests.run_tests --pubmed     # Test PubMed search
python -m tests.run_tests --health     # Test Health Topics
python -m tests.run_tests --trials     # Test Clinical Trials search
python -m tests.run_tests --icd        # Test ICD-10 code lookup

API 参考

医疗保健 MCP 服务器既提供了用于直接集成的编程 API,也为 Web 客户端提供了 RESTful HTTP API。

RESTful API 端点

在 HTTP 模式下运行时,以下端点可用:

健康检查

GET /health

返回服务器及其服务的状态。

FDA药品查询

GET /api/fda?drug_name={drug_name}&search_type={search_type}

参数:

  • drug_name :要搜索的药品名称

  • search_type :要检索的信息类型

    • general :基本药物信息(默认)

    • label :药品标签信息

    • adverse_events :报告的不良事件

响应示例:

{
  "status": "success",
  "drug_name": "aspirin",
  "search_type": "general",
  "total_results": 25,
  "results": [
    {
      "brand_name": "ASPIRIN",
      "generic_name": "ASPIRIN",
      "manufacturer": "Bayer Healthcare",
      "product_type": "HUMAN OTC DRUG",
      "route": "ORAL",
      "active_ingredients": [
        {
          "name": "ASPIRIN",
          "strength": "325 mg/1"
        }
      ]
    }
  ]
}

PubMed 搜索

GET /api/pubmed?query={query}&max_results={max_results}&date_range={date_range}

参数:

  • query :医学文献的搜索查询

  • max_results :返回的最大结果数(默认值:5,最大值:50)

  • date_range :限制为几年内发表的文章(例如“5”表示过去 5 年)

响应示例:

{
  "status": "success",
  "query": "diabetes treatment",
  "total_results": 123456,
  "date_range": "5",
  "articles": [
    {
      "pmid": "12345678",
      "title": "New advances in diabetes treatment",
      "authors": ["Smith J", "Johnson A"],
      "journal": "Journal of Diabetes Research",
      "publication_date": "2023-01-15",
      "abstract": "This study explores new treatment options...",
      "url": "https://pubmed.ncbi.nlm.nih.gov/12345678/"
    }
  ]
}

健康话题

GET /api/health_finder?topic={topic}&language={language}

参数:

  • topic :健康主题搜索信息

  • language :内容语言(en 或 es,默认值:en)

响应示例:

{
  "status": "success",
  "search_term": "diabetes",
  "language": "en",
  "total_results": 15,
  "topics": [
    {
      "title": "Diabetes Type 2",
      "url": "https://health.gov/myhealthfinder/topics/health-conditions/diabetes/diabetes-type-2",
      "last_updated": "2023-05-20",
      "section": "Health Conditions",
      "description": "Information about managing type 2 diabetes",
      "content": ["Diabetes is a disease...", "Treatment options include..."]
    }
  ]
}

临床试验搜索

GET /api/clinical_trials?condition={condition}&status={status}&max_results={max_results}

参数:

  • condition :要搜索的医疗状况或疾病

  • status :试用状态(招募中、已完成、活跃、未招募或全部)

  • max_results :返回的最大结果数(默认值:10,最大值:100)

响应示例:

{
  "status": "success",
  "condition": "breast cancer",
  "search_status": "recruiting",
  "total_results": 256,
  "trials": [
    {
      "nct_id": "NCT12345678",
      "title": "Study of New Treatment for Breast Cancer",
      "status": "Recruiting",
      "phase": "Phase 2",
      "study_type": "Interventional",
      "conditions": ["Breast Cancer", "HER2-positive Breast Cancer"],
      "locations": [
        {
          "facility": "Memorial Hospital",
          "city": "New York",
          "state": "NY",
          "country": "United States"
        }
      ],
      "sponsor": "National Cancer Institute",
      "url": "https://clinicaltrials.gov/study/NCT12345678",
      "eligibility": {
        "gender": "Female",
        "min_age": "18 Years",
        "max_age": "75 Years",
        "healthy_volunteers": "No"
      }
    }
  ]
}

ICD-10代码查找

GET /api/medical_terminology?code={code}&description={description}&max_results={max_results}

参数:

  • code :要查找的 ICD-10 代码(如果提供了描述则为可选)

  • description :要搜索的医疗状况描述(如果提供了代码,则为可选)

  • max_results :返回的最大结果数(默认值:10,最大值:50)

响应示例:

{
  "status": "success",
  "search_type": "description",
  "search_term": "diabetes",
  "total_results": 25,
  "codes": [
    {
      "code": "E11",
      "description": "Type 2 diabetes mellitus",
      "category": "Endocrine, nutritional and metabolic diseases"
    },
    {
      "code": "E10",
      "description": "Type 1 diabetes mellitus",
      "category": "Endocrine, nutritional and metabolic diseases"
    }
  ]
}

通用工具执行

POST /mcp/call-tool

请求正文:

{
  "name": "fda_drug_lookup",
  "arguments": {
    "drug_name": "aspirin",
    "search_type": "general"
  },
  "session_id": "optional-session-id"
}

编程 API

以编程方式使用 MCP 服务器时,可以使用以下功能:

FDA药品查询

fda_drug_lookup(drug_name: str, search_type: str = "general")

参数:

  • drug_name :要搜索的药品名称

  • search_type :要检索的信息类型

    • general :基本药物信息(默认)

    • label :药品标签信息

    • adverse_events :报告的不良事件

PubMed 搜索

pubmed_search(query: str, max_results: int = 5, date_range: str = "")

参数:

  • query :医学文献的搜索查询

  • max_results :返回的最大结果数(默认值:5)

  • date_range :限制为几年内发表的文章(例如“5”表示过去 5 年)

健康话题

health_topics(topic: str, language: str = "en")

参数:

  • topic :健康主题搜索信息

  • language :内容语言(en 或 es,默认值:en)

临床试验搜索

clinical_trials_search(condition: str, status: str = "recruiting", max_results: int = 10)

参数:

  • condition :要搜索的医疗状况或疾病

  • status :试用状态(招募中、已完成、活跃、未招募或全部)

  • max_results :返回的最大结果数

ICD-10代码查找

lookup_icd_code(code: str = None, description: str = None, max_results: int = 10)

参数:

  • code :要查找的 ICD-10 代码(如果提供了描述则为可选)

  • description :要搜索的医疗状况描述(如果提供了代码,则为可选)

  • max_results :返回的最大结果数

数据源

该 MCP 服务器利用了多个公开可用的医疗保健 API:

高级版本(仍在构建中)

这是 Healthcare MCP Server 的免费版本,但有使用限制。如需高级功能和更高的使用限制,请查看我们的高级版本:

  • 无限 API 调用

  • 先进的医疗保健数据工具

  • 自定义集成

  • 优先支持

执照

MIT 许可证

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cicatriiz/healthcare-mcp-public'

If you have feedback or need assistance with the MCP directory API, please join our Discord server