Strava MCP Server
Connects to the Strava API to allow retrieval of athlete statistics, listing of recent activities, and fetching detailed information for specific activity IDs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Strava MCP Server show me my last five activities and career stats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Strava MCP Server
A Model Context Protocol (MCP) server that connects to the Strava API, allowing AI agents to retrieve athlete stats, list activities, and get detailed activity information.
Prerequisites
Python 3.10+
uv (installed and available in your PATH)
Strava API Application (to get Client ID and Secret)
Related MCP server: Strava Training MCP
Setup
1. Credentials
Go to Strava API Settings.
Create an application if you haven't already.
Note your
Client IDandClient Secret.You need a Refresh Token.
The easiest way to get one for your own account is to use the Strava OAuth playground or follow the Strava authentication docs to authorize your app and get the initial refresh token.
Scope required:
activity:read_all,read_all(adjust based on needs).
2. Installation
Clone this repository and enter the directory.
Using uv (Recommended):
uv sync
source .venv/bin/activateUsing standard pip:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install .3. Configuration
Copy
.env.exampleto.env.Fill in your credentials.
cp .env.example .env
# Edit .env with your favorite editorUsage
Run the server using fastmcp:
fastmcp run server.pyOr run it directly with uv:
uv run server.pyAvailable Tools
get_athlete_stats: Get statistics for the authenticated athlete.list_activities: List recent activities (default limit: 5).get_activity_details: Get detailed information for a specific activity ID.get_activity_laps: Get lap breakdowns for an activity (lap splits with metrics like pace, HR, power).get_activity_streams: Get raw stream data (GPS, heart rate, power, cadence, etc.) for an activity.search_activities: Search activities with filters (name query, type, date range, distance range).
Experimental
analyze_data: Execute Python code to analyze Strava data safely using Monty.Note: This tool allows the agent to write and execute Python code in a secure, sandboxed environment to perform complex calculations on your data (e.g., "calculate average pace for runs over 10km").
Connect to Claude Desktop
To use this server with Claude Desktop securely (keeping your API keys in .env and not in the config file), add the following to your claude_desktop_config.json:
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
You can use uv directly to run the server:
{
"mcpServers": {
"strava": {
"command": "uv",
"args": [
"run",
"server.py"
],
"cwd": "/absolute/path/to/strava-mcp"
}
}
}Note: Replace /absolute/path/to/strava-mcp with the full absolute path to your project directory. If Claude Desktop fails to start the server, you may need to provide the absolute path to the uv executable (e.g., /Users/yourname/.cargo/bin/uv). Run which uv (macOS/Linux) or where uv (Windows) in your terminal to find it.
Development
Running Tests
To run the test suite:
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest testsModify
server.pyto add more tools using thestravalibclient.
Available Tools
7 toolsanalyze_data_toolA
Execute Python code to analyze Strava data safely using Monty.
Args: code: Python code to execute. The data is available as a variable named 'data'. Example: "sum(activity['distance'] for activity in data) / 1000" data: The data to analyze (e.g. list of activities, athlete stats). Can be passed as a JSON object (list/dict) or a JSON string.
Inputs: code (required), data (required).
get_activity_details_toolB
Get detailed information for a specific activity.
Args: activity_id: The ID of the activity to retrieve
Inputs: activity_id (required). Returns: object
get_activity_laps_toolC
Get lap breakdowns for a specific activity.
Args: activity_id: The ID of the activity to retrieve laps for
Inputs: activity_id (required). Returns: result
get_activity_streams_toolA
Get raw stream data (GPS, HR, power, etc.) for a specific activity.
Args: activity_id: The ID of the activity to retrieve streams for types: List of stream types to fetch. Options: time, latlng, distance, altitude, velocity_smooth, heartrate, cadence, watts, temp, moving, grade_smooth. If None, all available streams will be returned. resolution: Data point resolution - 'low' (100 points), 'medium' (1000 points), 'high' (10000 points), or None (all points)
Inputs: activity_id (required), types, resolution. Returns: object
get_athlete_stats_toolB
Get statistics for the authenticated athlete. Returns a formatted string with recent and all-time stats.
Inputs: no named parameters. Returns: result
list_activities_toolC
List recent activities for the authenticated athlete.
Args: limit: Number of activities to return (default 5)
Inputs: limit. Returns: result
search_activities_toolA
Search activities with optional filters. Note: Name/description search is client-side, so a reasonable limit is recommended.
Args: query: Search term to match in activity name (case-insensitive, partial match) activity_type: Filter by activity type (e.g., "Run", "Ride", "Walk", "Hike") after: ISO 8601 date string (e.g., "2025-01-01") - activities after this date before: ISO 8601 date string (e.g., "2026-01-01") - activities before this date min_distance: Minimum distance in meters max_distance: Maximum distance in meters limit: Maximum number of activities to fetch from API (default 50)
Inputs: query, activity_type, after, before, +3 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose targeting specific Strava resources: analyze_data_tool for custom analysis, get_activity_details_tool for basic activity info, get_activity_laps_tool for lap data, get_activity_streams_tool for raw metrics, get_athlete_stats_tool for athlete statistics, list_activities_tool for recent activities, and search_activities_tool for filtered searches. There is no overlap or ambiguity between these functions.
All tool names follow a consistent verb_noun pattern with snake_case: analyze_data_tool, get_activity_details_tool, get_activity_laps_tool, get_activity_streams_tool, get_athlete_stats_tool, list_activities_tool, and search_activities_tool. This uniformity makes the set predictable and easy to understand.
With 7 tools, this server is well-scoped for a Strava integration, covering core operations like retrieving activities, analyzing data, and accessing athlete stats. Each tool serves a specific, necessary function without bloat, making the count appropriate for the domain.
The tool set provides strong coverage for reading and analyzing Strava data, including activities, streams, laps, and athlete stats, with a flexible search tool. A minor gap exists in write operations (e.g., creating or updating activities), but the read-focused surface is largely complete for typical agent workflows.
Maintenance
Related MCP Connectors
Strava MCP tools for AI: athletes, activities, segments, clubs, routes. Powered by HAPI MCP server.
Convert, validate, and inspect workout files (FIT, TCX, ZWO, Garmin Connect) for AI agents.
Ask your AI about your fitness: activities and data from Garmin, COROS, Strava, GPX and more
Your own cycling data for your AI assistant: rides, power, climbs and routes. Read-only.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Strava's API to access and manage activities, athlete data, routes, segments, clubs, and gear through natural language.228 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive access to Strava API for marathon training and race analysis, enabling language models to query athlete data, analyze training patterns, track performance metrics, monitor heart rate zones, and detect injury risks.1MIT
- AlicenseBqualityDmaintenanceIntegrates with the Strava API to allow AI assistants to access fitness data including athlete profiles, activity history, and segment statistics. It enables users to query detailed performance metrics and explore geographic segment data through natural language commands.8125 npmMIT
- AlicenseBqualityDmaintenanceEnables users to interact with their Strava data through natural language to analyze workouts, track fitness progress, and explore routes. It supports retrieving detailed activity stats, heart rate data, and segment insights directly within AI assistants.26538 npmMIT