strava-mcp
A read-only local MCP server for querying your own Strava data from Codex, providing tools for activities, athlete profile, stats, gear, and more.
README
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
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 .env
Fill in:
STRAVA_CLIENT_ID=...
STRAVA_CLIENT_SECRET=...
STRAVA_REFRESH_TOKEN=...
STRAVA_GRANTED_SCOPES=read,activity:read,activity:read_all,profile:read_all
- Install and verify:
npm install
npm run check
npm test
- Build and run locally:
npm run build
npm start
Use 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_all
- After 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.
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 test
See CONTRIBUTING.md for project scope and contribution guidance.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.