Strava MCP Server
Features
- Access recent activities, profile, and stats.
- Fetch detailed activity streams (power, heart rate, cadence, etc.).
- Explore, view, star, and manage segments.
- View detailed activity and segment effort information.
- List and view details of saved routes.
- Export routes in GPX or TCX format to the local filesystem.
- AI-friendly JSON responses via MCP.
- Uses Strava API V3.
Natural Language Interaction Examples
- "Show me my recent Strava activities."
- "What were my last 3 rides?"
- "Get my Strava profile information."
- "What's my Strava username?"
- "Get the heart rate data from my morning run yesterday."
- "Show me the power data from my last ride."
- "What was my cadence profile for my weekend century ride?"
- "Get all stream data for my Thursday evening workout."
- "Show me the elevation profile for my Mt. Diablo climb."
- "What are my running stats for this year on Strava?"
- "How far have I cycled in total?"
- "Show me my all-time swim totals."
- "Give me the details for my last run."
- "What was the average power for my interval training on Tuesday?"
- "Did I use my Trek bike for my commute yesterday?"
- "What Strava clubs am I in?"
- "List the clubs I've joined."
- "List the segments I starred near Boulder, Colorado."
- "Show my favorite segments."
- "Get details for the 'Alpe du Zwift' segment."
- "Are there any good running segments near Golden Gate Park?"
- "Find challenging climbs near Boulders Flagstaff Mountain."
- "Star the 'Flagstaff Road Climb' segment for me."
- "Unstar the 'Lefthand Canyon' segment."
- "Show my efforts on the 'Sunshine Canyon' segment this month."
- "List my attempts on Box Hill between January and June this year."
- "Get the details for my personal record on Alpe d'Huez."
- "List my saved Strava routes."
- "Show the second page of my routes."
- "What is the elevation gain for my Boulder Loop route?"
- "Get the description for my 'Boulder Loop' route."
- "Export my 'Boulder Loop' route as a GPX file."
- "Save my Sunday morning route as a TCX file."
Advanced Prompt Example
Important Setup Sequence
- Install the server and its dependencies
- Configure the server in Claude's configuration
- Complete the Strava authentication flow
- Restart Claude to ensure proper environment variable loading
Installation & Setup
- Prerequisites:
1. From Source
- Clone Repository:
- Install Dependencies:
- Build the Project:
2. Configure Claude Desktop
/absolute/path/to/your/strava-mcp/
with the actual path to your installation.3. Strava Authentication Setup
setup-auth.ts
script makes it easy to set up authentication with the Strava API. Follow these steps carefully:Create a Strava API Application
- Create a new application:
Run the Setup Script
4. Restart Claude
- The new configuration is loaded
- The environment variables are properly read
- The Strava MCP server is properly initialized
Environment Variables
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
Token Handling
.env
to obtain a new access token and refresh token. These new tokens are then updated in both the running process and the .env
file, ensuring continuous operation.scripts/setup-auth.ts
script once for the initial setup.Configure Export Path (Optional)
export-route-gpx
or export-route-tcx
tools, you need to specify a directory for saving exported files..env
file and add/update the ROUTE_EXPORT_PATH
variable:API Reference
`get-recent-activities`
- When to use: When the user asks about their recent workouts, activities, runs, rides, etc.
- Parameters:
- Output: Formatted text list of recent activities (Name, ID, Distance, Date).
- Errors: Missing/invalid token, Strava API errors.
`get-athlete-profile`
- When to use: When the user asks for their profile details, username, location, weight, premium status, etc.
- Parameters: None
- Output: Formatted text string with profile details.
- Errors: Missing/invalid token, Strava API errors.
`get-athlete-stats`
- When to use: When the user asks for their overall statistics, totals for runs/rides/swims, personal records (longest ride, biggest climb).
- Parameters: None
- Output: Formatted text summary of stats, respecting user's measurement preference.
- Errors: Missing/invalid token, Strava API errors.
`get-activity-details`
- When to use: When the user asks for details about a specific activity identified by its ID.
- Parameters:
- Output: Formatted text string with detailed activity information (type, date, distance, time, speed, HR, power, gear, etc.), respecting user's measurement preference.
- Errors: Missing/invalid token, Invalid
activityId
, Strava API errors.
`list-athlete-clubs`
- When to use: When the user asks about the clubs they have joined.
- Parameters: None
- Output: Formatted text list of clubs (Name, ID, Sport, Members, Location).
- Errors: Missing/invalid token, Strava API errors.
`list-starred-segments`
- When to use: When the user asks about their starred or favorite segments.
- Parameters: None
- Output: Formatted text list of starred segments (Name, ID, Type, Distance, Grade, Location).
- Errors: Missing/invalid token, Strava API errors.
`get-segment`
- When to use: When the user asks for details about a specific segment identified by its ID.
- Parameters:
- Output: Formatted text string with detailed segment information (distance, grade, elevation, location, stars, efforts, etc.), respecting user's measurement preference.
- Errors: Missing/invalid token, Invalid
segmentId
, Strava API errors.
`explore-segments`
- When to use: When the user wants to find or discover segments in a specific geographic area, optionally filtering by activity type or climb category.
- Parameters:
- Output: Formatted text list of found segments (Name, ID, Climb Cat, Distance, Grade, Elevation).
- Errors: Missing/invalid token, Invalid
bounds
format, Invalid filter combination, Strava API errors.
`star-segment`
- When to use: When the user explicitly asks to star, favorite, unstar, or unfavorite a specific segment identified by its ID.
- Parameters:
- Output: Success message confirming the action and the segment's new starred status.
- Errors: Missing/invalid token, Invalid
segmentId
, Strava API errors (e.g., segment not found, rate limit).
`get-segment-effort`
- When to use: When the user asks for details about a specific segment effort identified by its ID.
- Parameters:
- Output: Formatted text string with detailed effort information (segment name, activity ID, time, distance, HR, power, rank, etc.).
- Errors: Missing/invalid token, Invalid
effortId
, Strava API errors.
`list-segment-efforts`
- When to use: When the user asks to list their efforts or attempts on a specific segment, possibly within a date range.
- Parameters:
- Output: Formatted text list of matching segment efforts.
- Errors: Missing/invalid token, Invalid
segmentId
, Invalid date format, Strava API errors.
`list-athlete-routes`
- When to use: When the user asks to see the routes they have created or saved.
- Parameters:
- Output: Formatted text list of routes (Name, ID, Type, Distance, Elevation, Date).
- Errors: Missing/invalid token, Strava API errors.
`get-route`
- When to use: When the user asks for details about a specific route identified by its ID.
- Parameters:
- Output: Formatted text string with route details (Name, ID, Type, Distance, Elevation, Est. Time, Description, Segment Count).
- Errors: Missing/invalid token, Invalid
routeId
, Strava API errors.
`export-route-gpx`
- When to use: When the user explicitly asks to export or save a specific route as a GPX file.
- Prerequisite: The
ROUTE_EXPORT_PATH
environment variable must be correctly configured on the server.
- Parameters:
- Output: Success message indicating the save location, or an error message.
- Errors: Missing/invalid token, Missing/invalid
ROUTE_EXPORT_PATH
, File system errors (permissions, disk space), InvalidrouteId
, Strava API errors.
`export-route-tcx`
- When to use: When the user explicitly asks to export or save a specific route as a TCX file.
- Prerequisite: The
ROUTE_EXPORT_PATH
environment variable must be correctly configured on the server.
- Parameters:
- Output: Success message indicating the save location, or an error message.
- Errors: Missing/invalid token, Missing/invalid
ROUTE_EXPORT_PATH
, File system errors (permissions, disk space), InvalidrouteId
, Strava API errors.
`get-activity-streams`
- When to use: When you need detailed time-series data from an activity for:
- Parameters:
- Output Format:
- Example Request:
- Special Features:
- Notes:
- Errors:
`get-activity-laps`
- When to use:
- Parameters:
- Output Format: A text summary detailing each lap, including:
- Example Request:
- Example Response Snippet:
- Notes:
- Errors:
`get-athlete-zones`
- When to use: When the user asks about their heart rate zones, power zones, or training zone settings.
- Parameters: None
- Output Format: Returns two text blocks:
- Example Response Snippet (Summary):
- Notes:
- Errors:
Contributing
License
Strava MCP Server
Features
- Access recent activities, profile, and stats.
- Fetch detailed activity streams (power, heart rate, cadence, etc.).
- Explore, view, star, and manage segments.
- View detailed activity and segment effort information.
- List and view details of saved routes.
- Export routes in GPX or TCX format to the local filesystem.
- AI-friendly JSON responses via MCP.
- Uses Strava API V3.
Natural Language Interaction Examples
- "Show me my recent Strava activities."
- "What were my last 3 rides?"
- "Get my Strava profile information."
- "What's my Strava username?"
- "Get the heart rate data from my morning run yesterday."
- "Show me the power data from my last ride."
- "What was my cadence profile for my weekend century ride?"
- "Get all stream data for my Thursday evening workout."
- "Show me the elevation profile for my Mt. Diablo climb."
- "What are my running stats for this year on Strava?"
- "How far have I cycled in total?"
- "Show me my all-time swim totals."
- "Give me the details for my last run."
- "What was the average power for my interval training on Tuesday?"
- "Did I use my Trek bike for my commute yesterday?"
- "What Strava clubs am I in?"
- "List the clubs I've joined."
- "List the segments I starred near Boulder, Colorado."
- "Show my favorite segments."
- "Get details for the 'Alpe du Zwift' segment."
- "Are there any good running segments near Golden Gate Park?"
- "Find challenging climbs near Boulders Flagstaff Mountain."
- "Star the 'Flagstaff Road Climb' segment for me."
- "Unstar the 'Lefthand Canyon' segment."
- "Show my efforts on the 'Sunshine Canyon' segment this month."
- "List my attempts on Box Hill between January and June this year."
- "Get the details for my personal record on Alpe d'Huez."
- "List my saved Strava routes."
- "Show the second page of my routes."
- "What is the elevation gain for my Boulder Loop route?"
- "Get the description for my 'Boulder Loop' route."
- "Export my 'Boulder Loop' route as a GPX file."
- "Save my Sunday morning route as a TCX file."
Advanced Prompt Example
Important Setup Sequence
- Install the server and its dependencies
- Configure the server in Claude's configuration
- Complete the Strava authentication flow
- Restart Claude to ensure proper environment variable loading
Installation & Setup
- Prerequisites:
1. From Source
- Clone Repository:
- Install Dependencies:
- Build the Project:
2. Configure Claude Desktop
/absolute/path/to/your/strava-mcp/
with the actual path to your installation.3. Strava Authentication Setup
setup-auth.ts
script makes it easy to set up authentication with the Strava API. Follow these steps carefully:Create a Strava API Application
- Create a new application:
Run the Setup Script
4. Restart Claude
- The new configuration is loaded
- The environment variables are properly read
- The Strava MCP server is properly initialized
Environment Variables
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
[object Object] | [object Object] |
Token Handling
.env
to obtain a new access token and refresh token. These new tokens are then updated in both the running process and the .env
file, ensuring continuous operation.scripts/setup-auth.ts
script once for the initial setup.Configure Export Path (Optional)
export-route-gpx
or export-route-tcx
tools, you need to specify a directory for saving exported files..env
file and add/update the ROUTE_EXPORT_PATH
variable:API Reference
`get-recent-activities`
- When to use: When the user asks about their recent workouts, activities, runs, rides, etc.
- Parameters:
- Output: Formatted text list of recent activities (Name, ID, Distance, Date).
- Errors: Missing/invalid token, Strava API errors.
`get-athlete-profile`
- When to use: When the user asks for their profile details, username, location, weight, premium status, etc.
- Parameters: None
- Output: Formatted text string with profile details.
- Errors: Missing/invalid token, Strava API errors.
`get-athlete-stats`
- When to use: When the user asks for their overall statistics, totals for runs/rides/swims, personal records (longest ride, biggest climb).
- Parameters: None
- Output: Formatted text summary of stats, respecting user's measurement preference.
- Errors: Missing/invalid token, Strava API errors.
`get-activity-details`
- When to use: When the user asks for details about a specific activity identified by its ID.
- Parameters:
- Output: Formatted text string with detailed activity information (type, date, distance, time, speed, HR, power, gear, etc.), respecting user's measurement preference.
- Errors: Missing/invalid token, Invalid
activityId
, Strava API errors.
`list-athlete-clubs`
- When to use: When the user asks about the clubs they have joined.
- Parameters: None
- Output: Formatted text list of clubs (Name, ID, Sport, Members, Location).
- Errors: Missing/invalid token, Strava API errors.
`list-starred-segments`
- When to use: When the user asks about their starred or favorite segments.
- Parameters: None
- Output: Formatted text list of starred segments (Name, ID, Type, Distance, Grade, Location).
- Errors: Missing/invalid token, Strava API errors.
`get-segment`
- When to use: When the user asks for details about a specific segment identified by its ID.
- Parameters:
- Output: Formatted text string with detailed segment information (distance, grade, elevation, location, stars, efforts, etc.), respecting user's measurement preference.
- Errors: Missing/invalid token, Invalid
segmentId
, Strava API errors.
`explore-segments`
- When to use: When the user wants to find or discover segments in a specific geographic area, optionally filtering by activity type or climb category.
- Parameters:
- Output: Formatted text list of found segments (Name, ID, Climb Cat, Distance, Grade, Elevation).
- Errors: Missing/invalid token, Invalid
bounds
format, Invalid filter combination, Strava API errors.
`star-segment`
- When to use: When the user explicitly asks to star, favorite, unstar, or unfavorite a specific segment identified by its ID.
- Parameters:
- Output: Success message confirming the action and the segment's new starred status.
- Errors: Missing/invalid token, Invalid
segmentId
, Strava API errors (e.g., segment not found, rate limit).
`get-segment-effort`
- When to use: When the user asks for details about a specific segment effort identified by its ID.
- Parameters:
- Output: Formatted text string with detailed effort information (segment name, activity ID, time, distance, HR, power, rank, etc.).
- Errors: Missing/invalid token, Invalid
effortId
, Strava API errors.
`list-segment-efforts`
- When to use: When the user asks to list their efforts or attempts on a specific segment, possibly within a date range.
- Parameters:
- Output: Formatted text list of matching segment efforts.
- Errors: Missing/invalid token, Invalid
segmentId
, Invalid date format, Strava API errors.
`list-athlete-routes`
- When to use: When the user asks to see the routes they have created or saved.
- Parameters:
- Output: Formatted text list of routes (Name, ID, Type, Distance, Elevation, Date).
- Errors: Missing/invalid token, Strava API errors.
`get-route`
- When to use: When the user asks for details about a specific route identified by its ID.
- Parameters:
- Output: Formatted text string with route details (Name, ID, Type, Distance, Elevation, Est. Time, Description, Segment Count).
- Errors: Missing/invalid token, Invalid
routeId
, Strava API errors.
`export-route-gpx`
- When to use: When the user explicitly asks to export or save a specific route as a GPX file.
- Prerequisite: The
ROUTE_EXPORT_PATH
environment variable must be correctly configured on the server.
- Parameters:
- Output: Success message indicating the save location, or an error message.
- Errors: Missing/invalid token, Missing/invalid
ROUTE_EXPORT_PATH
, File system errors (permissions, disk space), InvalidrouteId
, Strava API errors.
`export-route-tcx`
- When to use: When the user explicitly asks to export or save a specific route as a TCX file.
- Prerequisite: The
ROUTE_EXPORT_PATH
environment variable must be correctly configured on the server.
- Parameters:
- Output: Success message indicating the save location, or an error message.
- Errors: Missing/invalid token, Missing/invalid
ROUTE_EXPORT_PATH
, File system errors (permissions, disk space), InvalidrouteId
, Strava API errors.
`get-activity-streams`
- When to use: When you need detailed time-series data from an activity for:
- Parameters:
- Output Format:
- Example Request:
- Special Features:
- Notes:
- Errors:
`get-activity-laps`
- When to use:
- Parameters:
- Output Format: A text summary detailing each lap, including:
- Example Request:
- Example Response Snippet:
- Notes:
- Errors:
`get-athlete-zones`
- When to use: When the user asks about their heart rate zones, power zones, or training zone settings.
- Parameters: None
- Output Format: Returns two text blocks:
- Example Response Snippet (Summary):
- Notes:
- Errors: