# Strava Planning MCP

> Strava Planning gives your AI agent full control over your athletic training life cycle. Plan routes, export GPX/TCX files for any GPS device (Garmin, Wahoo), log non-tracked activities like gym sessions, and manage all gear mileage directly from your chat client. It handles everything—from viewing elevation profiles with `get_route_streams` to updating your weight via `update_athlete`. Stop juggling apps; start training.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** route-planning, gpx-export, activity-tracking, gear-management, fitness-data, segment-analysis

## Description

Look, you don't need to jump between half a dozen apps just to plan and log your run. Strava Planning gives your AI client total control over your whole athletic life cycle. You can handle everything—from plotting out the perfect training day to logging those late-night gym sessions where you weren't even on a bike.

### Planning & Exporting Your Routes
When you wanna map out a run, you start by seeing what's available. Running `list_routes` lets you see every saved route, showing the distance and elevation gain for each one. If you want deep details on a specific track, running `get_route` pulls up all that info, including the description.

Before you hit the road, you gotta check the terrain. You'll use `get_route_streams` to pull GPS coordinates and altitude profiles; this lets your agent analyze the whole climb before you even step out the door. Once you've picked a route, remember you can mark key parts of it as favorites (or un-favorite them) using `star_segment`. 

When it’s time for your physical GPS device—like a Garmin or Wahoo—you need the right file format. You just ask the agent to export it: run `export_route_gpx` for the standard GPX file, or use `export_route_tcx` if you know that specific training metadata will help another platform process it better.

### Logging Every Activity
Strava isn't just about GPS tracking. You can log workouts that happen somewhere else—like a deep stretch session at the gym, pool laps, or yoga class—by running `create_activity`. These manual records let you keep your training log accurate even when Strava didn’t track it.

If you got raw activity files (FIT, TCX, GPX) from somewhere else, don't sweat it. You send 'em over first using `upload_activity`, and the system gives you an ID to check on. Then, if you wanna know if Strava finished processing that file, just run `get_upload_status` with that ID. 

Got a record already in Strava that needs tweaking? You can use `update_activity` to change things after the fact—you can adjust the name, write a better description, assign specific gear to it, or flag it as an indoor workout.

### Managing Your Profile and Gear
Keeping your data clean is huge for accurate analysis. The agent handles your profile details with `get_athlete`, letting you view basic stats and what equipment's assigned to you. You can keep those numbers current by running `update_athlete` to change things like your weight in kilograms, which keeps all your performance ratios right.

For training specificity, the system pulls up your custom heart rate and power zones using `get_athlete_zones`. When it comes to gear—whether it's a bike or a pair of shoes—you check its current status and mileage with `get_gear` to plan maintenance cycles. It’s got you covered.

## Tools

### create_activity
Logs manual activities—like gym workouts, yoga, or cross-training—that did not happen during a tracked Strava session.

### export_route_gpx
Gets the URL to export a selected Strava route as a GPX file for use with GPS navigation devices like Garmin or Wahoo.

### export_route_tcx
Gets the URL to export a selected Strava route in TCX format, which includes extra training metadata useful for specific fitness platforms.

### get_athlete
Retrieves your basic profile details and current equipment assignments from Strava.

### get_athlete_zones
Gets your custom heart rate and power zones configured in Strava for specific training analysis.

### get_gear
Checks the current mileage, model details, and primary assignments for any piece of equipment (bike, shoes) you track on Strava.

### get_route
Fetches detailed information about a specific Strava route, including its distance, elevation, and description.

### get_route_streams
Retrieves GPS coordinates, altitude profiles, and distance data for a route to analyze the terrain before training.

### get_upload_status
Checks if Strava has finished processing an activity file you previously uploaded by providing a status message (ready or still processing).

### list_routes
Lists all saved routes associated with your account, showing distance, elevation gain, and type.

### star_segment
Marks a specific segment on a route as a favorite (or unfavorite) for quick access during training.

### update_activity
Edits an existing Strava activity, allowing you to change the name, description, assign gear, or mark it as indoor/commute.

### update_athlete
Updates your profile information on Strava, primarily supporting changes to weight (in kg) for accurate ratio calculations.

### upload_activity
Starts the process of sending a raw activity file (FIT, TCX, GPX) to Strava for processing and returns an ID for status checking.

## Prompt Examples

**Prompt:** 
```
List all my saved routes.
```

**Response:** 
```
Found 8 routes: 1) Morning Loop — 32.5 km, 450m elev, cycling. 2) Hill Repeats — 5.2 km, 280m elev, running. 3) Weekend Century — 160 km, 1,850m elev, cycling. 4) Recovery Run — 8 km, 50m elev, running. 5) Coastal Ride — 45 km, 320m elev, cycling.
```

**Prompt:** 
```
Export route 12345 to GPX format.
```

**Response:** 
```
Route 12345 (Morning Loop) exported to GPX. Download at: https://www.strava.com/api/v3/routes/12345/export_gpx. The file contains 32.5 km of GPS track with 450m elevation gain. Compatible with Garmin Edge, Wahoo ELEMNT, and other GPS cycling computers.
```

**Prompt:** 
```
Create a manual activity for today's gym session.
```

**Response:** 
```
Activity created: "Gym Session" — Type: Workout, Date: 2024-03-15 07:00, Duration: 45 min. Description: "Strength training - upper body focus". Activity ID: 9876543210. Now visible in your Strava feed.
```

## Capabilities

### Plan and Export Guided Routes
The agent retrieves route data, provides elevation profiles via `get_route_streams`, and exports the finished track as GPX or TCX files for your physical GPS device.

### Log Non-GPS Training Sessions
You can create manual activity records using `create_activity` even if you trained indoors, at a gym, or in the pool and didn't use Strava during the session.

### Manage Athlete Metrics
The agent lets you check and update critical profile data, like your current weight (`update_athlete`), which keeps performance ratios accurate for analysis.

### Track Gear Mileage
You can check the mileage and details of specific equipment (bikes, shoes) using `get_gear` to plan maintenance or rotation.

### Process Raw Activity Files
Upload raw FIT, TCX, or GPX files via `upload_activity`, then check the progress and completion status with `get_upload_status`.

## Use Cases

### The Race Week Prep
A coach wants to build a race simulation. They ask their agent to `list_routes` for all past long rides. The agent compiles the top three, then uses `get_route_streams` on each one so the coach can review the exact elevation gain and identify which profile is best for training.

### The Non-Cyclist Training Day
An athlete has a day off from cycling but does a 90-minute swim. They ask their agent to log it, so the agent uses `create_activity` with 'Swim' as the type and logs the session details, keeping all activities visible in one place.

### The Data Audit
A data analyst needs to verify performance metrics. They instruct their agent to first use `update_athlete` to ensure the most current weight is recorded, then call `get_athlete_zones` to pull the latest power/heart rate thresholds for comparison.

### The Race Day Export
An athlete has a race route stored in Strava. They ask their agent to export it as GPX. The agent uses `export_route_gpx` and provides the direct download link, ready for loading onto their Wahoo unit.

## Benefits

- Plan workouts precisely. Instead of just seeing a route name, use `get_route_streams` to preview the exact elevation profile and terrain difficulty before you even leave the house.
- Never lose an activity record. Use `create_activity` to log those crucial gym or cross-training sessions that don't happen on the bike. They count toward your stats.
- Keep records clean with `update_activity`. If you forget to assign your race shoes to a specific workout, use this tool to fix it later and keep your data accurate.
- Manage hardware performance easily. Check your gear status using `get_gear` so you know exactly when those cycling shoes are nearing the mileage limit for rotation.
- Streamline transfers. Get standardized GPX or TCX files using `export_route_gpx`/`export_route_tcx`. This works with every major GPS device, period.

## How It Works

The bottom line is: you give your AI client access to your Strava data, and it handles all the complex API calls needed to manage your training logs.

1. First, subscribe to the Strava Planning server and provide your Strava Access Token (OAuth2).
2. Second, tell your AI agent what you need—for example: 'Find all my routes over 50km' or 'Log a 60-minute swim'.
3. Third, the agent uses the appropriate tool (`list_routes`, `create_activity`, etc.) and executes the action using your connected Strava account.

## Frequently Asked Questions

**How do I export a route for my Garmin using Strava Planning?**
You use the `export_route_gpx` tool. You just need to provide the specific route ID, and the server returns the direct download URL for the GPX file. This is what you load onto your Garmin device.

**Can I log a pool workout with create_activity?**
Yes. Use `create_activity`. You specify 'Swim' as the type, enter the start date, and provide an estimate for elapsed time. This logs it accurately even though Strava didn't track it.

**What is the difference between get_route and list_routes?**
`list_routes` shows you a summary of all saved routes (name, distance, type). You use `get_route` when you need deep details about one specific route, like its full description or detailed segment breakdown.

**I uploaded my run file; how do I know if it processed?**
You check the status using `get_upload_status`. You call this tool periodically after running `upload_activity` until the status message confirms that your activity is ready.

**When should I use `update_athlete`? Does it require a specific format?**
You must run `update_athlete` whenever your weight changes. This keeps the data accurate for calculating power-to-weight ratios and other performance metrics.

**What file formats are supported when I call `upload_activity`? Is there a preference?**
We support FIT, TCX, GPX, and their compressed versions (.gz). Any of these files will initiate the upload process for processing by Strava.

**Can `get_route_streams` provide elevation data? How does it work?**
Yes, calling `get_route_streams` allows you to get GPS coordinates, altitude, and distance. This lets you review the exact terrain profile for a planned route.

**How do I use `get_gear` beyond just checking current mileage?**
You check the model, mileage, and assigned gear details returned here. Use this information to schedule maintenance or plan equipment rotation cycles.

**How do I export a route to my GPS device?**
First, use list_routes to find your route ID. Then use export_route_gpx or export_route_tcx with that route ID. The GPX file can be downloaded and loaded onto Garmin, Wahoo, or other GPS devices for turn-by-turn navigation during your workout.

**Can I log activities that Strava doesn't automatically track?**
Yes! Use create_activity to manually log any workout — gym sessions, yoga, swimming, hiking, cross-training. Provide the name, type (e.g., "Workout", "Yoga", "Swim"), start date, elapsed time, and optionally distance and description. This keeps all your training in one place.

**How do I track my bike and shoe mileage?**
Use get_gear with the gear ID to see total accumulated distance. Gear IDs are found in your athlete profile or assigned to activities. You can assign gear to activities using update_activity with the gear_id parameter. Track mileage to know when to replace chains, tires, or running shoes.