Strava MCP Server
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 "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 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) |
Related MCP server: Strava MCP Server
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:
git clone https://github.com/gcoombe/strava-mcp.git
cd strava-mcpInstall dependencies:
npm installCopy the example environment file:
cp .env.example .envBuild the project:
npm run buildStrava 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:
# Run the interactive setup to get your personal tokens
npm run setup
# Start the server
npm startThe 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):
# Add HTTP-specific variables to .env:
# OAUTH_CLIENT_ID=<generate with: openssl rand -hex 16>
# OAUTH_CLIENT_SECRET=<generate with: openssl rand -hex 16>
# JWT_SECRET=<generate with: openssl rand -base64 32>
# STRAVA_REDIRECT_URI=http://localhost:3000/auth/strava/callback
# Start the HTTP server
npm run start:httpUsers 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
{
"mcpServers": {
"strava": {
"command": "node",
"args": [
"/absolute/path/to/strava-mcp/dist/index.js"
]
}
}
}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
# Start the server
npm run start:http
# For ChatGPT: Configure with your server URL and OAuth credentials
# ChatGPT will handle the OAuth flow automatically
# For manual testing with curl:
# 1. List tools (no auth required)
curl http://localhost:3000/tools
# 2. After completing OAuth flow, use the JWT for API calls
TOKEN="your-jwt-token"
# Get athlete profile
curl -X POST http://localhost:3000/tools/get_athlete \
-H "Authorization: Bearer $TOKEN"
# Get recent activities
curl -X POST http://localhost:3000/tools/get_activities \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"per_page": 10}'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
strava-mcp/
├── src/
│ ├── index.ts # Entry point (mode selection)
│ ├── auth.ts # Strava OAuth handling
│ ├── strava-client.ts # Strava API client
│ ├── http-server.ts # Express HTTP server
│ ├── create-tools.ts # Tool initialization
│ ├── db.ts # SQLite database (HTTP mode)
│ ├── auth/ # HTTP auth module
│ │ ├── jwt.ts # JWT utilities
│ │ ├── middleware.ts # Auth middleware
│ │ └── routes.ts # OAuth endpoints
│ ├── types/
│ │ └── strava.ts # TypeScript definitions
│ ├── tools/ # MCP tool implementations
│ │ ├── activities.ts
│ │ ├── athlete.ts
│ │ ├── routes.ts
│ │ ├── segments.ts
│ │ ├── clubs.ts
│ │ └── gear.ts
│ └── utils/
│ └── data-reducer.ts # Response optimization
├── data/ # SQLite database (HTTP mode)
├── package.json
├── tsconfig.json
├── .env.example
└── README.mdToken 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
Resources
Available Tools
22 toolscreate_activityC
Create a new manual activity
Inputs: name (required), sport_type (required), start_date_local (required), elapsed_time (required), +5 more.
delete_activityC
Delete an activity
Inputs: id (required).
explore_segmentsC
Explore segments in a geographic area
Inputs: bounds (required), activity_type, min_cat, max_cat.
get_activitiesA
Get logged-in athlete activities with optional filters. Use minimal=true for large datasets to reduce context usage.
Inputs: before, after, page, per_page, +1 more.
get_activityB
Get detailed information about a specific activity by ID. Use minimal=true to reduce context usage.
Inputs: id (required), include_all_efforts, minimal.
get_activity_commentsC
Get comments for an activity
Inputs: id (required), page, per_page.
get_activity_kudosC
Get kudos for an activity
Inputs: id (required), page, per_page.
get_activity_streamsC
Get activity streams (GPS, heart rate, power, cadence, etc.)
Inputs: id (required), keys, key_by_type.
get_athleteB
Get the authenticated athlete profile
Inputs: no named parameters.
get_athlete_clubsC
Get clubs the authenticated athlete belongs to
Inputs: page, per_page.
get_athlete_statsC
Get athlete statistics (totals and recent activities)
Inputs: athlete_id (required).
get_athlete_zonesB
Get athlete zones (heart rate and power zones)
Inputs: no named parameters.
get_clubC
Get detailed information about a specific club
Inputs: id (required).
get_club_activitiesC
Get recent activities from club members
Inputs: id (required), page, per_page.
get_club_membersC
Get members of a club
Inputs: id (required), page, per_page.
get_gearB
Get detailed information about a specific piece of gear (bike, shoes, etc.)
Inputs: id (required).
get_routeC
Get detailed information about a specific route
Inputs: id (required).
get_routesC
Get athlete routes
Inputs: athlete_id (required), page, per_page.
get_segmentC
Get detailed information about a specific segment
Inputs: id (required).
get_segment_leaderboardC
Get segment leaderboard with optional filters
Inputs: id (required), gender, age_group, weight_class, +5 more.
get_starred_segmentsC
Get athlete starred segments
Inputs: page, per_page.
update_activityC
Update an existing activity
Inputs: id (required), commute, trainer, hide_from_home, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Every tool has a clearly distinct purpose targeting specific resources (activities, athlete, clubs, gear, routes, segments) and actions (get, create, update, delete, explore). There is no overlap or ambiguity between tools, making it easy for an agent to select the correct one.
All tools follow a consistent verb_noun pattern (e.g., get_activity, create_activity, update_activity) with no deviations. The naming is uniform throughout, using snake_case and clear action-resource combinations.
With 22 tools, the count is slightly high but reasonable for the Strava domain, which covers activities, athlete data, clubs, gear, routes, and segments. It provides comprehensive coverage without being excessive, though it borders on the heavy side.
The tool set offers complete CRUD/lifecycle coverage for key resources like activities (create, get, update, delete) and extensive read operations for athlete, clubs, gear, routes, and segments. There are no obvious gaps, supporting full agent workflows in the Strava ecosystem.
Maintenance
Related MCP Connectors
Strava MCP tools for AI: athletes, activities, segments, clubs, routes. Powered by HAPI MCP server.
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.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Related MCP Servers
- 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
- FlicenseAqualityDmaintenanceEnables AI agents to interact with the Strava API to retrieve athlete statistics and activity data. It provides tools for listing recent activities and fetching detailed information for specific workout sessions.7-
- 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
- AlicenseBqualityDmaintenanceConnects Claude to the Strava API to provide direct access to fitness data, including athlete statistics, detailed activity logs, and time-series performance metrics. It enables users to analyze training progress, compare workouts, and retrieve specific segment details through natural language queries.8125 npmISC