Strava API

Strava API

MCP server for Strava API to retrieve one's activities

17
Stars
10
Forks
0
Releases

Overview

Strava MCP Server provides access to the Strava API via MCP to allow language models to retrieve athlete activities. It exposes a set of tools for common activity queries: get_activities(limit: int = 10) to fetch recent activities; get_activities_by_date_range(start_date: str, end_date: str, limit: int = 30) to fetch activities within a date window; get_activity_by_id(activity_id: int) to fetch detailed information about a single activity; and get_recent_activities(days: int = 7, limit: int = 10) to fetch activities from the past N days. The server returns activity data with consistent field names and units, including name, sport_type, start_date (ISO 8601), distance_metres, elapsed_time_seconds, moving_time_seconds, average_speed_mps, max_speed_mps, total_elevation_gain_metres, elev_high_metres, elev_low_metres, calories, start_latlng, and end_latlng. Authentication is required via Strava API credentials and a refresh token, provided through environment variables STRAVA_CLIENT_ID, STRAVA_CLIENT_SECRET, and STRAVA_REFRESH_TOKEN. A helper script get_strava_token.py can guide tokens into a .env file. The README also provides usage guidance for Claude Desktop/Web integration, showing how to configure the MCP server name, command, arguments, and environment variables. Error handling includes human-readable messages for invalid dates, authentication issues, and network problems.

Details

Owner
tomekkorbak
Language
Python
License
MIT License
Updated
2025-12-06

Features

get_activities

Get the authenticated athlete's recent activities (limit: int = 10).

get_activities_by_date_range

Get activities within a specific date range (start_date, end_date ISO format; limit: int = 30).

get_activity_by_id

Get detailed information about a specific activity by its ID.

get_recent_activities

Get activities from the past N days (days: int = 7; limit: int = 10).

Tags

stravamcpserveractivitiesapiauthenticationpythonclaudellmfitnessworkouts