Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Intelligent Medical AssistantShow me a summary of Ben's blood pressure and sleep quality for the past week."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π₯ Intelligent Medical Assistant
A comprehensive Patient-Centric Medical Intelligence System that combines MCP (Model Context Protocol) server capabilities with an intelligent web interface. This system provides natural language medical queries, patient data analysis, and professional medical insights powered by Gemini AI.
β¨ Key Features
π€ Intelligent Medical Assistant
Natural Language Processing - Ask questions like "What is Ben's sleep summary?"
Automatic Tool Routing - AI decides which patient data to access
Conversational Interface - Single input for all medical queries
Professional Medical Responses - Evidence-based information with disclaimers
π₯ Patient Data Management
Real Patient Data - CSV-based patient records and biometrics
Comprehensive Tracking - Sleep patterns, vital signs, lab results, medications
Trend Analysis - Historical data analysis and insights
Multi-Patient Support - Manage multiple patient records
π§ Dual Architecture
MCP Server - Integration with Kiro IDE and other MCP clients
Web Application - Professional web interface with authentication
RESTful API - Programmatic access to medical data and insights
π Available Patient Data
Ben Smith (34M) - Hypertension, Type 2 Diabetes
15 days of detailed sleep data (duration, quality, efficiency)
Vital signs tracking (BP, heart rate, glucose, weight)
Sarah Jones (28F) - Asthma
Mike Wilson (45M) - High Cholesterol
π Quick Start
1. Installation
# Clone and setup
git clone https://github.com/sp2learn/medical-mcp-server.git
cd medical-mcp-server
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt2. Configuration
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
MEDICAL_MODEL=gemini
GOOGLE_API_KEY=your_gemini_api_key_here
DISPLAY_TIMEZONE=America/New_York3. Run the System
Web Application:
python web_app.py
# Visit: http://localhost:8000
# Login: demo/password, doctor/secret123, admin/admin2024MCP Server:
python server.py
# For integration with Kiro IDE or other MCP clientsπ― Usage Examples
Natural Language Queries
The intelligent assistant understands natural language and automatically routes to appropriate tools:
π©Ί "What is Ben's sleep summary for the past week?"
β Analyzes sleep data, provides trends and insights
π "Show me Ben's blood pressure trends"
β Reviews vital signs, identifies patterns
π "What medications is Ben taking?"
β Lists current medications and adherence data
π "What are the symptoms of diabetes?"
β Provides general medical information
π "Compare Ben's glucose levels over time"
β Analyzes lab data and trendsMCP Integration
Add to your Kiro IDE configuration (.kiro/settings/mcp.json):
{
"mcpServers": {
"medical-query": {
"command": "/path/to/medical-mcp-server/venv/bin/python",
"args": ["/path/to/medical-mcp-server/server.py"],
"disabled": false,
"autoApprove": [
"medical_query",
"symptom_checker",
"get_patient_sleep_pattern",
"get_patient_vitals",
"get_patient_labs",
"get_medication_adherence",
"get_patient_activity",
"get_patient_overview"
]
}
}
}π οΈ Available Tools
MCP Tools (8 total)
Tool | Description | Example Usage |
| General medical Q&A | "What causes hypertension?" |
| Symptom analysis | Analyze: headache, fever, fatigue |
| Sleep data analysis | Ben's sleep for 30 days |
| Vital signs summary | Ben's latest BP readings |
| Laboratory results | Ben's glucose trends |
| Medication compliance | Ben's medication adherence |
| Physical activity data | Ben's activity levels |
| Complete patient summary | Ben's full medical profile |
Tool Management
# List all tools and their status
python manage_tools.py list
# Show detailed tool information
python manage_tools.py details get_patient_sleep_pattern
# Enable/disable tools
python manage_tools.py enable medical_query
python manage_tools.py disable symptom_checkerπ Project Structure
medical-mcp-server/
βββ π€ Core Intelligence
β βββ intelligent_medical_assistant.py # Natural language processing
β βββ medical_client.py # AI model integration
β βββ patient_data_manager.py # Patient data management
βββ π Web Interface
β βββ web_app.py # FastAPI web application
β βββ templates/ # HTML templates
β β βββ dashboard.html # Main interface
β β βββ login.html # Authentication
β β βββ base.html # Base template
β βββ static/ # CSS, JavaScript, assets
βββ π§ MCP Server
β βββ server.py # MCP protocol server
β βββ tool_config.py # Centralized tool configuration
β βββ manage_tools.py # Tool management CLI
βββ π Patient Data
β βββ data/
β βββ patients.csv # Patient demographics
β βββ ben_sleep_data.csv # Ben's sleep metrics
β βββ ben_vitals_data.csv # Ben's vital signs
βββ π Deployment
βββ Dockerfile # Container configuration
βββ docker-compose.yml # Multi-service setup
βββ render.yaml # Render deployment configπ Deployment
Local Development
source venv/bin/activate
python web_app.py
# Access: http://localhost:8000Cloud Deployment (Render)
Push to GitHub
Connect repository to Render
Set environment variables:
MEDICAL_MODEL=geminiGOOGLE_API_KEY=your_key
Deploy automatically
Docker Deployment
# Build and run with Docker Compose
docker-compose up --build
# Or build manually
docker build -t medical-mcp-server .
docker run -p 8000:8000 --env-file .env medical-mcp-serverπ Authentication & Security
Web Interface
Session-based authentication with secure cookies
Role-based access (demo, doctor, admin accounts)
24-hour session expiration
HTTPS ready for production deployment
Demo Accounts
Username | Password | Role | Description |
|
| Patient | Basic demo access |
|
| Healthcare Provider | Full medical access |
|
| Administrator | System administration |
π Patient Data Format
Patient Demographics (
patient_id,first_name,last_name,age,gender,conditions,medications,last_visit
ben_smith,Ben,Smith,34,male,"hypertension,type_2_diabetes","metformin,lisinopril",2024-01-15Sleep Data (
date,sleep_hours,bedtime,wake_time,sleep_quality,deep_sleep_minutes,rem_sleep_minutes
2024-09-14,7.2,22:30,05:42,good,85,92Vital Signs (
date,systolic_bp,diastolic_bp,heart_rate,temperature_f,weight_kg,glucose_mg_dl
2024-09-14,142,88,72,98.6,78.2,156π§ͺ Testing
# Test MCP server functionality
python test_server.py
# Test tool configuration
python manage_tools.py list
# Test web application
curl http://localhost:8000/health
# Run comprehensive tests
./run_tests.shπ€ Contributing
Fork the repository
Create feature branch (
git checkout -b feature/amazing-feature)Commit changes (
git commit -m 'Add amazing feature')Push to branch (
git push origin feature/amazing-feature)Open Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
Issues: GitHub Issues
Documentation: See individual module docstrings
Examples: Check the
examples/directory
β οΈ Medical Disclaimer
This tool provides general medical information for educational and professional reference purposes only. It is not intended to be a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of qualified healthcare providers with any questions regarding medical conditions or treatment decisions.
Built with β€οΈ for healthcare professionals and medical AI research