fitness-health-mcp

Orchid1970/fitness-health-mcp

3.2

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.

Tools
5
Resources
0
Prompts
0

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

  1. Clone this repository:
git clone https://github.com/Orchid1970/fitness-health-mcp.git
cd fitness-health-mcp
  1. Install dependencies:
pip install -r requirements.txt
  1. 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_login tool with credentials

Withings

  1. Register your application at Withings Developer Portal
  2. Get your client_id and client_secret
  3. Add them to config.json
  4. Use authorize_service tool to start OAuth flow

Apple HealthKit

  1. Export your health data from iPhone:
    • Health app → Profile → Export All Health Data
  2. Extract the export.xml file
  3. 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

  1. Push to GitHub (already done!)
  2. Connect to SimTheory.ai:
    • Go to SimTheory.ai MCP settings
    • Add GitHub MCP server
    • Point to: https://github.com/Orchid1970/fitness-health-mcp
  3. Configure credentials via environment variables or config file
  4. 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

  1. Create a new file in services/ (e.g., garmin.py)
  2. Extend the ServiceConnector base class
  3. Implement required methods:
    • authorize() - Start auth flow
    • get_workouts() - Fetch workout data
    • get_sleep() - Fetch sleep data (if applicable)
  4. Add connector to server.py
  5. 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:

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes
  4. 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