AI Doctor Assistant MCP Server
Provides 12 medical tools for symptom checking, lab report explanation, emergency detection, and health advice, emphasizing safety and disclaimers.
README
๐ฉบ MCP-Based AI Doctor Assistant
Your Virtual Medical Advisor powered by Model Context Protocol (MCP)
โ ๏ธ 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
-
Clone the repository
git clone <repository-url> cd "MCP-Based AI Doctor Assistant" -
Create virtual environment
python -m venv venv # Windows .\venv\Scripts\activate # Mac/Linux source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
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 -
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
- Create account at render.com
- New Web Service โ Connect GitHub
- Add environment variables
- Deploy (Free tier: 750 hours/month)
Option 2: Railway.app
- Create account at railway.app
- New Project โ Deploy from GitHub
- Add environment variables
- 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:
- Fork the repository
- Create a feature branch
- Make your changes
- 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:
- ๐ฅ Consult a qualified healthcare provider
- ๐ Call emergency services for urgent situations
- ๐ Visit the nearest hospital for serious symptoms
Your health matters. Trust professionals, not AI.
Made with โค๏ธ for better health awareness
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.