ST

Strava MCP Server: Activity Data, Profiles, Routes

Connect Strava via MCP server to access activities, athlete profiles, segments, and routes for fitness tracking and analysis with Claude.

Quick Install
npx -y @r-huijts/strava-mcp

Overview

This MCP (Model Context Protocol) server exposes your Strava data to Claude (or other MCP-compatible assistants) so you can query and analyze workouts in plain English. Once connected, the server fetches activities, athlete profiles, segments, and route data from the Strava API, persists tokens locally, and serves structured activity summaries, time-series (heart rate, power, cadence), segment leaderboards, and GPX exports for further analysis.

It is intended for developers and power users who want conversational access to personal fitness data for tracking, analytics, or integration into workflows. The server runs locally (or as an installed package) and uses your Strava API credentials; nothing is sent to third-party services outside the normal Strava authorization flow.

Features

  • Authenticate with Strava (OAuth) and persist credentials locally
  • Access activity lists and detailed activity telemetry (HR, power, cadence, laps)
  • Fetch athlete profile and historical statistics (monthly/yearly aggregations)
  • Query segments: starred segments, nearby popular segments, segment efforts
  • Retrieve and export routes/activities as GPX files
  • Analyze workouts: averages, normalized power, heart-rate zones, lap pacing
  • Compare periods (e.g., month-to-month) and compute training load summaries
  • Multiple installation modes: run via npx, install globally, or build from source

Installation / Configuration

Quick (recommended): run from npx without installing globally.

Claude Desktop configuration (add to claude_desktop_config.json):

{
  "mcpServers": {
    "strava": {
      "command": "npx",
      "args": ["-y", "@r-huijts/strava-mcp-server"]
    }
  }
}

Add via Claude CLI:

claude mcp add --transport stdio strava -- npx @r-huijts/strava-mcp-server

Confirm the server is listed:

claude mcp list
# Output: strava: npx @r-huijts/strava-mcp-server - ✓ Connected

Global install:

npm install -g @r-huijts/strava-mcp-server

Then configure Claude to run the executable:

{
  "mcpServers": {
    "strava": {
      "command": "strava-mcp-server"
    }
  }
}

Build from source:

git clone https://github.com/r-huijts/strava-mcp.git
cd strava-mcp
npm install
npm run build

Point Claude at the built server:

{
  "mcpServers": {
    "strava": {
      "command": "node",
      "args": ["/path/to/strava-mcp/dist/server.js"]
    }
  }
}

Strava API credentials

  1. Create a Strava API app at https://www.strava.com/settings/api
  2. Set Authorization Callback Domain to: localhost
  3. Note the Client ID and Client Secret

When you first connect (triggered by “Connect my Strava account”), a browser window opens to perform OAuth. The server stores credentials locally at:

  • Linux/macOS: ~/.config/strava-mcp/config.json
  • Windows: %APPDATA%\strava-mcp\config.json

Available Resources

ResourceWhat it providesExample natural language query
ActivitiesList, timestamps, distance, time, splits, telemetry“Show my runs from the last 30 days”
Athlete profileName, activity totals, zones, recent form“What’s my current FTP estimate and monthly totals?”
Activity detailsHR/power/cadence time-series, laps“Analyze my last ride: power, HR zones, and sprints”
SegmentsStarred segments, nearby popular segments, efforts“Show my fastest efforts on my starred segments”
Routes & GPXSaved routes; export GPX for an activity or route“Export my Sunday route to GPX”
Comparisons & summariesPeriod comparisons, weekly training load“Compare my running distance this January vs December”

Use Cases

  • Quick weekly summary: “What did I do for exercise this week?” — returns a list of activities, totals, and a short summary.
  • Workout deep-dive: “Analyze my last cycling workout” — returns distance, time, avg/max power, normalized power, HR zones, and lap-by-lap pace.
  • Segment discovery: “Find popular climbing segments near Boulder” — lists nearby segments with length and average grade (based on Strava data).
  • Export for mapping: “Give me a GPX for my 2025-03-07 ride” — outputs a GPX file for download or subsequent processing.
  • Coaching insight: “How does my training load this week compare to last month?” — provides aggregate load metrics and trend observations.

Examples and CLI snippets

Connecting flow (user-facing):

  • Say to Claude: “Connect my Strava account” — OAuth flow begins in your browser.
  • To disconnect: ask “Disconnect my Strava account” or manage saved config file.

Sample user prompts that produce structured responses:

  • “How many kilometers did I run this month?”
  • “Break down my last run by lap pace and heart rate zones”
  • “Show my starred segments and my PRs on them”
  • Source code and issues: https://github.com/r-huijts/strava-mcp
  • Strava API docs: https://developers.strava.com/docs/
  • Local config file: ~/.config/strava-mcp/config.json (tokens are persisted locally)

Notes

  • The server runs locally and requires valid Strava API credentials and an OAuth authorization step.
  • Stored credentials are local; treat the config file as sensitive and protect filesystem access.