home / mcp / strava mcp server
This connects Claude with Strava
Configuration
View docs{
"mcpServers": {
"atikant-sql-mcp-strava": {
"command": "python",
"args": [
"server.py"
],
"env": {
"STRAVA_SCOPES": "read,activity:read",
"STRAVA_CLIENT_ID": "YOUR_STRAVA_CLIENT_ID",
"STRAVA_TOKEN_PATH": "path/to/STRAVA_TOKEN_PATH.json",
"STRAVA_REDIRECT_URI": "http://localhost:8723/callback",
"STRAVA_CLIENT_SECRET": "YOUR_STRAVA_CLIENT_SECRET"
}
}
}
}You can run a small Python MCP server that lets Claude Desktop access your Strava activities. It handles local OAuth, refreshes tokens automatically, and saves tokens to a local JSON file for your sessions. You can then ask it to show your recent runs, distances, or pace summaries directly from Claude.
You start the MCP server locally and then interact with it from Claude Desktop. First you authenticate with Strava once using oauth_login. The server stores access and refresh tokens locally and automatically refreshes them when needed. After authentication, you can request actions like listing your recent activities or fetching details for a specific activity.
Common usage patterns include: listing your last n runs, retrieving a single activity by its id, and letting the server refresh tokens in the background so you don’t have to. If the access token is about to expire, the server retrieves a new token using the refresh_token flow, and your session continues without manual re-authentication.
Prerequisites you need to have installed on your Windows machine:
Set up a Python virtual environment and install dependencies:
cd C:\Users\AtikantJain\mcp-strava
python -m venv .venv
. .\.venv\Scripts\Activate.ps1
pip install -r requirements.txtThe server requires Strava app credentials and a local callback. You store these as environment variables that the MCP server reads when starting. You also specify a local path where tokens are saved.
Environment variables you need to configure for Strava OAuth:
Initiates the OAuth flow with Strava and stores tokens locally for subsequent API calls.
Retrieves a list of recent Strava activities with details like distance and pace.
Fetches details for a specific Strava activity by its id.