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+
- Strava Account
- Strava API Application (to get Client ID and Secret)
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/activate
Using 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 editor
Usage
Run the server using fastmcp:
fastmcp run server.py
Or run it directly with Python (if the main block calls mcp.run()):
python server.py
Available 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.
Development
- Modify
server.pyto add more tools using thestravalibclient.