Provides comprehensive access to Strava API for marathon training and race analysis, including activity data retrieval, training metrics, heart rate zone analysis, pace trends, training load monitoring, injury risk detection, and recovery analysis.
Strava Training MCP
A comprehensive Model Context Protocol (MCP) server that provides full access to the Strava API, specifically designed for marathon training and race analysis. This server enables language models to query detailed athlete data, analyze training patterns, track performance metrics, and plan races.
Features
Comprehensive Activity Data: Access detailed activity information including pace, heart rate, power, cadence, GPS coordinates, and more
Training Analysis: Weekly and monthly training metrics, pace trends, and long run analysis
Detailed Streams: Time-series data for analyzing performance throughout activities
Laps & Splits: Analyze pace consistency and splits for race preparation
Zone Analysis: Heart rate and power zone data for training intensity analysis
Athlete Statistics: Year-to-date totals, personal records, and achievement tracking
Marathon Training Tools: Heart rate zone analysis, training load monitoring, injury risk detection, and recovery analysis
Built-in Authentication: Streamlined OAuth flow with MCP tools - no separate scripts needed
Multiple Transports: Support for stdio, SSE, and streamable-http transports
Installation
Using uv (Recommended)
Using pip
Quick Start
Get Strava API credentials from Strava API Settings
Start the server (it will guide you through authentication)
Use MCP tools to authenticate and query your Strava data
See QUICK_START.md for detailed authentication instructions.
Available Tools
Authentication & Setup
get_strava_auth_token(client_id, client_secret, auth_code): Complete authentication in one step (recommended)save_credentials(client_id, client_secret): Save your Strava API credentialsget_auth_url(redirect_uri): Get the authorization URL using stored credentialscomplete_strava_auth(auth_code): Complete authentication with authorization codecheck_auth_status(): Check if authentication is configured and tokens are available
Basic Activity Queries
get_activities(limit): Get recent activitiesget_activities_by_range(start_date, end_date, limit): Get activities within a date rangeget_activity_by_id(activity_id): Get detailed information about a specific activityget_recent(days, limit): Get activities from the past X daysget_runs_by_range(start_date, end_date, limit): Get running activities within a date range
Detailed Activity Analysis
get_activity_streams(activity_id, keys): Get time-series data (heart rate, pace, power, cadence, GPS, etc.)get_activity_laps(activity_id): Get laps/splits for analyzing pace consistencyget_activity_zones(activity_id): Get heart rate and power zone data
Athlete Statistics
get_athlete_stats(athlete_id): Get athlete statistics including YTD totals, PRs, and achievements
Training Analysis
analyze_weekly(start_date, end_date): Analyze weekly training metricsanalyze_monthly(year, month): Analyze monthly training with weekly breakdownfind_long_runs(start_date, end_date, min_distance_km): Find long runs within a date rangeanalyze_pace_trends(start_date, end_date): Analyze pace trends over time
Heart Rate Zone & Injury Prevention
analyze_hr_zones(start_date, end_date): Analyze heart rate zone distribution (80/20 principle)analyze_training_load(start_date, end_date): Analyze training load and identify injury risk indicatorsanalyze_hr_trends(start_date, end_date, reference_pace_min_per_km): Track heart rate trends to monitor fitness improvementsanalyze_recovery(start_date, end_date): Analyze recovery patterns including rest days and training stress distribution
Note: Dates should be provided in ISO format (
YYYY-MM-DD).
Usage
Claude for Desktop
Update your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Running Locally
Example Queries
Authentication
"Check my Strava authentication status"
"Save my Strava credentials: client_id=12345, client_secret=abc123"
"Get the authorization URL for Strava OAuth"
"Complete Strava authentication with code XYZ789"
Basic Queries
"What are my recent activities?"
"Show me my activities from last week"
"What was my longest run in the past month?"
"Get details about my latest run"
Marathon Training Analysis
"Analyze my weekly training from last week"
"Show me my long runs from the past month"
"What's my pace trend over the last 3 months?"
"Analyze my training for January 2024"
Heart Rate Zone & Injury Prevention
"Analyze my heart rate zones for the past month"
"Check my training load and injury risk for the last 4 weeks"
"Show me my heart rate trends over the past 3 months"
"Analyze my recovery patterns - am I getting enough rest?"
Activity Data Format
The server returns activity data with consistent field names and units:
Field | Description | Unit |
| Activity ID | - |
| Activity name | - |
| Type of sport | - |
| Start date and time | ISO 8601 |
| Distance | meters |
| Total elapsed time | seconds |
| Moving time | seconds |
| Average speed | meters per second |
| Maximum speed | meters per second |
| Average cadence | revolutions per minute |
| Average heart rate | beats per minute |
| Maximum heart rate | beats per minute |
| Average power | watts |
| Weighted average power | watts |
| Energy output | kilojoules |
| Total elevation gain | meters |
| Highest elevation | meters |
| Lowest elevation | meters |
| Calories burned | kcal |
| Workout type (0=default, 1=race, 2=long run, 3=workout) | - |
| Perceived exertion score | - |
| Start coordinates | [lat, lng] |
| End coordinates | [lat, lng] |
Development
Project Structure
Running Tests
Authentication
The MCP server includes built-in authentication tools. See AUTHENTICATION.md for detailed instructions.
Quick Authentication
Get your Client ID and Client Secret from Strava API Settings
Use the MCP tool:
get_strava_auth_token(client_id, client_secret, auth_code)Restart the server
For step-by-step instructions, see STEP_BY_STEP_AUTH.md.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credits
This project is inspired by and builds upon the excellent work from tomekkorbak/strava-mcp-server. The original project provided the foundation and inspiration for this enhanced version, which adds comprehensive training analysis features, improved authentication flow, and marathon-specific tools.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.