Self-hosted · Read-only · Python
A Strava MCP server template you run yourself
A deployable Python Model Context Protocol (MCP) server that exposes your Strava athlete data as tools for any MCP client. Copy the code, bring your own Strava API credentials, host it yourself, and connect over stdio.
Important: this is a template. You supply your own Strava API credentials and host the server yourself. This site is not connected to Strava and does not provide credentials. You are responsible for complying with the Strava API Terms of Service.
What it is
Read-only access to your Strava data
This template is a complete, copyable Python MCP server. It speaks the MCP protocol over stdio, so any MCP client can call its tools to read your Strava athlete profile, recent activities, activity details, and stats. It never writes to Strava and never returns your secrets.
get_athlete_profile
Return the authenticated athlete's public profile (name, city, country).
list_recent_activities
List recent activities with pagination (page and per_page inputs).
get_activity_details
Return full details for a single activity by its numeric id.
get_athlete_stats
Return the athlete's aggregated stats (totals, counts, distance).
How it works
OAuth, tokens, and stdio
The server handles the full Strava OAuth flow: it builds an authorization URL, exchanges the code for access and refresh tokens, and transparently refreshes expired tokens. Tokens persist to a local JSON file by default, with a clear warning to use a secret store in production. The server runs over stdio, the standard MCP transport.
OAuth flow
Authorization URL, code exchange, and token refresh built in.
stdio transport
Speaks JSON-RPC over stdio. Works with Claude, Cursor, and more.
Secrets protected
Client secrets and access tokens are never returned by tools.
Quick start
Run it in five steps
Everything you need is in the Template tab. Here is the short version.
# 1. Create a Python virtual environment
python -m venv .venv
source .venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Copy the env template and fill in your Strava credentials
cp .env.example .env
# 4. Authorize your Strava account (opens browser, saves tokens)
python -m strava_mcp.auth
# 5. Run the MCP server over stdio
python -m strava_mcp