Skip to main content

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

  1. Go to https://www.strava.com/settings/api
  2. Create an application (use http://localhost:8888/callback as the redirect URI)
  3. 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

strava_mcp_agent-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strava_mcp_agent-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file strava_mcp_agent-0.1.1.tar.gz.

File metadata

  • Download URL: strava_mcp_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for strava_mcp_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1d11d396a89e4ffb1e57e5cd077326ee59cdeee104bb02e1bc66c29cd635ef96
MD5 8b465e58bf7cce76ed009232f29fa79a
BLAKE2b-256 4d0c6518d6094cdf99202b51311a213f2a56ad414b5d1d86edf8144c814f1cc8

See more details on using hashes here.

File details

Details for the file strava_mcp_agent-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for strava_mcp_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55106674f959c876fbdab1936551b2cba8dcc33c54915d95423268a8803ef8f4
MD5 eb055288459ee17a5225fa11dd29b880
BLAKE2b-256 da246e9a3269252a84410b7124525d2b09fdf04365d1c78576ab07e1877b4467

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page