AI Doctor Assistant MCP Server

AI Doctor Assistant MCP Server

Provides 12 medical tools for symptom checking, lab report explanation, emergency detection, and health advice, emphasizing safety and disclaimers.

Category
访问服务器

README

🩺 MCP-Based AI Doctor Assistant

Your Virtual Medical Advisor powered by Model Context Protocol (MCP)

Python MCP License


⚠️ IMPORTANT DISCLAIMER

This AI assistant is NOT a replacement for professional medical advice, diagnosis, or treatment.

  • ❌ Cannot diagnose diseases
  • ❌ Cannot prescribe medications
  • ❌ Cannot replace a real doctor
  • ✅ CAN provide health information
  • ✅ CAN detect potential emergencies
  • ✅ CAN explain medical terms

Always consult a qualified healthcare provider for medical decisions.


🌟 Features

12 Medical Tools

Tool Description
🔍 check_symptoms Analyze symptoms, assess risk level, provide self-care tips
🚨 detect_emergency Detect life-threatening situations, provide immediate guidance
🔬 explain_lab_report Explain blood tests, lab values in simple language
💪 health_advice Exercise, sleep, stress management, lifestyle tips
💊 medicine_info Medicine information (NOT prescriptions)
🧠 mental_health_support Anxiety, stress, depression resources, crisis helplines
🥗 diet_nutrition Diet plans for diabetes, heart health, weight loss
🆘 first_aid_guide Step-by-step first aid for emergencies
🤰 pregnancy_guide Trimester-specific pregnancy information
👶 child_health Vaccination schedules, pediatric guidance
🏥 chronic_disease_info Diabetes, hypertension, heart disease management
📍 find_hospital Help finding nearby healthcare facilities

Safety Features

  • Emergency Detection: Automatically detects life-threatening symptoms
  • Medical Disclaimers: Every response includes appropriate warnings
  • No Prescriptions: Never recommends specific medications or dosages
  • Doctor Referral: Always encourages professional consultation
  • Audit Logging: All interactions can be logged for review

🚀 Quick Start

Prerequisites

  • Python 3.11 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd "MCP-Based AI Doctor Assistant"
    
  2. Create virtual environment

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

    pip install -r requirements.txt
    
  4. Configure environment variables

    # Copy example env file
    cp .env.example .env
    
    # Edit .env and add your Gemini API key (optional, for enhanced AI responses)
    # Get free key at: https://makersuite.google.com/app/apikey
    
  5. Run the server

    python -m src.server
    

🔧 Configuration

Environment Variables

Variable Description Required
GEMINI_API_KEY Google Gemini API key for AI responses Optional
SERVER_HOST Server host (default: 0.0.0.0) No
SERVER_PORT Server port (default: 8000) No
DEBUG_MODE Enable debug mode (default: true) No
LOG_LEVEL Logging level (default: INFO) No

MCP Configuration

The server can be configured in Claude Desktop or other MCP clients:

{
  "mcpServers": {
    "ai-doctor": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "/path/to/MCP-Based AI Doctor Assistant"
    }
  }
}

📖 Usage Examples

Checking Symptoms

# Using the MCP tool
{
    "tool": "check_symptoms",
    "arguments": {
        "symptoms": ["headache", "fever", "fatigue"],
        "age": 35,
        "gender": "male",
        "duration": "2 days"
    }
}

Explaining Lab Reports

{
    "tool": "explain_lab_report",
    "arguments": {
        "tests": {
            "hemoglobin": 12.5,
            "wbc": 7500,
            "fasting_glucose": 110
        },
        "gender": "female"
    }
}

Getting Health Advice

{
    "tool": "health_advice",
    "arguments": {
        "topic": "sleep"
    }
}

Emergency Detection

{
    "tool": "detect_emergency",
    "arguments": {
        "symptoms": ["chest pain", "shortness of breath"],
        "context": "Started suddenly while walking"
    }
}

🏗️ Project Structure

MCP-Based AI Doctor Assistant/
├── src/
│   ├── __init__.py
│   ├── server.py           # Main MCP server
│   ├── config.py           # Configuration
│   │
│   ├── core/
│   │   ├── safety_engine.py    # Emergency detection, disclaimers
│   │   ├── llm_client.py       # Gemini API client
│   │   └── memory.py           # Conversation memory
│   │
│   └── tools/
│       ├── symptom_checker.py
│       ├── emergency_detector.py
│       ├── lab_report.py
│       ├── health_advisor.py
│       ├── medicine_info.py
│       ├── mental_health.py
│       ├── diet_nutrition.py
│       ├── first_aid.py
│       ├── pregnancy.py
│       ├── child_health.py
│       ├── chronic_disease.py
│       └── hospital_finder.py
│
├── requirements.txt
├── mcp_config.json
├── .env.example
└── README.md

🔒 Safety & Compliance

Emergency Detection

The system automatically detects critical symptoms like:

  • Chest pain / Heart attack signs
  • Difficulty breathing
  • Signs of stroke (FAST)
  • Severe bleeding
  • Loss of consciousness
  • Suicidal thoughts
  • Poisoning

When detected: AI reasoning stops immediately, emergency instructions are provided.

Medical Disclaimers

Every response includes:

  • Clear statement that this is not medical advice
  • Recommendation to consult healthcare providers
  • Emergency contact numbers when appropriate

What This System Does NOT Do

  • ❌ Diagnose diseases
  • ❌ Prescribe medications
  • ❌ Recommend specific dosages
  • ❌ Replace professional medical judgment
  • ❌ Store personal health information persistently

🌐 Free Deployment Options

Option 1: Render.com

  1. Create account at render.com
  2. New Web Service → Connect GitHub
  3. Add environment variables
  4. Deploy (Free tier: 750 hours/month)

Option 2: Railway.app

  1. Create account at railway.app
  2. New Project → Deploy from GitHub
  3. Add environment variables
  4. Deploy (Free tier: $5 credit/month)

🧪 Testing

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src --cov-report=html

📞 Emergency Contact Numbers

Country Service Number
🇮🇳 India National Emergency 112
🇮🇳 India Ambulance 108
🇺🇸 USA Emergency 911
🇬🇧 UK Emergency 999
🇪🇺 EU Emergency 112
🌍 International Varies IASP Directory

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Guidelines

  • Always maintain safety features
  • Add appropriate disclaimers
  • Test emergency detection
  • Document new features

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • Built using Model Context Protocol (MCP)
  • Medical information sourced from WHO, CDC, NIH public guidelines
  • Emergency protocols based on standard first aid guidelines

⚠️ Final Reminder

This AI assistant provides INFORMATION, not MEDICAL ADVICE.

For any health concerns:

  1. 🏥 Consult a qualified healthcare provider
  2. 📞 Call emergency services for urgent situations
  3. 🚑 Visit the nearest hospital for serious symptoms

Your health matters. Trust professionals, not AI.


Made with ❤️ for better health awareness

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选