MCP server that exposes your Strava athletic data as tools for Claude and other LLMs
Project description
strava-mcp
Give Claude access to your Strava data. An MCP server that exposes your runs, rides, swims, and all Strava metrics as tools for AI-powered coaching, analysis, and conversation.
What it does
strava-mcp connects your Strava account to any MCP-compatible client (Claude Desktop, Claude Code, etc.) and provides 13 tools covering every aspect of your athletic data:
| Tool | Description |
|---|---|
get_athlete |
Your profile — name, weight, FTP, bio |
get_athlete_stats |
All-time & recent totals for run/bike/swim |
list_activities |
Browse activities with date/type filtering |
get_activity |
Full detail for one activity (splits, HR, cadence, weather) |
get_activity_zones |
Heart-rate and power zone distribution |
get_activity_laps |
Per-lap pace, HR, and distance breakdown |
get_activity_streams |
Raw sensor data (GPS, HR, cadence, watts, altitude) |
get_starred_segments |
Your starred segments |
get_segment_efforts |
Efforts on a specific segment |
get_routes |
Routes you've created |
get_gear |
Shoe/bike details and mileage |
get_clubs |
Clubs you belong to |
get_running_summary |
AI-ready coaching summary (weekly mileage, pace trends, best efforts, HR stats) |
Installation
pip install strava-mcp
Or install from source:
git clone https://github.com/koushikmaji/strava-mcp.git
cd strava-mcp
pip install -e .
Setup
1. Create a Strava API Application
- Go to https://www.strava.com/settings/api
- Create an application (use
http://localhost:8888/callbackas the redirect URI) - Note your Client ID and Client Secret
2. Get Your Refresh Token
python get_token.py
This opens a browser for Strava authorization and returns your refresh token.
3. Set Environment Variables
export STRAVA_CLIENT_ID="your_client_id"
export STRAVA_CLIENT_SECRET="your_client_secret"
export STRAVA_REFRESH_TOKEN="your_refresh_token"
4. Configure Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"strava": {
"command": "strava-mcp",
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"STRAVA_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
Or run with Python directly:
{
"mcpServers": {
"strava": {
"command": "python",
"args": ["-m", "strava_mcp"],
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"STRAVA_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
Usage Examples
Once connected, just talk to Claude:
- "How was my running this month?"
- "Compare my last 5 runs — am I getting faster?"
- "What's my average heart rate on long runs vs tempo runs?"
- "Show me my weekly mileage trend for the past 2 months"
- "What gear has the most miles on it?"
The get_running_summary tool is especially powerful for coaching — it computes weekly mileage, pace trends, best 5K/10K efforts, and heart rate stats, all in one call.
Security
Credentials are loaded from environment variables only — never hardcoded. The server uses Strava's OAuth2 refresh token flow and automatically handles token renewal.
Requirements
- Python 3.10+
- A Strava account with API access
- MCP-compatible client (Claude Desktop, Claude Code, etc.)
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file strava_mcp_agent-0.1.0.tar.gz.
File metadata
- Download URL: strava_mcp_agent-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca2eaa4af1833cfe60e089637fcbf12dddb90543991c26b6bf8934bb005a35b
|
|
| MD5 |
6d853576a18562ce701e3006a3d55604
|
|
| BLAKE2b-256 |
9f10b8912fb4173d65d3c3d13600a35f71228c42a8525d2f21bab1dc3704057f
|