The Strava MCP Server provides comprehensive integration with the Strava API, enabling access to and management of athlete data, activities, routes, segments, clubs, and gear.
Activity Management: List activities with filters for date range and pagination, get detailed activity information including segment efforts and streams (GPS, heart rate, power, cadence, altitude), create manual activities with name, sport type, duration, distance and description, update existing activities (name, type, commute status, gear, trainer status, description, visibility), delete activities, and view activity comments and kudos.
Athlete Profile & Stats: Access authenticated athlete profile, retrieve statistics and totals, and get training zones for heart rate and power.
Routes: List athlete routes with pagination and get detailed route information including elevation profile and GPS data.
Segments: List starred segments, get segment details, view segment leaderboards with filters (gender, age group, weight class, clubs, followers, date range), and explore segments in geographic areas using boundary coordinates with filters for climb category and activity type.
Clubs & Social: List athlete clubs, get club details including member count, view club members with pagination, and see recent club activities.
Gear Management: Retrieve detailed information about bikes, shoes, and other equipment including usage statistics.
Transport Modes: stdio mode for single-user applications like Claude Desktop using environment tokens, and HTTP mode for multi-user deployments with OAuth + JWT authentication (compatible with ChatGPT and REST clients).
Token Management: Automatically refreshes Strava access tokens, with in-memory storage for stdio mode and SQLite persistence for HTTP mode. Use minimal=true parameter to reduce context usage when retrieving large datasets.
Provides comprehensive access to Strava API endpoints for managing activities, athlete profiles, routes, segments, clubs, and gear. Supports activity CRUD operations, GPS and performance data streams, social features like comments and kudos, segment leaderboards, and athlete statistics and training zones.
Click on "Install 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 Servershow my activities from last week"
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 for integrating with the Strava API. This server provides comprehensive access to all major Strava API endpoints including activities, athlete data, routes, segments, clubs, and gear.
Transport Modes
This server supports two transport modes per the MCP specification:
Mode | Command | Auth | Use Case |
stdio |
| Environment tokens | Claude Desktop (single user) |
HTTP |
| OAuth + JWT | ChatGPT, REST clients (multi-user) |
Features
Activity Management
Get athlete activities with filters (date range, pagination)
Get detailed activity information
Create, update, and delete activities
Access activity streams (GPS, heart rate, power, cadence, etc.)
Get activity comments and kudos
Athlete Data
Get authenticated athlete profile
Get athlete statistics and totals
Get athlete zones (heart rate and power)
Routes
Get athlete routes
Get detailed route information
Segments
Get starred segments
Get segment details
Get segment leaderboards with filters
Explore segments in geographic areas
Clubs & Social
Get athlete clubs
Get club details and members
Get club activities
Gear
Get detailed gear information
Prerequisites
Node.js 18+ (LTS recommended)
A Strava account
Strava API credentials (Client ID and Client Secret)
Installation
Clone this repository:
Install dependencies:
Copy the example environment file:
Build the project:
Strava API Setup
1. Create a Strava Application
Go to Strava API Settings
Create a new application
Fill in the required information:
Application Name: Your app name
Category: Choose appropriate category
Website: Can use
http://localhostfor testingAuthorization Callback Domain: Use
localhostfor local testing, or your domain for production
Note your Client ID and Client Secret
Add them to your
.envfile
2. Choose Your Transport Mode
stdio Mode (Claude Desktop)
For single-user use with Claude Desktop:
The setup script will guide you through the OAuth flow and save tokens to .env.
HTTP Mode (Multi-user)
For multi-user deployments (ChatGPT, REST clients):
Users authenticate via OAuth at /auth/authorize and receive a JWT for API access.
ChatGPT Configuration
To use with ChatGPT:
Generate OAuth credentials for your
.env:echo "OAUTH_CLIENT_ID=$(openssl rand -hex 16)" echo "OAUTH_CLIENT_SECRET=$(openssl rand -hex 16)"Expose your server via ngrok or deploy publicly:
ngrok http 3000In ChatGPT, configure your MCP server with:
Server URL:
https://your-ngrok-url.ngrok-free.devOAuth Client ID: Value from your
.envOAuth Client Secret: Value from your
.env
ChatGPT will automatically discover the OAuth endpoints via /.well-known/oauth-authorization-server.
MCP Configuration (stdio Mode)
Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
HTTP API Reference
When running in HTTP mode (npm run start:http), the following endpoints are available:
OAuth 2.0 Endpoints
Endpoint | Method | Description |
| GET | OAuth server metadata (RFC 8414) |
| GET | OAuth authorization endpoint (redirects to Strava) |
| GET | Internal OAuth callback from Strava |
| POST | Exchange authorization code for JWT |
| GET | Get current athlete info (requires JWT) |
| POST | Revoke tokens (requires JWT) |
Tools
Endpoint | Method | Auth | Description |
| GET | - | List all available tools |
| GET | - | Get tool schema |
| POST | JWT | Execute a tool |
Example Usage
Available Tools
Activities
get_activities- List athlete activities with filtersget_activity- Get detailed activity informationcreate_activity- Create a new manual activityupdate_activity- Update an existing activitydelete_activity- Delete an activityget_activity_streams- Get activity data streamsget_activity_comments- Get activity commentsget_activity_kudos- Get activity kudos
Athlete
get_athlete- Get authenticated athlete profileget_athlete_stats- Get athlete statisticsget_athlete_zones- Get athlete training zones
Routes
get_routes- List athlete routesget_route- Get route details
Segments
get_starred_segments- List starred segmentsget_segment- Get segment detailsget_segment_leaderboard- Get segment leaderboardexplore_segments- Explore segments in an area
Clubs
get_athlete_clubs- List athlete clubsget_club- Get club detailsget_club_members- Get club membersget_club_activities- Get club activities
Gear
get_gear- Get gear details
Environment Variables
Variable | Required | Mode | Description |
| Yes | Both | Strava API client ID |
| Yes | Both | Strava API client secret |
| Yes | stdio | User's access token |
| Yes | stdio | User's refresh token |
| Yes | stdio | Token expiration timestamp |
| Yes | HTTP | OAuth client ID for ChatGPT (you create this) |
| Yes | HTTP | OAuth client secret for ChatGPT (you create this) |
| Yes | HTTP | Secret for signing JWTs |
| No | HTTP | JWT expiration (default: 7d) |
| Yes | HTTP | OAuth callback URL |
| No | HTTP | SQLite path (default: ./data/strava-mcp.db) |
| No | HTTP | Server port (default: 3000) |
Development
Scripts
npm run build- Build the TypeScript projectnpm run dev- Watch mode for developmentnpm run lint- Lint the codebasenpm test- Run testsnpm start- Start MCP server (stdio mode)npm run start:http- Start HTTP servernpm run setup- Interactive OAuth setup
Project Structure
Token Refresh
The server automatically refreshes access tokens when they expire:
stdio mode: Tokens are refreshed in memory
HTTP mode: Refreshed tokens are persisted to SQLite
Rate Limiting
Strava has rate limits:
100 requests per 15 minutes
1,000 requests per day
The server does not currently implement rate limiting, so use responsibly.
Troubleshooting
"No tokens available" error (stdio mode)
Ensure all
STRAVA_*environment variables are set in.envRun
npm run setupto obtain new tokens
"JWT_SECRET required" error (HTTP mode)
Add
JWT_SECRETto your.envfileGenerate one with:
openssl rand -base64 32
"No tokens found for user" error (HTTP mode)
User needs to re-authenticate at
/auth/stravaTokens may have been revoked by Strava
"Failed to refresh token" error
Your refresh token may have been revoked
Go through the OAuth flow again to get new tokens
Build errors
Ensure you're using Node.js 18+ LTS
Run
npm installto ensure all dependencies are installed
License
MIT