strava-mcp
A local MCP server for read-only Strava API access plus local caching, analysis, and export for one authenticated athlete.
Fetch recent activities, athlete profile/stats, activity details, streams, zones, laps, and gear details.
Sync bounded activity history into a local cache and inspect cache coverage and Strava rate-limit status.
Summarize activities by day/week/month and search by date range, sport type, gear, distance, and elevation.
Analyze gear usage and export bounded activity sets to raw JSON, compact JSON, and CSV.
Choose data source per query: cache, cache-then-API, or API; use compact stream sampling for long activities.
Provides tools for querying and managing your own Strava data, including recent activities, athlete profile, activity details and streams, stats, gear, zones, laps, activity search, and export.
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 What's my total running distance this month?"
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
Small, read-only local MCP server for querying your own Strava data from Codex. It uses Strava's API on behalf of one authenticated athlete; it is not a hosted or multi-user service.
Requirements
Node.js 22+
A Strava API application and an account authorized for its requested read scopes
Related MCP server: Strava Planner MCP
Quick Start
Create a Strava API application in the Strava API settings.
Complete the OAuth flow described below and copy the resulting refresh token.
Copy the environment template:
cp .env.example .envFill in:
STRAVA_CLIENT_ID=...
STRAVA_CLIENT_SECRET=...
STRAVA_REFRESH_TOKEN=...
STRAVA_GRANTED_SCOPES=read,activity:read,activity:read_all,profile:read_allInstall and verify:
npm install
npm run check
npm testBuild and run locally:
npm run build
npm startUse npm run dev only while developing.
OAuth Setup
This server intentionally has no browser-auth CLI: Strava's authorization flow is one-time setup, and the server refreshes and persists tokens afterward.
Set your app's authorization callback domain in Strava's API settings. For a local manual flow, use a loopback callback such as
localhost.Open an authorization URL using your client id and the scopes below. Replace
<client-id>and<redirect-uri>:
https://www.strava.com/oauth/authorize?client_id=<client-id>&response_type=code&redirect_uri=<redirect-uri>&approval_prompt=force&scope=read,activity:read_all,profile:read_allAfter approval, exchange the returned
codeathttps://www.strava.com/oauth/tokenwith your client id, client secret, authorization code, andgrant_type=authorization_code.Put the returned
refresh_tokeninSTRAVA_REFRESH_TOKEN. Copy the callback's grantedscopevalue intoSTRAVA_GRANTED_SCOPES.
The server stores rotated access and refresh tokens in ~/.config/strava-mcp/auth.json by default. Set STRAVA_DATA_DIR to move all local Strava state elsewhere, or set STRAVA_TOKEN_FILE only when the credential cache must live at a specific path.
Tools
strava_recent_activitiesstrava_athlete_profilestrava_activity_detailstrava_activity_streamsstrava_athlete_statsstrava_gear_detailstrava_athlete_zonesstrava_activity_zonesstrava_activity_lapsstrava_rate_limit_statusstrava_sync_activitiesstrava_cache_statusstrava_activity_summarystrava_gear_usagestrava_activity_searchstrava_export_activities
Common Codex workflows
Sync activity history into the ignored local cache:
{
"after": 1648771200,
"maxPages": 20
}Query from cache only after a sync:
{
"after": 1648771200,
"sportTypes": ["MountainBikeRide", "Ride"],
"groupBy": "month",
"source": "cache"
}Use source on bounded analysis and export tools:
cache_then_apiuses local cache when covered, then syncs missing history if needed. This is the default.cachenever calls Strava and fails clearly if the cache does not cover the range.apicalls Strava directly and does not require cache coverage.
Export an audit snapshot from the same resolved activity set:
{
"after": 1648771200,
"sportTypes": ["MountainBikeRide", "Ride"],
"source": "cache"
}Inspect local cache/rate-limit metadata with strava_cache_status, strava_rate_limit_status, or the MCP resource strava://cache/status.
For long activities, prefer compact streams:
{
"id": 123456789,
"keys": ["time", "distance", "heartrate", "latlng"],
"maxPoints": 500
}Codex MCP config
Use absolute paths for your clone:
[mcp_servers.strava]
command = "node"
args = ["/absolute/path/to/strava-mcp/dist/server.js"]Keep this read-only unless you intentionally add write scopes and write tools.
STRAVA_TOKEN_FILE is optional. Strava can rotate refresh tokens, and the server writes the newest token to STRAVA_DATA_DIR/auth.json by default.
Processes on the same machine using the same token file coordinate OAuth refreshes with an owner-only auth.json.refresh-lock directory. Token updates use atomic replacement. This does not coordinate clients on different machines or protect concurrent writes to other data.
If a refresh is interrupted or fails after it starts, the lock is retained because Strava may already have rotated the token. Stop all clients, inspect the credential state, and reauthenticate if the current token cannot be established before removing the lock. Do not automatically delete an apparently stale lock; its presence may indicate an uncertain rotation. A busy lock times out after 30 seconds.
STRAVA_GRANTED_SCOPES is optional but recommended. Copy the comma-separated scope value from the OAuth callback URL so scope errors fail locally with a clear message.
Private local data lives outside the repository:
auth.json: rotated OAuth token cache.cache/activities.json: local activity-history cache.exports/*.jsonandexports/*.csv: raw and compact audit exports.
By default these are under ~/.config/strava-mcp. Use them for local audits, but do not add them to Git.
Development
npm run format:check
npm run lint
npm run typecheck
npm testSee CONTRIBUTING.md for project scope and contribution guidance.
Available Tools
16 toolsstrava_activity_detailBRead-only
Fetch detailed data for one Strava activity.
Inputs: id (required), includeAllEfforts.
strava_activity_lapsARead-only
Fetch laps for one Strava activity.
Inputs: id (required).
strava_activity_searchBRead-only
Search bounded activity history by name, sport type, gear, distance, and elevation.
Inputs: after (required), limit, query, before, +7 more.
strava_activity_streamsARead-only
Fetch activity stream samples such as time, distance, altitude, heartrate, cadence, watts, and lat/lng.
Inputs: id (required), keys, keyByType, maxPoints, +1 more.
strava_activity_summaryARead-only
Summarize activities by day, Monday-start week, or month for a bounded date range.
Inputs: after (required), groupBy (required), before, source, +4 more.
strava_activity_zonesBRead-only
Fetch zone distribution for one Strava activity.
Inputs: id (required).
strava_athlete_profileARead-only
Fetch the authenticated Strava athlete profile.
Inputs: no named parameters.
strava_athlete_statsBRead-only
Fetch aggregate stats for a Strava athlete id.
Inputs: athleteId (required).
strava_athlete_zonesARead-only
Fetch the authenticated athlete's heart-rate and power zones.
Inputs: no named parameters.
strava_cache_statusARead-only
Show local Strava activity cache coverage and metadata.
Inputs: no named parameters.
strava_export_activitiesA
Export bounded activity history to ignored local raw JSON, compact JSON, and CSV audit files.
Inputs: after (required), before, source, gearIds, +2 more.
strava_gear_detailARead-only
Fetch detail for one Strava gear id.
Inputs: id (required).
strava_gear_usageARead-only
Group activity mileage, hours, and elevation by gear id for service-interval audits.
Inputs: after (required), before, source, gearIds, +2 more.
strava_rate_limit_statusARead-only
Show Strava API rate-limit headers last observed by this MCP process.
Inputs: no named parameters.
strava_recent_activitiesBRead-only
List the authenticated athlete's recent Strava activities.
Inputs: page, after, before, perPage.
strava_sync_activitiesB
Fetch bounded Strava activity history into the local ignored activity cache.
Inputs: after (required), before, maxPages.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools are clearly distinct, but a few could overlap in intent, such as athlete_profile vs athlete_stats and sync_activities vs export_activities. Overall, the descriptions and resource targets make confusion unlikely.
All tools share the strava_ prefix, but the pattern is inconsistent: some use resource_detail/resource_status, while others use verb_entity like sync_activities and export_activities. This mixed convention reduces predictability.
16 tools is slightly above the typical well-scoped range, but the count is reasonable for a Strava API surface covering athlete, activity, gear, zones, streams, sync, cache, and export functionality.
The toolset covers the main read-oriented Strava data needs: athlete info, stats, activities, streams, zones, laps, gear, and cache/export workflows. It lacks write/create/update operations, but for a read-heavy MCP server this is likely sufficient.
Maintenance
Related MCP Connectors
Strava MCP server for ChatGPT, Claude and any AI agent: list activities, update activity gear, read club leaderboard, comment on activity, log manual activity and request account export in your own Strava account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Strava yourself; Cotlet does not store your password and you need no Strava API key. About the official Strava API: Strava has an official API and, since 1 June 2026, an official MCP connector (checked 27 Oct 2026). The MCP is read-only, works with Claude only and needs a paid Strava subscription. Setup and FAQ: https://cotlet.dev/integrations/strava-api-mcp-server
Strava MCP tools for AI: athletes, activities, segments, clubs, routes. Powered by HAPI MCP server.
Remote MCP server for training, nutrition, wellness, and performance data with OAuth 2.0.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Related MCP Servers
- AlicenseBqualityBmaintenancePrivacy-first MCP server for Strava activities, streams, routes and training data.29159 npm3MIT
- FlicenseAqualityCmaintenanceExposes Strava training data to Claude for coaching, planning, and analysis via a read-only MCP server with OAuth and Docker support.13-
- AlicenseNot gradedqualityDmaintenanceMCP server that exposes Strava API v3 data (activities, segments, routes, clubs, gear, streams) as tools for any MCP client. Read-only by default, with an optional --write flag to enable mutating operations.1ISC
- FlicenseBqualityDmaintenanceA local, read-only Model Context Protocol server for an athlete's Strava profile and activities, enabling retrieval of profile data, activity lists (with paging and date filters), and detailed activity information via standard input/output for MCP hosts.3-