A comprehensive Model Context Protocol (MCP) server for accessing WHOOP fitness and health data with enhanced API v2 features, real-time analytics, and secure cloud deployment.
- Enhanced sleep analysis with sleep latency and efficiency scores
- Elevation tracking for workouts (altitude gain/change)
- Recovery load breakdown by cardiovascular, musculoskeletal, and metabolic systems
- Training readiness assessment combining multiple health metrics
- Body composition tracking with comprehensive measurements
- Data quality indicators showing percent recorded for each metric
- Workout Analysis - Detailed performance metrics with heart rate zones
- Sleep Quality Analysis - Comprehensive sleep optimization recommendations
- Recovery Load Analysis - System-specific recovery strategies
- Training Readiness - Multi-factor readiness scoring
- STDIO - Local development with Claude Desktop
- WebSocket - Real-time cloud communication
- HTTP REST API - Automation and integration
- SSE - Server-sent events for live monitoring
- API key authentication for all sensitive endpoints
- Rate limiting (60 requests/minute per IP)
- Security headers (HSTS, CSP, X-Frame-Options)
- Input validation and sanitization
- Request logging with IP tracking
- Encrypted cloud deployment on fly.io
- US units prioritization (miles, Fahrenheit, etc.)
- EST timezone conversion for all timestamps
- Pretty-printed outputs with actionable insights
- Custom prompts for personalized responses
WHOOP-mcp/
βββ π README.md # This file
βββ π§ requirements.txt # Python dependencies
βββ π§ pyproject.toml # Project configuration
βββ π§ uv.lock # Locked dependencies
βββ π .env.example # Environment template
βββ π .gitignore # Git ignore rules
β
βββ π whoop_mcp.py # Main MCP server
βββ π web_server.py # Web/WebSocket server
β
βββ π docs/ # Documentation
β βββ π stdio-guide.md # Local STDIO setup
β βββ π websocket-guide.md # WebSocket connections
β βββ π§ http-guide.md # REST API usage
β βββ π‘ sse-guide.md # Server-sent events
β βββ π DEPLOYMENT.md # Cloud deployment
β βββ π SECURITY.md # Security guidelines
β
βββ π deployment/ # Deployment files
β βββ π³ Dockerfile # Container configuration
β βββ βοΈ fly.toml # fly.io configuration
β βββ π deploy.sh # Deployment script
β
βββ π§ͺ tests/ # Test files
βββ π§ͺ test_deployment.py # Deployment tests
βββ π test_security.py # Security tests
# Clone and setup
git clone <your-repo>
cd WHOOP-mcp
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your WHOOP API credentials
# Run locally
python whoop_mcp.pyπ Complete STDIO Guide
# Deploy to fly.io
./deployment/deploy.sh
# Set your WHOOP credentials
flyctl secrets set WHOOP_CLIENT_ID=your_client_id
flyctl secrets set WHOOP_CLIENT_SECRET=your_client_secretπ Complete Deployment Guide
- π STDIO Guide - Local development with Claude Desktop
- π WebSocket Guide - Real-time cloud connections
- π§ HTTP Guide - REST API automation
- π‘ SSE Guide - Server-sent events streaming
- π Deployment Guide - fly.io cloud deployment
- π Security Guide - Security best practices
| Tool | Description |
|---|---|
get_sleep_data |
Sleep data with quality metrics and EST timezone |
get_recovery_data |
Recovery scores with load breakdown |
get_workout_data |
Workout data with sport names and elevation |
get_cycle_data |
Daily cycle data (strain/load) |
get_profile_data |
User profile information |
get_body_measurement_data |
Body composition tracking |
| Tool | Description |
|---|---|
get_workout_analysis |
Detailed performance analysis with zones |
get_sleep_quality_analysis |
Sleep optimization recommendations |
get_recovery_load_analysis |
System-specific recovery strategies |
get_training_readiness |
Multi-factor readiness assessment |
| Tool | Description |
|---|---|
get_sports_mapping |
Sport ID to name mapping |
search_whoop_sports |
Search for specific sports |
set_custom_prompt |
Customize server responses |
get_custom_prompt |
View current custom prompt |
clear_custom_prompt |
Reset to default prompt |
# WHOOP API (required)
WHOOP_CLIENT_ID=your_whoop_client_id
WHOOP_CLIENT_SECRET=your_whoop_client_secret
# Optional: Custom redirect URI
WHOOP_REDIRECT_URI=http://localhost:8000/whoop/callback
# Cloud deployment (auto-generated if not set)
API_SECRET_KEY=your_secure_api_key
# Web server configuration
PORT=8080
HOST=0.0.0.0
ENVIRONMENT=productionAdd to your ~/.claude/mcp.json:
Local (STDIO):
{
"mcpServers": {
"whoop": {
"command": "python",
"args": ["/path/to/WHOOP-mcp/whoop_mcp.py"],
"env": {
"WHOOP_CLIENT_ID": "your_client_id",
"WHOOP_CLIENT_SECRET": "your_client_secret"
}
}
}
}Cloud (WebSocket):
{
"mcpServers": {
"whoop-cloud": {
"command": "node",
"args": ["/path/to/websocket-client.js"],
"env": {
"WHOOP_MCP_URL": "wss://your-app.fly.dev/mcp",
"WHOOP_API_KEY": "your_api_key"
}
}
}
}# Test security features
python tests/test_security.py
# Test deployment
python tests/test_deployment.py
# Test local server
python whoop_mcp.py --testThis project implements enterprise-grade security:
- β No sensitive data in git - All credentials use environment variables
- β API key authentication - Required for all sensitive endpoints
- β Rate limiting - 60 requests/minute per IP
- β Security headers - HSTS, CSP, X-Frame-Options
- β Input validation - Message size limits and sanitization
- β Request logging - All access monitored with IP tracking
π Security Guide | π‘οΈ Security Testing
# Get recent sleep data
await get_sleep_data()
# Analyze workout performance
await get_workout_analysis(workout_id="12345")
# Check training readiness
await get_training_readiness()# Comprehensive health assessment
recovery = await get_recovery_load_analysis()
sleep = await get_sleep_quality_analysis()
readiness = await get_training_readiness()# Set custom prompt for personalized responses
await set_custom_prompt("Always provide actionable health insights and include relevant medical disclaimers.")Your WHOOP MCP server is deployed and accessible at:
π Base URL: https://whoop-mcp.fly.dev
- Health Check:
https://whoop-mcp.fly.dev/health - Server Info:
https://whoop-mcp.fly.dev/
- Available Tools:
https://whoop-mcp.fly.dev/tools - Auth Status:
https://whoop-mcp.fly.dev/auth - WebSocket MCP:
wss://whoop-mcp.fly.dev/mcp
- Follow security guidelines in docs/SECURITY.md
- Never commit sensitive data (API keys, credentials)
- Test your changes with the provided test suites
- Update documentation for new features
This project is licensed under the MIT License.
- Documentation Issues: Check the docs/ folder
- Security Concerns: Review docs/SECURITY.md
- Deployment Problems: See docs/DEPLOYMENT.md
- Connection Issues: Try different connection guides
Made with β€οΈ for the WHOOP community | Powered by Claude MCP π€