Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

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

README.md

🩺 MCP-Based AI Doctor Assistant

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

![Python](https://python.org) ![MCP](https://modelcontextprotocol.io) ![License](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"
  1. Create virtual environment
   python -m venv venv
   
   # Windows
   .\venv\Scripts\activate
   
   # Mac/Linux
   source venv/bin/activate
  1. Install dependencies
   pip install -r requirements.txt
  1. 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
  1. 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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.