
Strava Mcp
io.github.r-huijts由 GitHub 帳號 r-huijts 發布v1.0.1更新於 Oct 24, 2026
MCP server for accessing Strava API
概覽
將 AI 助理連接到 Strava 帳號,讀取活動、統計、區段和路線,並用自然語言回答訓練相關問題。
- 可以做什麼
- 連接、檢查並中斷 Strava 帳號,讀取個人資料、跑鞋和訓練區間。列出並依條件篩選活動,查看單一活動詳情、分段、心率資料流和照片。彙總年度與歷年統計及個人紀錄。尋找、收藏並查看區段及自己在區段上的成績。列出路線並匯出為 GPX 或 TCX 檔案,列出俱樂部,並把訓練計畫整理成 Zwift 檔案。
- 適用情境
- 適合想用對話方式查詢自己 Strava 歷史紀錄的跑者和自行車騎士,用來比較不同期間、拆解某次訓練,或把已儲存的路線匯出到 GPS 裝置。
- 執行需求
- 透過 npx 或全域 npm 安裝後在本機執行,需要 Node.js。需要一個免費的 Strava API 應用程式,其 Client ID 和 Client Secret 在瀏覽器設定頁填寫,或透過 STRAVA_CLIENT_ID、STRAVA_CLIENT_SECRET 和 STRAVA_ACCESS_TOKEN 提供。OAuth 回呼使用本機 8111 埠。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Strava Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Strava MCP Server
Talk to your Strava data using AI.
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."
[MseeP.ai Security Assessment Badge]
[Strava Server MCP server]What Can You Do With This?
Once connected, just talk to Claude like you're talking to a friend who has access to all your Strava data:
🏃 Track Your Progress
"How many kilometers did I run this month?"
"Compare my running stats from January to December"
"What's my longest ride ever?"
📊 Analyze Your Workouts
"Break down my last cycling workout - show me power, heart rate, and cadence"
"How did my heart rate zones look during yesterday's run?"
"What was my average pace for each lap in my interval training?"
🗺️ Explore Routes & Segments
"What are the most popular cycling segments near Central Park?"
"Show me my starred segments"
"Export my Sunday morning route as a GPX file"
🏆 Get Coaching Insights
"Analyze my training load this week"
"How does my current fitness compare to last month?"
"Give me a summary of my cycling performance this year"
Quick Start (3 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:
Step 1 (alternative): Add to Claude Code
You can add this MCP server to claude code with the following command:
You can confirm successful instalation as follows:
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.
Connecting Your Strava Account
First Time Setup
When you say "Connect my Strava account", here's what happens:
- A browser window opens showing a setup page
- Enter your Strava API credentials (Client ID and Client Secret)
- Click "Continue to Strava" - you'll be redirected to Strava
- Authorize the app on Strava's website
- See the success message - you can close the browser
- Done! Claude confirms you're connected
Your credentials are saved locally at ~/.config/strava-mcp/config.json and persist across sessions.
Getting Your Strava API Credentials
You need to create a free Strava API application (one-time setup):
- Go to strava.com/settings/api
- Click "Create an App" (or view your existing app)
- Fill in the form:
- Application Name: Anything you want (e.g., "My Claude Assistant")
- Category: Choose any
- Website: Can be anything (e.g.,
http://localhost) - Authorization Callback Domain: Must be
localhost
- Copy your Client ID and Client Secret
That's it! You only need to do this once.
Managing Your Connection
- Check status: "Am I connected to Strava?"
- Reconnect: "Connect my Strava account" (use
force: trueto reconnect) - Disconnect: "Disconnect my Strava account"
Installation Options
Option A: Just Use It (Recommended)
No installation needed! The npx command in the Quick Start automatically downloads and runs the latest version.
Option B: Install Globally
If you prefer to install it once:
Then update your Claude config to use:
Note: Even though the package name is @r-huijts/strava-mcp-server, the executable name remains strava-mcp-server for backward compatibility.
Option C: Build from Source
For developers who want to modify the code:
Then point Claude to your local build:
Example Conversations
Morning Check-in
You: What did I do for exercise this week?
Claude: Looking at your Strava activities this week, you completed:
- Monday: 5.2km run (28:15)
- Wednesday: 45km bike ride (1:32:00)
- Saturday: 10km run (52:30)
Total: 60.2km across 3 activities. Nice consistency!
Workout Analysis
You: Analyze my last cycling workout in detail
Claude: Here's a breakdown of your ride "Evening Loop" from yesterday:
Overview
- Distance: 42.3 km
- Time: 1:28:45
- Avg Speed: 28.6 km/h
Power Analysis
- Average Power: 185W
- Normalized Power: 198W
- Max Power: 520W
Heart Rate
- Average: 142 bpm
- Max: 175 bpm
- Time in Zone 4+: 23 minutes
Your power-to-heart-rate ratio suggests good aerobic efficiency...
Finding New Routes
You: Find me some challenging cycling climbs near Boulder, Colorado
Claude: Here are popular climbing segments near Boulder:
- Flagstaff Road - 5.2km, 6.8% avg grade
- Sunshine Canyon - 3.8km, 7.2% avg grade
- Left Hand Canyon - 8.1km, 4.5% avg grade
Want me to star any of these so you can find them easily later?
Available Tools
Account & Profile
Activities
Stats & Progress
Segments
Routes
Clubs
Workouts
Server
Troubleshooting
"Connect my Strava account" doesn't open a browser
- Make sure Claude Desktop is running the MCP server (check for errors in Claude)
- Try restarting Claude Desktop
- Check that port 8111 isn't blocked by a firewall
"Authentication failed" or "Invalid token"
- Your token may have expired - say "Connect my Strava account" to reconnect
- Make sure your Strava API application is still active at strava.com/settings/api
"Missing credentials" error
- You need to complete the OAuth flow - say "Connect my Strava account"
- If you're using environment variables, make sure all 4 are set (see Developer section)
Claude doesn't see the Strava tools
- Make sure your
claude_desktop_config.jsonis valid JSON (no trailing commas!) - Restart Claude Desktop after making config changes
- Check Claude's developer console for error messages
JSONRPC.ProtocolTransportError after package name change
If you're getting a JSONRPC error after updating to @r-huijts/strava-mcp-server:
- Clear npx cache: Run
rm -rf ~/.npm/_npxin terminal - Verify config uses
@r-huijts/strava-mcp-server(not the oldstrava-mcp-server) - Restart Claude Desktop completely (quit and reopen)
- Test manually: Run
npx -y @r-huijts/strava-mcp-server- you should see "Starting Strava MCP Server v1.2.1..."
For Developers
Click to expand technical details
Environment Variables
Instead of using the browser-based auth, you can set environment variables:
Token Refresh
The server automatically refreshes expired tokens. New tokens are saved to both process.env and ~/.config/strava-mcp/config.json.
Config Priority
- Environment variables (highest)
~/.config/strava-mcp/config.json- Local
.envfile
Building & Testing
Activity Streams Optimization
The get-activity-streams tool uses a compact format by default, reducing payload size by ~70-80% while preserving all data:
- Compact format (default): Raw arrays with metadata, ~70-80% smaller, ideal for LLM processing
- Verbose format: Human-readable objects with formatted values (backward compatible)
- Smart chunking: Large activities automatically split into ~50KB chunks
- Optional downsampling: Can reduce very large datasets while preserving key features
The compact format includes comprehensive metadata (units, descriptions, statistics) so LLMs can understand the raw numeric data.
API Reference
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.
Contributing
Contributions welcome! Please submit a Pull Request.
License
MIT License - see LICENSE file for details.
Questions? Open an issue on GitHub.
來源:README.md,提交 ac43cc7
工具
0版本歷史
1- v1.0.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分