Strava MCP Server
Provides tools for interacting with the Strava API, enabling access to athlete profiles and statistics, activity history, and geographic segment data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Strava MCP Server summarize my recent activities and fitness stats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Strava MCP Server
A Model Context Protocol (MCP) server that integrates with the Strava API, allowing AI assistants to access your Strava fitness data.
Features
Fetch athlete profile and statistics
List and query activities
Access segment data and efforts
Explore segments by geographic area
View starred segments
Related MCP server: Strava MCP Server
Prerequisites
Node.js 18 or higher
A Strava account
Strava API credentials (Client ID and Client Secret)
Installation
Clone this repository:
git clone https://github.com/juanlarreapm/strava-mcp-server.git
cd strava-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildStrava API Setup
Before using this server, you need to create a Strava API application:
Create a new application
Set the Authorization Callback Domain to
localhostNote your Client ID and Client Secret
Getting OAuth Tokens
Run the authentication setup script to obtain your access tokens:
node setup-auth.cjsThis will:
Prompt you for your Client ID and Client Secret
Open a browser for Strava authorization
Display your access token, refresh token, and other credentials
Keep these credentials secure - you'll need them to configure the MCP server.
Configuration
The server requires the following environment variables:
STRAVA_ACCESS_TOKEN- Your Strava access token (required)STRAVA_REFRESH_TOKEN- Your refresh token (optional, for token renewal)STRAVA_CLIENT_ID- Your Strava application Client ID (optional)STRAVA_CLIENT_SECRET- Your Strava application Client Secret (optional)
For Claude Desktop
Add this to your Claude Desktop MCP settings file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"strava": {
"command": "node",
"args": ["/path/to/strava-mcp-server/dist/index.js"],
"env": {
"STRAVA_ACCESS_TOKEN": "your_access_token_here",
"STRAVA_REFRESH_TOKEN": "your_refresh_token_here",
"STRAVA_CLIENT_ID": "your_client_id_here",
"STRAVA_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}For Other MCP Clients
Create a .env file in the project root (see .env.example):
STRAVA_ACCESS_TOKEN=your_access_token_here
STRAVA_REFRESH_TOKEN=your_refresh_token_here
STRAVA_CLIENT_ID=your_client_id_here
STRAVA_CLIENT_SECRET=your_client_secret_hereAvailable Tools
The server exposes the following tools:
get_athlete_profile
Get the authenticated athlete's profile information.
get_athlete_stats
Get detailed statistics including totals and recent activity counts.
list_activities
List recent activities with optional pagination and time filtering.
Parameters:
before(number): Unix timestamp to get activities before this timeafter(number): Unix timestamp to get activities after this timepage(number): Page number (default: 1)per_page(number): Items per page (default: 30, max: 200)
get_activity
Get detailed information about a specific activity.
Parameters:
id(string, required): The activity IDinclude_all_efforts(boolean): Include all segment efforts
get_segment
Get information about a specific segment.
Parameters:
id(string, required): The segment ID
list_starred_segments
List segments starred by the athlete.
Parameters:
page(number): Page numberper_page(number): Items per page
explore_segments
Explore segments in a geographic area.
Parameters:
bounds(string, required): Coordinates assw_lat,sw_lng,ne_lat,ne_lngactivity_type(string): Eitherrunningorridingmin_cat(number): Minimum climb category (0-5)max_cat(number): Maximum climb category (0-5)
get_segment_efforts
Get efforts on a specific segment.
Parameters:
segment_id(string, required): The segment IDstart_date_local(string): ISO 8601 formatted start dateend_date_local(string): ISO 8601 formatted end dateper_page(number): Items per page
Development
Build
npm run buildWatch mode
npm run watchRun locally
npm startToken Expiration
Strava access tokens expire after 6 hours. To handle token refresh:
Store your refresh token securely
Implement token refresh logic using the Strava OAuth token endpoint
Or run
setup-auth.cjsagain to get fresh tokens
Rate Limits
Strava API has rate limits:
100 requests per 15 minutes
1000 requests per day
Plan your usage accordingly.
Troubleshooting
"STRAVA_ACCESS_TOKEN environment variable is required"
Make sure you've set the access token in your MCP configuration or environment variables.
"Strava API error: 401"
Your access token may have expired. Run setup-auth.cjs to get a new token.
"Authorization Callback Domain" error
Ensure you've set the callback domain to localhost in your Strava API settings.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Resources
Available Tools
8 toolsexplore_segmentsC
Explore segments in a given area. Returns the top 10 segments matching the search criteria.
Inputs: bounds (required), activity_type, min_cat, max_cat.
get_activityC
Get detailed information about a specific activity by ID
Inputs: id (required), include_all_efforts.
get_athlete_profileB
Get the authenticated athlete's profile information including name, stats, and preferences
Inputs: no named parameters.
get_athlete_statsB
Get detailed statistics for the authenticated athlete including totals and recent activity counts
Inputs: no named parameters.
get_segmentC
Get detailed information about a specific segment by ID
Inputs: id (required).
get_segment_effortsC
Get efforts on a specific segment
Inputs: segment_id (required), start_date_local, end_date_local, per_page.
list_activitiesB
List the authenticated athlete's activities. Returns up to 30 activities by default.
Inputs: before, after, page, per_page.
list_starred_segmentsB
List segments starred by the authenticated athlete
Inputs: page, per_page.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose targeting specific resources and actions in the Strava domain. For example, get_activity retrieves a single activity by ID, while list_activities lists multiple activities; explore_segments searches segments by area, while get_segment gets a specific segment by ID. There is no overlap or ambiguity in functionality.
All tool names follow a consistent verb_noun pattern with snake_case, such as get_activity, list_activities, explore_segments, and get_segment_efforts. This uniformity makes the tool set predictable and easy to understand for agents.
With 8 tools, the server is well-scoped for interacting with Strava's API, covering athlete profiles, activities, and segments without being overwhelming. Each tool serves a distinct and necessary function, such as retrieving data or listing resources, making the count appropriate for the domain.
The tool set provides strong coverage for reading athlete data, activities, and segments, including CRUD-like operations like get and list. However, there are minor gaps, such as no tools for creating or updating activities or segments, which might limit full lifecycle management but are not critical for common query-focused workflows.
Maintenance
Related MCP Connectors
Ask your AI about your fitness: activities and data from Garmin, COROS, Strava, GPX and more
Your own cycling data for your AI assistant: rides, power, climbs and routes. Read-only.
Your Garmin, Oura, WHOOP, Hevy and 35 more fitness apps, queryable from your own AI.
Strava MCP tools for AI: athletes, activities, segments, clubs, routes. Powered by HAPI MCP server.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Strava's API to access and manage activities, athlete data, routes, segments, clubs, and gear through natural language.22MIT
- FlicenseAqualityDmaintenanceEnables AI agents to interact with the Strava API to retrieve athlete statistics and activity data. It provides tools for listing recent activities and fetching detailed information for specific workout sessions.7-
- AlicenseBqualityDmaintenanceEnables users to interact with their Strava data through natural language to analyze workouts, track fitness progress, and explore routes. It supports retrieving detailed activity stats, heart rate data, and segment insights directly within AI assistants.26MIT
- AlicenseBqualityDmaintenanceConnects Claude to the Strava API to provide direct access to fitness data, including athlete statistics, detailed activity logs, and time-series performance metrics. It enables users to analyze training progress, compare workouts, and retrieve specific segment details through natural language queries.8MIT