Orchid1970/fitness-health-mcp
If you are the rightful owner of fitness-health-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Fitness & Health MCP Server aggregates data from various fitness and health tracking services into a unified interface, providing a comprehensive overview of your health metrics and workout activities.
Fitness & Health MCP Server
A Model Context Protocol (MCP) server that aggregates data from multiple fitness and health tracking services into a unified interface.
Supported Services
- Peloton - Cycling and fitness workouts
- Nike Run Club - Running activities (limited support)
- Withings - Health metrics (weight, heart rate, blood pressure)
- Apple HealthKit - Comprehensive health data via XML export
- Sleep Number - Sleep tracking (placeholder)
- Hydrow - Rowing workouts (placeholder)
Features
- 🏋️ Unified Workout Aggregation - Get all workouts across platforms
- 😴 Sleep Data Synthesis - Combine sleep data from multiple sources
- 📊 Health Metrics - Track weight, heart rate, and other vitals
- 🔐 OAuth2 Support - Secure authentication for supported services
- 📈 Health Summary - Comprehensive overview of your fitness data
Installation
- Clone this repository:
git clone https://github.com/Orchid1970/fitness-health-mcp.git
cd fitness-health-mcp
- Install dependencies:
pip install -r requirements.txt
- Configure your services:
cp config.example.json config.json
# Edit config.json with your API credentials
Configuration
Peloton
- Uses username/password authentication
- No API key required
- Call
peloton_logintool with credentials
Withings
- Register your application at Withings Developer Portal
- Get your
client_idandclient_secret - Add them to
config.json - Use
authorize_servicetool to start OAuth flow
Apple HealthKit
- Export your health data from iPhone:
- Health app → Profile → Export All Health Data
- Extract the
export.xmlfile - Provide the path when calling tools
Nike Run Club, Sleep Number, Hydrow
- These services have limited or no public API
- Placeholder implementations provided
- Community contributions welcome!
Usage
Running the Server
python server.py
The server will start and listen for MCP protocol messages via stdio.
Available Tools
get_all_workouts
Aggregate workouts from all connected services.
{
"days": 7,
"services": ["peloton", "nike_run", "hydrow", "apple_healthkit"]
}
get_all_sleep_data
Get sleep data from Sleep Number and Apple HealthKit.
{
"days": 7
}
get_health_metrics
Retrieve health metrics from Withings.
{
"days": 30
}
get_peloton_workouts
Get Peloton-specific workouts.
{
"limit": 10
}
peloton_login
Authenticate with Peloton.
{
"username": "your_email@example.com",
"password": "your_password"
}
authorize_service
Start OAuth flow for Withings.
{
"service": "withings"
}
get_health_summary
Get comprehensive health and fitness summary.
{
"days": 7
}
Deploying to SimTheory.ai
- Push to GitHub (already done!)
- Connect to SimTheory.ai:
- Go to SimTheory.ai MCP settings
- Add GitHub MCP server
- Point to:
https://github.com/Orchid1970/fitness-health-mcp
- Configure credentials via environment variables or config file
- Start using the tools in your AI conversations!
Project Structure
fitness-health-mcp/
├── server.py # Main MCP server
├── requirements.txt # Python dependencies
├── config.example.json # Example configuration
├── README.md # This file
└── services/ # Service connectors
├── __init__.py
├── base.py # Base connector class
├── peloton.py # Peloton integration
├── nike_run.py # Nike Run Club (placeholder)
├── withings.py # Withings OAuth2
├── apple_healthkit.py # Apple HealthKit XML parser
├── sleepnumber.py # Sleep Number (placeholder)
└── hydrow.py # Hydrow (placeholder)
Development
Adding a New Service
- Create a new file in
services/(e.g.,garmin.py) - Extend the
ServiceConnectorbase class - Implement required methods:
authorize()- Start auth flowget_workouts()- Fetch workout dataget_sleep()- Fetch sleep data (if applicable)
- Add connector to
server.py - Add tools for the new service
Testing
# Test individual connectors
python -c "from services.peloton import Connector; c = Connector({}); print(c.authorize())"
Security Notes
- Never commit API keys or passwords to the repository
- Use environment variables for sensitive data
- Review each service's terms of service
- Some services (Nike, Sleep Number) may require unofficial methods
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add your changes
- Submit a pull request
Priority areas:
- Implementing Nike Run Club integration
- Adding Sleep Number support
- Hydrow API integration
- Additional health services (Garmin, Fitbit, etc.)
License
MIT License - See LICENSE file for details
Support
For issues or questions:
- Open a GitHub issue
- Contact: Timothy Escamilla
Roadmap
- Complete Nike Run Club integration
- Add Garmin Connect support
- Implement data caching
- Add data visualization tools
- Create web dashboard
- Add export to CSV/JSON
- Implement data sync scheduling
Built with ❤️ for unified health and fitness tracking