# Strava Training MCP

> Strava Training connects your AI agent to deep Strava data. It lets you analyze everything—from raw GPS streams and heart rate zones to segment PRs and lifetime athlete stats. You can run complex queries comparing specific laps, analyzing power metrics against elevation profiles, or checking overall training load without jumping through multiple dashboards.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** performance-metrics, heart-rate-zones, gps-tracking, athlete-statistics, data-visualization

## Description

Strava Training connects your AI agent to deep performance data from Strava. You can analyze everything—from raw GPS streams and heart rate zones to segment PRs and lifetime athlete stats. This server exposes tools that let you run complex queries comparing specific laps, analyzing power metrics against elevation profiles, or checking overall training load without jumping through multiple dashboards.

**Analyzing Your Workout Details**
You've got a workout ID? Use `get_activity` to pull the core details—it gives you distance, time, and elevation for that specific run or ride. If you need to check pace consistency, `get_activity_laps` extracts split data from any activity, showing you the pace, distance, and speed for every lap. To grade your effort against training goals, `get_activity_zones` checks the workout metrics against your defined heart rate or power zones. You can pull high-granularity time-series data—like raw GPS coordinates, heart rate output, or power levels over time—using `get_activity_streams`. If you wanna know what gear you used for a specific activity, `get_gear` provides details on the shoes or bikes tracked in your Strava history.

**Mastering Segment Performance**
To measure yourself against the competition, use these segment tools. First, run `list_segment_efforts` to see every recorded attempt you've made for a given segment; you can filter this list by date or specific segment ID to track progress over time. For any single record, `get_segment_effort` pulls the key metrics—time, power, and heart rate—for that one specific attempt (like a KOM or QOM). Wanna see how difficult a segment is before you try it? `get_segment_streams` gives you the elevation and grade profile of the segment itself. For an even deeper dive on a recorded effort, `get_segment_effort_streams` pulls raw time-series data specific to that segment attempt. Finally, if you just need general info about a segment—its total distance, overall elevation gain, or average grade—you use `get_segment`.

**Tracking Your Totals and Zones**
For a big picture view of your athletic career, `get_athlete_stats` retrieves consolidated totals for all runs or rides you've completed since using Strava. If you need to know what zones you're aiming for, `get_athlete_zones` fetches your personal custom heart rate and power zone settings. You can also pull raw time-series data from a segment effort specifically with `get_segment_effort_streams`.

## Tools

### get_activity
Retrieves key details like distance, time, and elevation for any specific workout ID.

### get_activity_laps
Gets split data (pace, distance, speed) from an activity's laps to check pace consistency.

### get_activity_streams
Pulls raw time-series data (HR, power, GPS) for a workout, enabling detailed visualization and export.

### get_activity_zones
Checks an activity against your defined heart rate or power training zones to grade the effort's intensity.

### get_athlete_stats
Retrieves overall run and ride totals (all-time and recent) for a performance overview.

### get_athlete_zones
Fetches your personal custom heart rate and power zone settings for reference.

### get_gear
Provides details on specific equipment (shoes, bikes) used in Strava activities to track mileage.

### get_segment
Retrieves profile data for a segment, including distance, total elevation gain, and average grade.

### get_segment_effort
Gets the metrics (time, power, HR) for one specific recorded attempt on a segment (a KOM/QOM).

### get_segment_effort_streams
Pulls raw time-series data specifically for an effort on a segment, useful for fine analysis.

### get_segment_streams
Shows the elevation and grade profile of a segment before you attempt it.

### list_segment_efforts
Lists all recorded attempts for an athlete, optionally filtered by date or segment ID, to track progress.

## Prompt Examples

**Prompt:** 
```
Show my athlete statistics.
```

**Response:** 
```
Recent stats: 12 runs totaling 85.2 km (avg 7:05/km), 8 rides totaling 320 km with 4,200m elevation. All-time: 542 runs (5,890 km), 234 rides (12,450 km, 125,000m elevation). Biggest climb: 1,850m in a single ride.
```

**Prompt:** 
```
Get activity streams for activity 12345678 with heart rate, power, and speed.
```

**Response:** 
```
Found 2,340 data points. Heart rate: avg 152 bpm (range 98-185). Power: avg 245W (range 0-480W). Speed: avg 28.5 km/h (max 62 km/h). Activity duration: ~39 minutes. Peaks in power correspond to hill climbs.
```

**Prompt:** 
```
Show my segment efforts on segment 22978.
```

**Response:** 
```
Found 8 efforts on segment 22978 (Old La Honda Road). Best effort: 14:32 (PR) on 2024-02-15. Recent efforts trending: 15:02, 14:48, 14:32 — showing 2-minute improvement over 3 months. Average HR: 168 bpm on best effort.
```

## Capabilities

### Get Full Activity Metrics
Retrieve the core details (distance, time, elevation) for a specific workout using its ID.

### Analyze Lap Splits
Extract split data from any activity to check pace changes and sectional performance.

### Fetch Raw Time-Series Data
Get high-granularity metrics (HR, power, speed) over time for a workout or segment.

### Determine Training Zones
Check if an activity hit the right heart rate or power zone targets for your training goal.

### Compare Segment Attempts
List and compare multiple efforts (PRs, KOM) on a specific segment over time.

### Check Athlete Totals
Pull consolidated stats for all runs or rides since you started using Strava.

## Use Cases

### Diagnosing Poor Pacing Consistency
A runner notices they feel sluggish on the last mile of a long run. They ask their agent to run `get_activity_laps` for that specific activity. The agent compares the pace splits and immediately flags that the average speed dropped 15% after the 35km mark, pointing to pacing failure rather than muscle fatigue.

### Comparing PR Attempts on a Climb
A cyclist wants to prove their improvement on 'Old La Honda Road'. They use `list_segment_efforts` for that segment. The agent compiles all efforts over the last six months, highlighting the fastest time (PR) and showing the average power output trend across those attempts.

### Calculating Training Load from Raw Data
A coach needs to assess a client's overall effort, not just total distance. They instruct their agent to run `get_activity_streams` for the last week, requesting 'power' and 'heartrate'. The resulting data points allow the AI to calculate average power-weighted intensity across all activities.

### Optimizing Training Equipment
A cyclist is worried about bike maintenance. They use `get_gear` with their most recent activity ID. The agent reports not only the mileage on the chain but also notes that the specific gear assigned (e.g., 'SRAM Apex') has logged 1,500km since its last service.

## Benefits

- **Granular Analysis:** Stop looking at averages. Using `get_activity_streams` gives you raw, time-stamped data for HR, power, or GPS, letting your agent pinpoint exactly where metrics peaked or dropped.
- **Contextualizing Effort:** The `get_activity_zones` tool doesn't just give a score; it tells you if the workout actually targeted the high-intensity zones you needed to train in. It provides immediate training feedback.
- **Tracking Progress Over Time:** Instead of guessing your best time, use `list_segment_efforts`. You can easily compare every PR attempt on one segment against others, seeing trends month over month.
- **Pre-Race Scouting:** Before tackling a new route, run `get_segment_streams` to visualize the elevation profile and grade changes. Your agent shows you where the steepest climbs are coming up.
- **Deep Dive Into Gear Use:** Want to know if your new shoes help? The `get_gear` tool tracks equipment mileage per activity, letting you link performance metrics directly to specific hardware.

## How It Works

The bottom line is that your AI client handles all the messy API calls; you just ask for the final analysis.

1. You subscribe to the server and give it your Strava Access Token.
2. Your AI client sends a specific request, like 'Get raw streams for my last ride with heart rate and power data.'
3. The agent runs the `get_activity_streams` tool, returns an array of time-stamped values, and you get immediate performance context.

## Frequently Asked Questions

**How do I get raw power and heart rate data using the Strava Training MCP Server?**
Use `get_activity_streams` and pass 'heartrate,watts' as comma-separated types. This pulls every single time-stamped reading for both metrics from the activity.

**Is there a way to compare my PR attempts on a segment?**
Yes, use `list_segment_efforts`. You can filter by specific segments and date ranges to pull all relevant efforts across your history for comparison.

**What if I want to check the elevation of an entire route?**
Run `get_segment_streams` using 'altitude' and 'grade_smooth'. This provides the necessary time-series data to build a comprehensive profile map for your agent.

**Does Strava Training MCP Server only work on completed workouts?**
The server works on recorded activities. You must pass an activity ID into tools like `get_activity` or `get_activity_laps` to analyze a specific, finished workout.

**How do I ensure the necessary permissions when calling get_activity_zones?**
The server requires specific scopes for zone data. You must use an OAuth2 token that grants access to heart rate or power metrics, which may require a paid subscription feature on Strava's side. Without these elevated credentials, the tool will fail.

**When using get_segment_streams, what comma-separated parameters can I request?**
You must specify the type of data you want to profile. Accepted values include "distance", "altitude", and "grade_smooth". Listing these types allows your agent to build a full difficulty profile of the segment.

**Does get_athlete_stats allow me to pull statistics for a custom date range?**
No, this tool only provides predefined aggregates: 'recent' and 'all-time' totals. If you need performance data restricted to specific dates, analyze individual activities using the get_activity endpoint instead.

**What input do I need for the get_gear function?**
You must provide a unique Gear ID. You won't guess this; you find the gear ID first by referencing activity data or checking your athlete's profile details within Strava.

**What data streams are available for activities?**
Available streams include: time, distance, latlng (GPS coordinates), altitude, velocity_smooth (speed), heartrate, cadence, watts (power), temp (temperature), moving (moving flag), and grade_smooth (incline %). Request specific streams with comma-separated types, e.g., "heartrate,watts,velocity_smooth". Not all streams are available for every activity — it depends on the recording device.

**What are activity zones and how are they calculated?**
Activity zones show the time spent in each heart rate zone (Z1-Z5) or power zone during an activity. Zones are based on the athlete's personal zone configuration (set in Strava settings). Zone analysis reveals training intensity — whether a workout was aerobic (Z1-Z2), threshold (Z3), or anaerobic (Z4-Z5). This data requires a heart rate monitor or power meter.

**How do I find my athlete ID on Strava?**
Your athlete ID is the numeric portion of your Strava profile URL. For example, from https://www.strava.com/athletes/12345678, your athlete ID is 12345678. You can also get it from the get_athlete tool in the Strava Planning or Strava Social MCP servers.