This MCP server allows you to connect Strava activity data to language models like Claude, enabling them to query and analyze your workout information through the Strava API. The server provides tools to fetch activities with standardized data formats so Claude can understand your exercise history.
Before using the Strava MCP server, you need to:
Create a Strava API application:
localhost
Get your refresh token using the included script:
python get_strava_token.py
.env
fileThe server requires the following environment variables:
STRAVA_CLIENT_ID
: Your Strava API Client IDSTRAVA_CLIENT_SECRET
: Your Strava API Client SecretSTRAVA_REFRESH_TOKEN
: Your Strava API Refresh TokenUpdate your Claude Desktop configuration file:
~/Library/Application\ Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"strava": {
"command": "uvx",
"args": [
"strava-mcp-server"
],
"env": {
"STRAVA_CLIENT_ID": "YOUR_CLIENT_ID",
"STRAVA_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"STRAVA_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
}
}
}
}
For Claude Web, run the server locally and connect it using the MCP extension.
The server provides the following query tools:
Get Recent Activities
get_activities(limit: int = 10)
Fetches the authenticated athlete's most recent activities
Get Activities by Date Range
get_activities_by_date_range(start_date: str, end_date: str, limit: int = 30)
Retrieves activities within a specific date range (dates in ISO format: YYYY-MM-DD
)
Get Activity by ID
get_activity_by_id(activity_id: int)
Obtains detailed information about a specific activity
Get Recent Activities by Days
get_recent_activities(days: int = 7, limit: int = 10)
Fetches activities from the past X days
The server returns activity data with consistent field names and units:
Field | Description | Unit |
---|---|---|
name |
Activity name | - |
sport_type |
Type of sport | - |
start_date |
Start date and time | ISO 8601 |
distance_metres |
Distance | meters |
elapsed_time_seconds |
Total elapsed time | seconds |
moving_time_seconds |
Moving time | seconds |
average_speed_mps |
Average speed | meters per second |
max_speed_mps |
Maximum speed | meters per second |
total_elevation_gain_metres |
Total elevation gain | meters |
elev_high_metres |
Highest elevation | meters |
elev_low_metres |
Lowest elevation | meters |
calories |
Calories burned | kcal |
start_latlng |
Start coordinates | [lat, lng] |
end_latlng |
End coordinates | [lat, lng] |
Once connected, you can ask Claude questions like:
The server provides human-readable error messages for common issues:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.