Get the FREE Ultimate OpenClaw Setup Guide →

strava

MCP server for Strava API integration

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tomekkorbak-strava-mcp-server uvx strava-mcp-server \
  --env STRAVA_CLIENT_ID="YOUR_CLIENT_ID" \
  --env STRAVA_CLIENT_SECRET="YOUR_CLIENT_SECRET" \
  --env STRAVA_REFRESH_TOKEN="YOUR_REFRESH_TOKEN"

How to use

This MCP server exposes a Strava API integration that lets language models query athlete activities from the authenticated Strava account. The available tools include: get_activities(limit) to fetch the most recent activities for the authenticated user; get_activities_by_date_range(start_date, end_date, limit) to fetch activities within a specific ISO date range; get_activity_by_id(activity_id) to retrieve detailed data for a single activity; and get_recent_activities(days, limit) to obtain activities from the past given number of days. The server returns structured activity data with consistent field names such as name, sport_type, start_date, distance_metres, and other common metrics like calories and elevation gains. To use these tools, authenticate with Strava by supplying your Strava API credentials via environment variables, then invoke the functions from your MCP-enabled client or Claude integration as needed.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Access to a tool to run MCP servers (uvx) or a compatible MCP runtime
  • Strava API credentials to configure the environment variables

Installation steps:

  1. Install Python and ensure python --version reports 3.10.x

  2. Install the MCP runtime tool (uvx). You can install it via your preferred method, for example:

    • Using pipx (recommended): python -m pip install --user pipx python -m pipx ensurepath pipx install uvx

    • Or using pip directly (if supported in your environment): python -m pip install uvx

  3. Install the Strava MCP server package: uvx strava-mcp-server (This registers the MCP server package named strava-mcp-server in your environment.)

  4. Prepare environment variables for authentication. Create a shell environment or a .env file with: STRAVA_CLIENT_ID="your_client_id" STRAVA_CLIENT_SECRET="your_client_secret" STRAVA_REFRESH_TOKEN="your_refresh_token"

  5. Run the MCP server via the MCP runtime (as configured in mcp_config): The recommended invocation from your MCP front-end should automatically load the environment variables defined for the server. Example (if launching directly): uvx strava-mcp-server

  6. Verify the server is running and accessible to your MCP client. You should be able to query:

    • get_activities(limit=10)
    • get_activities_by_date_range("2024-01-01", "2024-01-31", limit=20)
    • get_activity_by_id(activity_id)
    • get_recent_activities(days=7, limit=10)

Notes:

  • Ensure the Strava API app is configured with the appropriate redirect/authorization settings and that the refresh token is valid.
  • If you rotate tokens, update the environment variables accordingly and restart the server.

Additional notes

Tips and common issues:

  • Make sure the Strava API Client ID, Client Secret, and Refresh Token are kept secure. Do not commit them to source control.
  • The server expects ISO-8601 dates for date-based queries (YYYY-MM-DD).
  • If you encounter authentication errors, re-run the token retrieval script (see get_strava_token.py in the repo) to refresh tokens and update .env.
  • When running locally, ensure network access to Strava API endpoints is allowed (no corporate firewall blocks).
  • If using Claude integrations, configure the MCP path in Claude to point to the uvx-based server as shown in the README usage example.

Related MCP Servers

Sponsor this space

Reach thousands of developers