io.github.r-huijts/strava-mcp

平台与服务

by r-huijts

用于访问 Strava API 的 MCP server,便于在智能体或工作流中读取运动与活动数据。

把 Strava 运动与活动数据无缝接入智能体和工作流,省去手写 API 对接成本,MCP 形态让健身数据调用更顺手。

什么是 io.github.r-huijts/strava-mcp

用于访问 Strava API 的 MCP server,便于在智能体或工作流中读取运动与活动数据。

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

<a href="https://glama.ai/mcp/servers/@r-huijts/strava-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@r-huijts/strava-mcp/badge" alt="Strava Server MCP server" /> </a>

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:

json
{
  "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:

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

You can confirm successful instalation as follows:

code
% 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.


Connecting Your Strava Account

First Time Setup

When you say "Connect my Strava account", here's what happens:

  1. A browser window opens showing a setup page
  2. Enter your Strava API credentials (Client ID and Client Secret)
  3. Click "Continue to Strava" - you'll be redirected to Strava
  4. Authorize the app on Strava's website
  5. See the success message - you can close the browser
  6. 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):

  1. Go to strava.com/settings/api
  2. Click "Create an App" (or view your existing app)
  3. 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
  4. 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: true to 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:

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

Then update your Claude config to use:

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

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:

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

Then point Claude to your local build:

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

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:

  1. Flagstaff Road - 5.2km, 6.8% avg grade
  2. Sunshine Canyon - 3.8km, 7.2% avg grade
  3. 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

What you can askWhat it does
"Connect my Strava account"Links your Strava to Claude
"Check my Strava connection"Shows connection status
"Get my Strava profile"Shows your profile info
"What shoes do I have?"Lists your shoes and usage distance
"What are my training zones?"Shows HR and power zones

Activities

What you can askWhat it does
"Show my recent activities"Lists your latest workouts
"Get all my runs from January"Fetches activities with filters
"Analyze activity 12345"Detailed info about one activity
"Show the laps from my last run"Lap-by-lap breakdown
"Get heart rate data from my ride"Time-series workout data (optimized compact format)
"Show photos from my hike"Activity photos

Stats & Progress

What you can askWhat it does
"What are my running stats?"YTD and all-time totals
"How far have I cycled this year?"Activity totals by type
"What's my longest ride?"Personal records

Segments

What you can askWhat it does
"Show my starred segments"Your favorite segments
"Find segments near [location]"Discover popular segments
"Get details on segment 12345"Segment info and leaderboard
"Star this segment"Save to favorites
"Show my efforts on [segment]"Your attempts on a segment

Routes

What you can askWhat it does
"List my saved routes"Your created routes
"Get details for my [route name]"Route info
"Export [route] as GPX"Download for GPS devices
"Export [route] as TCX"Download for GPS devices

Clubs

What you can askWhat it does
"What clubs am I in?"Lists your Strava clubs

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.json is 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:

  1. Clear npx cache: Run rm -rf ~/.npm/_npx in terminal
  2. Verify config uses @r-huijts/strava-mcp-server (not the old strava-mcp-server)
  3. Restart Claude Desktop completely (quit and reopen)
  4. Test manually: Run npx -y @r-huijts/strava-mcp-server - you should see "Starting Strava MCP Server v1.2.1..."

For Developers

<details> <summary>Click to expand technical details</summary>

Environment Variables

Instead of using the browser-based auth, you can set environment variables:

VariableDescription
STRAVA_CLIENT_IDYour Strava Application Client ID
STRAVA_CLIENT_SECRETYour Strava Application Client Secret
STRAVA_ACCESS_TOKENOAuth access token
STRAVA_REFRESH_TOKENOAuth refresh token
ROUTE_EXPORT_PATHDirectory for GPX/TCX exports

Token Refresh

The server automatically refreshes expired tokens. New tokens are saved to both process.env and ~/.config/strava-mcp/config.json.

Config Priority

  1. Environment variables (highest)
  2. ~/.config/strava-mcp/config.json
  3. Local .env file

Building & Testing

bash
npm install
npm run build
npm test

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.

</details>

License

MIT License - see LICENSE file for details.


Questions? Open an issue on GitHub.

常见问题

io.github.r-huijts/strava-mcp 是什么?

用于访问 Strava API 的 MCP server,便于在智能体或工作流中读取运动与活动数据。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描149.6k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描149.6k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描17.9k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
87.1k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
79.1k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
63.2k

评论