Skip to content
Back to search

strava-mcp

A Model Context Protocol (MCP) server that connects to Strava API, providing tools to access Strava data through LLMs

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/r-huijts--strava-mcp/badge.svg)](/listings/r-huijts--strava-mcp)

HTML

<a href="/listings/r-huijts--strava-mcp"><img src="/api/listings/r-huijts--strava-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Step 1: Add to Claude Desktop

Open your Claude Desktop configuration file: - **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json` - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

Add this to the file:

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

Step 1 (alternative): Add to Claude Code

You can add this MCP server to claude code with the following command:

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

You can confirm successful instalation as follows:

% claude mcp list
Checking MCP server health...

strava: npx @r-huijts/strava-mcp-server - ✓ Connected

Step 2: Restart Claude Desktop

Close and reopen Claude Desktop to load the new configuration.

Step 3: Connect Your Strava

Just say to Claude:

> **"Connect my Strava account"**

A browser window will open. Enter your Strava API credentials, authorize the app, and you're done!

**That's it!** Start asking about your activities.

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 415 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Strava MCP Server
  2. **Talk to your Strava data using AI.**
  3. Connect Claude to your Strava account and ask questions in plain English: "How far did I run this month?", "Analyze my last ride", or "Show me my fastest segments."
  4. [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/r-huijts-strava-mcp-badge.png)](https://mseep.ai/app/r-huijts-strava-mcp)
  5. <a href="https://glama.ai/mcp/servers/@r-huijts/strava-mcp">
  6. <img width="380" height="200" src="https://glama.ai/mcp/servers/@r-huijts/strava-mcp/badge" alt="Strava Server MCP server" />
  7. </a>
  8. ---
  9. ## What Can You Do With This?
  10. Once connected, just talk to Claude like you're talking to a friend who has access to all your Strava data:
  11. ### 🏃 Track Your Progress
  12. > "How many kilometers did I run this month?"
  13. >
  14. > "Compare my running stats from January to December"
  15. >
  16. > "What's my longest ride ever?"
  17. ### 📊 Analyze Your Workouts
  18. > "Break down my last cycling workout - show me power, heart rate, and cadence"
  19. >
  20. > "How did my heart rate zones look during yesterday's run?"
  21. >
  22. > "What was my average pace for each lap in my interval training?"
  23. ### 🗺️ Explore Routes & Segments
  24. > "What are the most popular cycling segments near Central Park?"
  25. >
  26. > "Show me my starred segments"
  27. >
  28. > "Export my Sunday morning route as a GPX file"
  29. ### 🏆 Get Coaching Insights
  30. > "Analyze my training load this week"
  31. >
  32. > "How does my current fitness compare to last month?"
  33. >
  34. > "Give me a summary of my cycling performance this year"
  35. ---
  36. ## Quick Start (3 Steps)
  37. ### Step 1: Add to Claude Desktop
  38. Open your Claude Desktop configuration file:
  39. - **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json`
  40. - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
  41. Add this to the file:
  42. ```json
  43. {
  44. "mcpServers": {
  45. "strava": {
  46. "command": "npx",
  47. "args": ["-y", "@r-huijts/strava-mcp-server"]
  48. }
  49. }
  50. }
  51. ```
  52. ### Step 1 (alternative): Add to Claude Code
  53. You can add this MCP server to claude code with the following command:
  54. ```
  55. claude mcp add --transport stdio strava -- npx @r-huijts/strava-mcp-server
  56. ```
  57. You can confirm successful instalation as follows:
  58. ```
  59. % claude mcp list
  60. Checking MCP server health...
  61. strava: npx @r-huijts/strava-mcp-server - ✓ Connected
  62. ```
  63. ### Step 2: Restart Claude Desktop
  64. Close and reopen Claude Desktop to load the new configuration.
  65. ### Step 3: Connect Your Strava
  66. Just say to Claude:
  67. > **"Connect my Strava account"**
  68. A browser window will open. Enter your Strava API credentials, authorize the app, and you're done!
  69. **That's it!** Start asking about your activities.
  70. ---
  71. ## Connecting Your Strava Account
  72. ### First Time Setup
  73. When you say "Connect my Strava account", here's what happens:
  74. 1. **A browser window opens** showing a setup page
  75. 2. **Enter your Strava API credentials** (Client ID and Client Secret)
  76. 3. **Click "Continue to Strava"** - you'll be redirected to Strava
  77. 4. **Authorize the app** on Strava's website
  78. 5. **See the success message** - you can close the browser
  79. 6. **Done!** Claude confirms you're connected
  80. Your credentials are saved locally at `~/.config/strava-mcp/config.json` and persist across sessions.
  81. ### Getting Your Strava API Credentials
  82. You need to create a free Strava API application (one-time setup):
  83. 1. Go to [strava.com/settings/api](https://www.strava.com/settings/api)
  84. 2. Click "Create an App" (or view your existing app)
  85. 3. Fill in the form:
  86. - **Application Name**: Anything you want (e.g., "My Claude Assistant")
  87. - **Category**: Choose any
  88. - **Website**: Can be anything (e.g., `http://localhost`)
  89. - **Authorization Callback Domain**: Must be `localhost`
  90. 4. Copy your **Client ID** and **Client Secret**
  91. That's it! You only need to do this once.
  92. ### Managing Your Connection
  93. - **Check status**: "Am I connected to Strava?"
  94. - **Reconnect**: "Connect my Strava account" (use `force: true` to reconnect)
  95. - **Disconnect**: "Disconnect my Strava account"
  96. ---
  97. ## Installation Options
  98. ### Option A: Just Use It (Recommended)
  99. No installation needed! The `npx` command in the Quick Start automatically downloads and runs the latest version.
  100. ### Option B: Install Globally
  101. If you prefer to install it once:
  102. ```bash
  103. npm install -g @r-huijts/strava-mcp-server
  104. ```
  105. Then update your Claude config to use:
  106. ```json
  107. {
  108. "mcpServers": {
  109. "strava": {
  110. "command": "strava-mcp-server"
  111. }
  112. }
  113. }
  114. ```
  115. **Note:** Even though the package name is `@r-huijts/strava-mcp-server`, the executable name remains `strava-mcp-server` for backward compatibility.
  116. ### Option C: Build from Source
  117. For developers who want to modify the code:
  118. ```bash
  119. git clone https://github.com/r-huijts/strava-mcp.git
  120. cd strava-mcp
  121. npm install
  122. npm run build
  123. ```
  124. Then point Claude to your local build:
  125. ```json
  126. {
  127. "mcpServers": {
  128. "strava": {
  129. "command": "node",
  130. "args": ["/path/to/strava-mcp/dist/server.js"]
  131. }
  132. }
  133. }
  134. ```
  135. ---
  136. ## Example Conversations
  137. ### Morning Check-in
  138. > **You**: What did I do for exercise this week?
  139. >
  140. > **Claude**: Looking at your Strava activities this week, you completed:
  141. > - Monday: 5.2km run (28:15)
  142. > - Wednesday: 45km bike ride (1:32:00)
  143. > - Saturday: 10km run (52:30)
  144. >
  145. > Total: 60.2km across 3 activities. Nice consistency!
  146. ### Workout Analysis
  147. > **You**: Analyze my last cycling workout in detail
  148. >
  149. > **Claude**: Here's a breakdown of your ride "Evening Loop" from yesterday:
  150. >
  151. > **Overview**
  152. > - Distance: 42.3 km
  153. > - Time: 1:28:45
  154. > - Avg Speed: 28.6 km/h
  155. >
  156. > **Power Analysis**
  157. > - Average Power: 185W
  158. > - Normalized Power: 198W
  159. > - Max Power: 520W
  160. >
  161. > **Heart Rate**
  162. > - Average: 142 bpm
  163. > - Max: 175 bpm
  164. > - Time in Zone 4+: 23 minutes
  165. >
  166. > Your power-to-heart-rate ratio suggests good aerobic efficiency...
  167. ### Finding New Routes
  168. > **You**: Find me some challenging cycling climbs near Boulder, Colorado
  169. >
  170. > **Claude**: Here are popular climbing segments near Boulder:
  171. >
  172. > 1. **Flagstaff Road** - 5.2km, 6.8% avg grade
  173. > 2. **Sunshine Canyon** - 3.8km, 7.2% avg grade
  174. > 3. **Left Hand Canyon** - 8.1km, 4.5% avg grade
  175. >
  176. > Want me to star any of these so you can find them easily later?
  177. ---
  178. ## Available Tools
  179. ### Account & Profile
  180. | What you can ask | What it does |
  181. |------------------|--------------|
  182. | "Connect my Strava account" | Links your Strava to Claude |
  183. | "Check my Strava connection" | Shows connection status |
  184. | "Disconnect my Strava account" | Unlinks Strava and clears stored tokens |
  185. | "Get my Strava profile" | Shows your profile info |
  186. | "What shoes do I have?" | Lists your shoes and usage distance |
  187. | "What are my training zones?" | Shows HR and power zones |
  188. ### Activities
  189. | What you can ask | What it does |
  190. |------------------|--------------|
  191. | "Show my recent activities" | Lists your latest workouts |
  192. | "Get all my runs from January" | Fetches activities with filters |
  193. | "Analyze activity 12345" | Detailed info about one activity |
  194. | "Show the laps from my last run" | Lap-by-lap breakdown |
  195. | "Get heart rate data from my ride" | Time-series workout data (optimized compact format) |
  196. | "Show photos from my hike" | Activity photos |
  197. ### Stats & Progress
  198. | What you can ask | What it does |
  199. |------------------|--------------|
  200. | "What are my running stats?" | YTD and all-time totals |
  201. | "How far have I cycled this year?" | Activity totals by type |
  202. | "What's my longest ride?" | Personal records |
  203. ### Segments
  204. | What you can ask | What it does |
  205. |------------------|--------------|
  206. | "Show my starred segments" | Your favorite segments |
  207. | "Find segments near [location]" | Discover popular segments |
  208. | "Get details on segment 12345" | Segment info and leaderboard |
  209. | "Star this segment" | Save to favorites |
  210. | "Show my efforts on [segment]" | Your attempts on a segment |
  211. ### Routes
  212. | What you can ask | What it does |
  213. |------------------|--------------|
  214. | "List my saved routes" | Your created routes |
  215. | "Get details for my [route name]" | Route info |
  216. | "Export [route] as GPX" | Download for GPS devices |
  217. | "Export [route] as TCX" | Download for GPS devices |
  218. ### Clubs
  219. | What you can ask | What it does |
  220. |------------------|--------------|
  221. | "What clubs am I in?" | Lists your Strava clubs |
  222. ### Workouts
  223. | What you can ask | What it does |
  224. |------------------|--------------|
  225. | "Turn this workout into a Zwift file" | Formats a workout plan into a structured file (currently Zwift `.zwo`) |
  226. ### Server
  227. | What you can ask | What it does |
  228. |------------------|--------------|
  229. | "What version is the Strava server?" | Shows the MCP server version and metadata |
  230. ---
  231. ## Troubleshooting
  232. ### "Connect my Strava account" doesn't open a browser
  233. - Make sure Claude Desktop is running the MCP server (check for errors in Claude)
  234. - Try restarting Claude Desktop
  235. - Check that port 8111 isn't blocked by a firewall
  236. ### "Authentication failed" or "Invalid token"
  237. - Your token may have expired - say "Connect my Strava account" to reconnect
  238. - Make sure your Strava API application is still active at [strava.com/settings/api](https://www.strava.com/settings/api)
  239. ### "Missing credentials" error
  240. - You need to complete the OAuth flow - say "Connect my Strava account"
  241. - If you're using environment variables, make sure all 4 are set (see Developer section)
  242. ### Claude doesn't see the Strava tools
  243. - Make sure your `claude_desktop_config.json` is valid JSON (no trailing commas!)
  244. - Restart Claude Desktop after making config changes
  245. - Check Claude's developer console for error messages
  246. ### JSONRPC.ProtocolTransportError after package name change
  247. If you're getting a JSONRPC error after updating to `@r-huijts/strava-mcp-server`:
  248. 1. **Clear npx cache**: Run `rm -rf ~/.npm/_npx` in terminal
  249. 2. **Verify config** uses `@r-huijts/strava-mcp-server` (not the old `strava-mcp-server`)
  250. 3. **Restart Claude Desktop** completely (quit and reopen)
  251. 4. **Test manually**: Run `npx -y @r-huijts/strava-mcp-server` - you should see "Starting Strava MCP Server v1.2.1..."
  252. ---
  253. ## For Developers
  254. <details>
  255. <summary>Click to expand technical details</summary>
  256. ### Environment Variables
  257. Instead of using the browser-based auth, you can set environment variables:
  258. | Variable | Description |
  259. |----------|-------------|
  260. | `STRAVA_CLIENT_ID` | Your Strava Application Client ID |
  261. | `STRAVA_CLIENT_SECRET` | Your Strava Application Client Secret |
  262. | `STRAVA_ACCESS_TOKEN` | OAuth access token |
  263. | `STRAVA_REFRESH_TOKEN` | OAuth refresh token |
  264. | `ROUTE_EXPORT_PATH` | Directory for GPX/TCX exports |
  265. ### Token Refresh
  266. The server automatically refreshes expired tokens. New tokens are saved to both `process.env` and `~/.config/strava-mcp/config.json`.
  267. ### Config Priority
  268. 1. Environment variables (highest)
  269. 2. `~/.config/strava-mcp/config.json`
  270. 3. Local `.env` file
  271. ### Building & Testing
  272. ```bash
  273. npm install
  274. npm run build
  275. npm test
  276. ```
  277. ### Activity Streams Optimization
  278. The `get-activity-streams` tool uses a compact format by default, reducing payload size by ~70-80% while preserving all data:
  279. - **Compact format** (default): Raw arrays with metadata, ~70-80% smaller, ideal for LLM processing
  280. - **Verbose format**: Human-readable objects with formatted values (backward compatible)
  281. - **Smart chunking**: Large activities automatically split into ~50KB chunks
  282. - **Optional downsampling**: Can reduce very large datasets while preserving key features
  283. The compact format includes comprehensive metadata (units, descriptions, statistics) so LLMs can understand the raw numeric data.
  284. ### API Reference
  285. The server implements the Model Context Protocol (MCP) and exposes 25 tools for Strava API v3. See the source code in `src/tools/` for implementation details.
  286. ### Contributing
  287. Contributions welcome! Please submit a Pull Request.
  288. </details>
  289. ---
  290. ## License
  291. MIT License - see LICENSE file for details.
  292. ---
  293. **Questions?** Open an issue on [GitHub](https://github.com/r-huijts/strava-mcp/issues).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.