claudex-strava-mcp
Connects to Strava API to query athlete profile, stats, activities, activity details, laps, heart rate zones, and routes.
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., "@claudex-strava-mcp How many runs did I do 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.
claudex-strava-mcp
A Model Context Protocol (MCP) server that connects Claude to your Strava fitness data. Ask Claude questions about your real training history in plain English — no dashboards, no manual exports.
Built with TypeScript, the MCP SDK, and Zod schema validation. Automatic OAuth token refresh included.
What you can ask Claude
"How many walks did I do this month?"
"Where were my last 3 activities?"
"How do my 2025 and 2026 activity counts compare?"
"Which of my activities had the most stop time?"
"Am I hitting my Zone 2 training targets?"
Related MCP server: Strava MCP Server
Prerequisites
Node.js 18+
A Strava account with activities
A Strava API app (create one here)
Claude Desktop (or any MCP-compatible client)
Setup
1. Clone and install
git clone https://github.com/your-username/claudex-strava-mcp
cd claudex-strava-mcp
npm install2. Create your Strava API app
Go to strava.com/settings/api and create an app. Set the Authorization Callback Domain to localhost.
You'll receive a Client ID and Client Secret — keep these safe.
3. Get your refresh token
Copy the example env file and fill in your Client ID and Secret:
cp .env.example .env
# Edit .env and add your STRAVA_CLIENT_ID and STRAVA_CLIENT_SECRETThen run the OAuth helper:
npx tsx scripts/get-token.tsThis will:
Print an authorization URL — open it in your browser
Ask you to authorize the app on Strava
Redirect to localhost and exchange the code for tokens
Print your
STRAVA_REFRESH_TOKENin the terminal
Copy the printed refresh token into your .env:
STRAVA_CLIENT_ID=your_client_id
STRAVA_CLIENT_SECRET=your_client_secret
STRAVA_REFRESH_TOKEN=your_refresh_token4. Build the server
npm run buildThis compiles TypeScript to dist/.
5. Configure Claude Desktop
Add the following to your Claude Desktop config 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/claudex-strava-mcp/dist/index.js"],
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"STRAVA_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Restart Claude Desktop. The Strava tools will appear in Claude's tool list.
Project structure
claudex-strava-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── strava-client.ts # Strava API client with auto token refresh
│ └── tools.ts # 8 MCP tool definitions (Zod-validated)
├── scripts/
│ └── get-token.ts # One-time OAuth token helper
├── .env.example # Template — copy to .env and fill in values
├── .gitignore
├── package.json
└── tsconfig.jsonAvailable tools
Tool | Description |
| Your Strava profile and preferences |
| All-time, YTD, and recent totals by sport |
| Paginated activity list with date filters |
| Detailed stats for a single activity |
| Lap-by-lap breakdown |
| Heart rate zone distribution |
| Your saved routes |
| Detailed route info |
How it works
The server uses the MCP SDK's McpServer class and registers tools using Zod schemas for runtime validation. The Strava client handles OAuth token refresh automatically — if your access token is within 60 seconds of expiring, it refreshes using your stored refresh token before making any API call.
Claude prompt
│
▼
MCP Tool Layer (TypeScript)
│
├── list_activities ──► GET /athlete/activities
├── get_activity ──► GET /activities/{id}
├── get_activity_zones ► GET /activities/{id}/zones
└── ...
│
▼
Strava API
│
▼
Structured JSON → Claude reasons → Natural language responseDevelopment
npm run dev # Watch mode — recompiles on save
npm run build # Production build
npm start # Run compiled serverSecurity notes
Never commit your
.envfile — it's in.gitignoreRotate your Strava client secret at strava.com/settings/api if it's ever exposed
The OAuth scopes requested are
read,activity:read_all, andprofile:read_all— read-only access only
License
MIT
Built by Mostafa Didar Mahdi — Data Scientist, Anthropic-certified AI practitioner, Adelaide.
Available Tools
8 toolsget_activityA
Get detailed information about a specific activity including splits, segment efforts, and all metrics. Use list_activities first to find activity IDs.
Inputs: activity_id (required), include_all_efforts.
get_activity_lapsA
Get lap data for a specific activity. Each lap includes time, distance, pace, heart rate, and other metrics.
Inputs: activity_id (required).
get_activity_zonesA
Get heart rate and power zone distribution for a specific activity. Shows time spent in each zone.
Inputs: activity_id (required).
get_athlete_profileA
Get the authenticated athlete's profile including name, location, and preferences
Inputs: no named parameters.
get_athlete_statsA
Get athlete statistics including total distance, time, elevation for running, cycling, and swimming. Includes recent, year-to-date, and all-time totals.
Inputs: athlete_id (required).
get_routeA
Get detailed information about a specific route including distance, elevation profile, and waypoints.
Inputs: route_id (required).
list_activitiesA
List the authenticated athlete's recent activities with pagination. Returns summary data for each activity including name, type, distance, time, and elevation.
Inputs: page, after, before, per_page.
list_routesA
List the athlete's saved routes. Returns summary data including name, distance, elevation gain, and type.
Inputs: athlete_id (required), page, per_page.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource/action: athlete profile, stats, activities (list and detail), activity laps, activity zones, routes (list and detail). No two tools overlap in purpose, and descriptions clearly differentiate list-level summaries from detail-level data.
All tool names follow a consistent verb_noun pattern: 'get_' for single resources and 'list_' for collections. CamelCase is not used, and the pattern is uniformly applied across all eight tools.
Eight tools is well-scoped for a Strava data retrieval server. Each tool covers a distinct aspect of athlete, activity, or route data, and the count is neither too small for utility nor too large for coherence.
The domain appears to be read-only athlete data retrieval. Core areas are covered: profile, stats, activities, activity details (laps, zones), and routes. Minor gaps exist, such as activity streams or segment efforts, but these are not essential for the apparent primary purpose.
Maintenance
Related MCP Connectors
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
tri-train is a training platform for triathletes that syncs activities from Strava and Garmin and exposes them to Claude through a remote MCP server. Ask Claude how your last block went, why your run pace dropped, or whether you are fresh enough for Sunday's race, and it answers from your real data: activities with laps and grade-adjusted pace, weekly load and the performance management chart (CTL/ATL/TSB), sleep, HRV and resting heart rate, and your race calendar with predictions. Claude can also act: create and adjust planned workouts with structured intervals, push them to your Garmin watch, add races and write notes. Every change is journaled and can be undone. Read and write access are separate OAuth scopes, and the server enforces them on every call. Built and hosted in Switzerland by a triathlete; data stays on our own servers (Swiss revDSG / GDPR).
Connect Intervals.icu to Claude and ChatGPT: read training, plan workouts. Training never stored.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables Claude to access and analyze your Strava activities through OAuth authentication. Supports retrieving activity lists and detailed workout data for fitness tracking and analysis.2-
- 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.8MIT
- FlicenseAqualityDmaintenanceConnects Claude to your Strava account for analyzing training, predicting race times, and generating periodized training plans via natural language.13-
- AlicenseNot gradedqualityCmaintenanceConnects Claude to Strava data for natural language queries about rides, stats, and activities.8 npmMIT