MS

mountcrow/stravachat

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

5 stars 3 forks 品質 56 トレンド 13

MCP integration for Strava

概要

An MCP server that connects Claude to the Strava API — ask about your training data in natural language. StravaChat gives Claude direct access to your Strava account through 8 tools: "Show me my last 5 rides and compare average speed." "What was my heart rate zone distribution on yesterday's run?" "From my longterm Strava stats, what do you recommend me to improve my running performance?" 1. Go to strava.com/settings/api 2. Create an application (or use your existing one) 3. Set to localhost 4. Note your and Edit .env and fill in your Client ID and Client Secret: The token from the Strava settings page is often expired. Use the included helper to get a fresh one:

README

以下は原文 README の抜粋です。原文を見る。

StravaChat

An MCP server that connects Claude to the Strava API — ask about your training data in natural language.


What It Does

StravaChat gives Claude direct access to your Strava account through 8 tools:

Tool Description
get_athlete_profile Your profile — name, location, bio
get_athlete_stats Lifetime, YTD, and recent totals for run/ride/swim
list_activities Browse activities with pagination and date filters
get_activity Deep dive into a single activity (splits, segments, metrics)
get_activity_laps Lap-by-lap breakdown (pace, HR, distance)
get_activity_zones Time in each heart rate / power zone
list_routes Your saved routes
get_route Route details (distance, elevation, waypoints)

Example Prompts

“How far did I run this month?”

“Show me my last 5 rides and compare average speed.”

“What was my heart rate zone distribution on yesterday’s run?”

“From my longterm Strava stats, what do you recommend me to improve my running performance?”


Setup

Prerequisites

  • Node.js >= 18
  • A Strava account with API access
  • Claude Desktop or Claude Code

1. Clone and install

git clone  && cd stravachat
npm install

2. Create a Strava API application

  1. Go to strava.com/settings/api
  2. Create an application (or use your existing one)
  3. Set Authorization Callback Domain to localhost
  4. Note your Client ID and Client Secret

3. Configure credentials

cp .env.example .env

Edit .env and fill in your Client ID and Client Secret:

STRAVA_CLIENT_ID=12345
STRAVA_CLIENT_SECRET=abc123...
STRAVA_REFRESH_TOKEN=

4. Get a refresh token

The token from the Strava settings page is often expired. Use the included helper to get a fresh one:

npx tsx scripts/get-token.ts

This will:

  1. Print an authorization URL — open it in your browser
  2. You authorize the app on Strava
  3. The script prints a valid refresh token

Paste the token into your .env:

STRAVA_REFRESH_TOKEN=

5. Build

npm run build

6. Connect to Claude

Add to your Claude configuration:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "strava": {
      "command": "node",
      "args": ["/absolute/path/to/stravachat/dist/index.js"]
    }
  }
}

Claude Code (~/.claude.json):

{
  "mcpServers": {
    "strava": {
      "command": "node",
      "args": ["/absolute/path/to/stravachat/dist/index.js"]
    }
  }
}

Restart Claude. You’re ready to go.


Development

npm run dev      # Watch mode — recompiles on save
npm run build    # One-time build
npm start        # Run the server directly

Project Structure

src/
  index.ts            Entry point — server + stdio transport
GitHub で README 全文を見る

インストール

npx tsx scripts/get-token.ts
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "strava": { "command": "node", "args": ["/absolute/path/to/stravachat/dist/index.js"] } } }