Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

strava-mcp-server

MCP.Pizza Chef: tomekkorbak

The strava-mcp-server is an MCP server that integrates with the Strava API to provide language models real-time access to athlete activity data. It exposes tools for querying recent activities, activities by date range, and detailed activity information, enabling LLMs to retrieve and reason over fitness data securely and efficiently.

Use This MCP server To

Query authenticated athlete's recent Strava activities Retrieve Strava activities within a specific date range Fetch detailed information about a specific Strava activity Enable LLMs to analyze fitness data from Strava API Integrate Strava activity data into AI-enhanced fitness apps Automate fitness progress reports using Strava activity queries

README

Strava MCP Server

Python Package License: MIT Python 3.10

A Model Context Protocol (MCP) server that provides access to the Strava API. It allows language models to query athlete activities data from the Strava API.

Available Tools

The server exposes the following tools:

Activities Queries

  • get_activities(limit: int = 10): Get the authenticated athlete's recent activities
  • get_activities_by_date_range(start_date: str, end_date: str, limit: int = 30): Get activities within a specific date range
  • get_activity_by_id(activity_id: int): Get detailed information about a specific activity
  • get_recent_activities(days: int = 7, limit: int = 10): Get activities from the past X days

Dates should be provided in ISO format (YYYY-MM-DD).

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]

Authentication

To use this server, you'll need to authenticate with the Strava API. Follow these steps:

  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:

    • Use the included get_strava_token.py script:
    python get_strava_token.py
    • Follow the prompts to authorize your application
    • The script will save your tokens to a .env file
  3. Set environment variables: The server requires the following environment variables:

    • STRAVA_CLIENT_ID: Your Strava API Client ID
    • STRAVA_CLIENT_SECRET: Your Strava API Client Secret
    • STRAVA_REFRESH_TOKEN: Your Strava API Refresh Token

Usage

Claude for Desktop

Update your claude_desktop_config.json (located in ~/Library/Application\ Support/Claude/claude_desktop_config.json on macOS and %APPDATA%/Claude/claude_desktop_config.json on Windows) to include the following:

{
    "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"
            }
        }
    }
}

Claude Web

For Claude Web, you can run the server locally and connect it using the MCP extension.

Example Queries

Once connected, you can ask Claude questions like:

  • "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"

Error Handling

The server provides human-readable error messages for common issues:

  • Invalid date formats
  • API authentication errors
  • Network connectivity problems

License

This project is licensed under the MIT License - see the LICENSE file for details.

strava-mcp-server FAQ

How do I authenticate the strava-mcp-server with my Strava account?
You authenticate by providing your Strava API credentials or OAuth tokens configured in the server setup to securely access your athlete data.
Can the strava-mcp-server retrieve activities for multiple athletes?
No, it currently supports querying activities only for the authenticated athlete linked to the provided Strava credentials.
What activity data can the server provide to language models?
It provides recent activities, activities filtered by date range, and detailed information about specific activities including metrics like distance, duration, and type.
Is the strava-mcp-server compatible with multiple LLM providers?
Yes, it is designed to work with any MCP-compatible LLM provider such as OpenAI, Anthropic Claude, and Google Gemini.
How does the server handle rate limits imposed by the Strava API?
The server includes built-in mechanisms to respect Strava API rate limits and may queue or throttle requests to avoid exceeding limits.
Can I extend the strava-mcp-server with additional Strava API endpoints?
Yes, the server is open source and modular, allowing developers to add more endpoints or customize existing tools.
What Python version is required to run the strava-mcp-server?
The server requires Python 3.10 or higher as specified in its dependencies.
Is the strava-mcp-server open source and under what license?
Yes, it is open source and licensed under the MIT License.