Skip to main content

Strava MCP Server

Python Package License: MIT Python 3.10 Install MCP Server

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.

Metadata

Release files for iflow-mcp_tomekkorbak-strava-mcp-server 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_tomekkorbak-strava-mcp-server 0.1.3
File Size Uploaded
iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_tomekkorbak-strava-mcp-server 0.1.3
File Interpreter ABI Platform
iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3.tar.gz

Download URL iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b849c51f647d328355032ea55fa33a72391f7a9cf2e8af10c9719464e2c56528
BLAKE2b-256 checksum
How to use checksums
f57632778efa536ffe670fb877f31a8c4042f36ff2efd62d1211cf244ad69a67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3-py3-none-any.whl

Download URL iflow_mcp_tomekkorbak_strava_mcp_server-0.1.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
710d30a6a4c84f3febbc9f12e44c4e44b87f43f68d5ed012a53a78e85faf81d0
BLAKE2b-256 checksum
How to use checksums
da3936782f47de5d802ea5a5af6bca39388b1b2e98e2414d2619866ae22de03d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page