Sponsored by Deepsite.site

Healthcare MCP Server

Created By
Cicatriiz8 months ago
A Model Context Protocol server providing AI assistants with access to healthcare data tools, including FDA drug information, PubMed research, health topics, clinical trials, and medical terminology lookup.
Content

Healthcare MCP Server

A Model Context Protocol (MCP) server providing AI assistants with access to healthcare data and medical information tools.

Overview

Healthcare MCP Server is a specialized server that implements the Model Context Protocol (MCP) to provide AI assistants with access to healthcare data and medical information tools. It enables AI models to retrieve accurate, up-to-date medical information from authoritative sources.

Features

  • FDA Drug Information: Search and retrieve comprehensive drug information from the FDA database
  • PubMed Research: Search medical literature from PubMed's database of scientific articles
  • Health Topics: Access evidence-based health information from Health.gov
  • Clinical Trials: Search for ongoing and completed clinical trials
  • Medical Terminology: Look up ICD-10 codes and medical terminology definitions
  • Caching: Efficient caching system with connection pooling to reduce API calls and improve performance
  • Usage Tracking: Anonymous usage tracking to monitor API usage
  • Error Handling: Robust error handling and logging
  • Multiple Interfaces: Support for both stdio (for CLI) and HTTP/SSE interfaces
  • API Documentation: Interactive API documentation with Swagger UI
  • Comprehensive Testing: Extensive test suite with pytest and coverage reporting

Installation

Manual Installation

  1. Clone the repository:

    git clone https://github.com/Cicatriiz/healthcare-mcp-public.git
    cd healthcare-mcp-public
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Set up environment variables (optional):

    # Create .env file from example
    cp .env.example .env
    # Edit .env with your API keys (optional)
    
  5. Run the server:

    python run.py
    

Usage

Running in Different Transport Modes

  • stdio mode (default, for Cline):

    python run.py
    
  • HTTP/SSE mode (for web clients):

    python run.py --http --port 8000
    

Testing the Tools

You can test the MCP tools using the new pytest-based test suite:

# 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

For backward compatibility, you can still run the old tests:

# 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 Reference

The Healthcare MCP Server provides both a programmatic API for direct integration and a RESTful HTTP API for web clients.

RESTful API Endpoints

When running in HTTP mode, the following endpoints are available:

Health Check

GET /health

Returns the status of the server and its services.

FDA Drug Lookup

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

Parameters:

  • drug_name: Name of the drug to search for
  • search_type: Type of information to retrieve
    • general: Basic drug information (default)
    • label: Drug labeling information
    • adverse_events: Reported adverse events

Example Response:

{
  "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"
        }
      ]
    }
  ]
}
GET /api/pubmed?query={query}&max_results={max_results}&date_range={date_range}

Parameters:

  • query: Search query for medical literature
  • max_results: Maximum number of results to return (default: 5, max: 50)
  • date_range: Limit to articles published within years (e.g. '5' for last 5 years)

Example Response:

{
  "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/"
    }
  ]
}

Health Topics

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

Parameters:

  • topic: Health topic to search for information
  • language: Language for content (en or es, default: en)

Example Response:

{
  "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}

Parameters:

  • condition: Medical condition or disease to search for
  • status: Trial status (recruiting, completed, active, not_recruiting, or all)
  • max_results: Maximum number of results to return (default: 10, max: 100)

Example Response:

{
  "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 Code Lookup

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

Parameters:

  • code: ICD-10 code to look up (optional if description is provided)
  • description: Medical condition description to search for (optional if code is provided)
  • max_results: Maximum number of results to return (default: 10, max: 50)

Example Response:

{
  "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"
    }
  ]
}

Generic Tool Execution

POST /mcp/call-tool

Request Body:

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

Programmatic API

When using the MCP server programmatically, the following functions are available:

FDA Drug Lookup

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

Parameters:

  • drug_name: Name of the drug to search for
  • search_type: Type of information to retrieve
    • general: Basic drug information (default)
    • label: Drug labeling information
    • adverse_events: Reported adverse events

PubMed Search

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

Parameters:

  • query: Search query for medical literature
  • max_results: Maximum number of results to return (default: 5)
  • date_range: Limit to articles published within years (e.g. '5' for last 5 years)

Health Topics

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

Parameters:

  • topic: Health topic to search for information
  • language: Language for content (en or es, default: en)

Clinical Trials Search

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

Parameters:

  • condition: Medical condition or disease to search for
  • status: Trial status (recruiting, completed, active, not_recruiting, or all)
  • max_results: Maximum number of results to return

ICD-10 Code Lookup

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

Parameters:

  • code: ICD-10 code to look up (optional if description is provided)
  • description: Medical condition description to search for (optional if code is provided)
  • max_results: Maximum number of results to return

Data Sources

This MCP server utilizes several publicly available healthcare APIs:

Premium Version (still being built)

This is the free version of Healthcare MCP Server with usage limits. For advanced features and higher usage limits, check out our premium version:

  • Unlimited API calls
  • Advanced healthcare data tools
  • Custom integrations
  • Priority support

License

MIT License

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.