Back to MCP Catalog

Strava API MCP Server

SportsPython
Access and analyze your Strava activity data
Available Tools

get_activities

Get the authenticated athlete's recent activities

limit

get_activities_by_date_range

Get activities within a specific date range (dates in ISO format YYYY-MM-DD)

start_dateend_datelimit

get_activity_by_id

Get detailed information about a specific activity

activity_id

get_recent_activities

Get activities from the past X days

dayslimit

The Strava API MCP server provides language models with direct access to your Strava fitness data. It allows Claude to retrieve, analyze, and discuss your running, cycling, and other athletic activities tracked through Strava. With this integration, you can get insights about your recent workouts, compare activities across date ranges, and examine detailed metrics for specific activities.

Installation

Prerequisites

Before using the Strava API MCP server, you'll need:

  1. A Strava account with activities
  2. Python 3.12 or later installed on your system
  3. Strava API credentials (Client ID, Client Secret, and Refresh Token)

Setting Up Strava API Access

  1. Create a Strava API application:

    • Go to Strava API Settings
    • Create an application to get your Client ID and Client Secret
    • Set the Authorization Callback Domain to localhost
  2. Get your refresh token using the included script:

    python get_strava_token.py
    
    • Follow the prompts to authorize your application
    • The script will save your tokens to a .env file

Installation Options

Using pip

pip install strava-mcp-server

Using uv (recommended)

uv install strava-mcp-server

Configuration

For Claude Desktop

Update your claude_desktop_config.json file to include the Strava MCP server:

  • On macOS: Located at ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: Located at %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

  1. Run the server locally:
    STRAVA_CLIENT_ID=your_client_id STRAVA_CLIENT_SECRET=your_client_secret STRAVA_REFRESH_TOKEN=your_refresh_token uvx strava-mcp-server
    
  2. Connect to the server using the MCP extension in your browser

Usage Examples

Once connected, you can ask Claude questions about your Strava activities:

  • "What are my recent activities?"
  • "Show me my activities from last week"
  • "What was my longest run in the past month?"
  • "Get details about my latest cycling activity"
  • "How many calories did I burn during my activities last month?"
  • "What was my average speed on my last three bike rides?"

Activity Data Format

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] |

Troubleshooting

If you encounter issues:

  1. Authentication Errors: Verify your Strava API credentials are correct and that your refresh token is valid
  2. Date Format Errors: Ensure dates are in ISO format (YYYY-MM-DD)
  3. Connection Issues: Check that the server is running and properly configured in your Claude settings
  4. Rate Limiting: Strava API has rate limits; if you hit them, wait before making more requests

For more detailed information, visit the GitHub repository.

Related MCPs

Fantasy Premier League
SportsPython

Access and analyze Fantasy Premier League data

FirstCycling
SportsPython

Access comprehensive professional cycling data including riders, races, and results

College Football Data
SportsPython

Access comprehensive college football statistics and data through the CFBD API

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.