Get the FREE Ultimate OpenClaw Setup Guide →

strava

MCP server from ctvidic/strava-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ctvidic-strava-mcp-server python src/strava_server.py \
  --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 provides programmatic access to Strava data via the Model Context Protocol (MCP). It exposes endpoints and a Python-based server that authenticates with Strava using OAuth credentials stored in environment variables. Through Claude or other MCP-enabled clients, you can query activities, athlete statistics, routes, and social interactions (kudos, comments), and you can retrieve route visualizations and detailed activity data. Typical usage involves starting the MCP server in your environment and then directing your MCP client to the Strava server name to issue queries or call available endpoints through the MCP gateway. The server is designed to unlock Strava data for language models to reason about activities, performance metrics, and routes in natural language or structured queries.

When used with Claude, you can issue natural language prompts such as: asking for recent activities, obtaining the best times on segments, requesting route maps, or fetching athlete stats. The server interprets these requests and returns structured data including distances, times, elevation, heart rate information, and route visualizations. If you prefer a traditional HTTP approach, the server also exposes endpoints for activities, athlete stats, and maps, enabling integration with other tools or dashboards.

Key capabilities include activity tracking and analysis, athlete statistics, route visualization, achievement tracking, and social features like kudos and comments. This makes it suitable for generating reports, building insights about training progress, and feeding Strava data into decision-support workflows for athletes and coaches.

How to install

Prerequisites:

  • Python 3.12+ installed on your system
  • pip installed and available on PATH
  • Strava API credentials (Client ID, Client Secret, Refresh Token)
  • Access to a terminal or shell

Installation steps:

  1. Clone the repository (or prepare your project directory): git clone https://github.com/yourusername/strava_mcp.git cd strava_mcp

  2. Create a virtual environment and activate it: python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate

  3. Install Python dependencies: pip install -r requirements.txt

  4. Create a config file with Strava credentials (see next step for details):

    • Create config/.env and populate it with: STRAVA_CLIENT_ID=your_client_id STRAVA_CLIENT_SECRET=your_client_secret STRAVA_REFRESH_TOKEN=your_refresh_token
  5. Start the MCP server (see configuration for env vars and command):

    • Ensure you have the correct environment variables set (as shown in the mcp_config example).
    • Run the MCP server using the configured command, for example via your MCP runner: python src/strava_server.py
  6. (Optional) Verify the HTTP API (if available):

    • Start the HTTP server (if provided in the project) and navigate to http://localhost:8000 to explore endpoints like /activities/recent, /activities/{id}, /athlete/stats, etc.

Additional notes

  • Never commit .env files or any credentials to version control; use environment variables and a secure secrets manager.
  • Keep your Strava credentials up to date; refresh tokens may expire and require re-authentication.
  • Ensure the correct working directory (cwd) is set for the MCP server to locate src/strava_server.py and related modules.
  • If you encounter authentication errors, double-check that STRAVA_CLIENT_ID, STRAVA_CLIENT_SECRET, and STRAVA_REFRESH_TOKEN are valid and that the Strava app has the required scopes.
  • The server may expose both MCP-based queries and a lightweight HTTP API; use the MCP interface for integration with LLM tooling and the HTTP API for external tooling access.
  • Review the requirements.txt to understand Python dependencies and any compatibility notes with your Python version.
  • For local development, consider using a dedicated virtual environment per project to avoid dependency conflicts.

Related MCP Servers

Sponsor this space

Reach thousands of developers