Skip to main content
Glama
Healthcare MCP Server

Healthcare MCP Server

by Cicatriiz

医疗保健 MCP 服务器

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

概述

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

Related MCP server: Smart EHR MCP Server

特征

  • 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 许可证

Available Tools

7 tools
fda_drug_lookupC

Look up drug information from the FDA database

Inputs: drug_name (required), search_type.

get_all_usage_statsB

Get overall usage statistics for all sessions

Inputs: no named parameters.

get_usage_statsB

Get usage statistics for the current session

Inputs: no named parameters.

health_topicsC

Get evidence-based health information on various topics

Inputs: topic (required), language.

lookup_icd_codeC

Look up ICD-10 codes by code or description

Inputs: code, description, max_results.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting different healthcare data sources like clinical trials, drugs, health topics, ICD codes, and PubMed. However, get_all_usage_stats and get_usage_stats overlap in functionality, both dealing with usage statistics, which could cause confusion in selection.

    Naming Consistency3/5

    The naming is mixed with some tools using verb_noun patterns like clinical_trials_search and pubmed_search, while others use noun phrases like health_topics or lookup_icd_code. This inconsistency reduces predictability but remains readable overall.

    Tool Count5/5

    With 7 tools, the count is well-scoped for a healthcare server, covering key areas like drug info, medical literature, coding, and trials. Each tool appears to earn its place without being overwhelming or insufficient.

    Completeness4/5

    The toolset provides broad coverage for healthcare information retrieval, including drugs, literature, codes, and trials. A minor gap exists in lacking update or management tools for these resources, but agents can work effectively with the search and lookup functions provided.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that provides health data from the Senechal API to LLM applications, enabling AI assistants to access, analyze, and respond to personal health information.
      GPL 3.0
    • A
      license
      Not graded
      quality
      F
      maintenance
      A Model Context Protocol server that connects AI tools to Electronic Health Records using SMART on FHIR, allowing secure searching, querying, and analysis of patient data from compatible EHRs.
      88
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables querying FHIR healthcare data using natural language, allowing doctors to retrieve patient information, medications, observations, and other healthcare records.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A governed, audited Model Context Protocol server that provides AI agents with secure, read-only access to a clinical knowledge base through least-privilege tools, policy validation, and append-only audit logging.
      MIT