Strava MCP Server
Strava MCPサーバー
ClaudeをStravaアカウントに接続するためのModel Context Protocol (MCP) サーバーです。Claudeに自然言語で話しかけるだけで、トレーニングの分析、レースタイムの予測、トレーニング負荷の計算、または完全なピリオダイゼーション(期分け)トレーニング計画の生成が可能です。
機能
5つのカテゴリ(認証、アクティビティ、分析、予測、計画)にわたる13のツール
自動ローカルコールバックサーバーを備えたOAuth2フロー — 手動でのコードコピーは不要
VDOTベースのトレーニングペース(ジャック・ダニエルズのランニング・フォーミュラ)
CTL/ATL/TSBトレーニング負荷メトリクス(慢性/急性トレーニング負荷、トレーニングストレスバランス)
Riegelの式によるレースタイム予測
レース特有のロジックを組み込んだ完全なピリオダイゼーション(ベース → ビルド → ピーク → テーパー)トレーニング計画
Related MCP server: Strava MCP Server
要件
Node.js ≥ 18
Stravaアカウント
Claude Desktop(またはMCP互換クライアント)
セットアップ
1. Strava APIアプリケーションの作成
strava.com/settings/api にアクセスし、アプリケーションを作成します。
Authorization Callback Domain:
localhost
Client ID と Client Secret を控えておいてください。
2. 環境変数の設定
cp .env.example .env.env を編集します:
STRAVA_CLIENT_ID=your_client_id
STRAVA_CLIENT_SECRET=your_client_secret
STRAVA_REDIRECT_URI=http://localhost:8080/callback
TOKENS_FILE_PATH=./tokens.json3. ビルド
npm install
npm run build4. Claude Desktopの設定
%APPDATA%\Claude\claude_desktop_config.json (Windows) または ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) を編集します:
{
"mcpServers": {
"strava": {
"command": "node",
"args": ["C:/path/to/McpStrava/dist/index.js"],
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"TOKENS_FILE_PATH": "C:/path/to/McpStrava/tokens.json"
}
}
}
}
.envファイルまたはClaude Desktop設定内のenvブロックのどちらでも使用可能です。
5. 認証
Claude Desktopを再起動し、会話の中で以下を行います:
strava_get_auth_urlを呼び出す — ClaudeがURLを返しますブラウザでそのURLを開き、Stravaでアプリを承認します
ページに "✓ Authentification réussie !" と表示され、トークンが自動的に保存されます
利用可能なツール
認証
ツール | 説明 |
| OAuth2 URLを生成し、ローカルコールバックサーバーを開始します |
| 手動フォールバック:認証コードをトークンと交換します |
| トークンが有効かどうか、および有効期限を確認します |
アクティビティ
ツール | 説明 |
| 最近のアクティビティ(ラン、ライド、ウォーク、すべて)を距離、ペース、心拍数とともに一覧表示します |
| アクティビティの詳細:kmごとのスプリット、ラップ、消費カロリー |
| Stravaのグローバル統計:今週、今年、全期間 |
分析
ツール | 説明 |
| 週ごとのボリューム内訳と一貫性スコア |
| TRIMPによるCTL(フィットネス)/ ATL(疲労)/ TSB(フレッシュネス) |
| 6つのペースゾーンにわたる分布、80/20ルールのチェック |
予測
ツール | 説明 |
| 基準となる記録からRiegelの式を用いて完走タイムを予測します |
| レース結果からVDOTスコアと5つのトレーニングペースゾーンを計算します |
トレーニング計画
ツール | 説明 |
| 今日からレース当日までの完全なピリオダイゼーション計画(ベース/ビルド/ピーク/テーパー) |
| 指定したフェーズの来週分のセッションのみを生成します |
トレーニング計画の詳細
フェーズ
フェーズ | 焦点 | 強度 |
ベース | 有酸素運動の基礎 | イージーラン、ロングラン、ストライド |
ビルド | 乳酸閾値 | テンポ走、イージーミディアム、ロングラン |
ピーク | VO2max + レース特化 | インターバル、テンポ走、ロングラン |
テーパー | フレッシュネス | ボリュームの削減、質の維持 |
ボリュームの計算方法
開始ボリューム — 過去4週間の平均kmとCTLから導き出された週次km推定値のブレンド(怪我による中断にも対応)
ピークボリューム — 現在の1.4倍。レースごとの最低基準あり(5K: 40km, 10K: 50km, ハーフ: 60km, マラソン: 80km)
週次進行 — 怪我を防ぐため、週あたり最大+10%に制限
回復週 — 各フェーズ内の4週目ごとに自動設定(ボリューム × 0.8)
レース特有のロジック
マラソン (ビルド & ピーク): ロングランにはマラソンペース区間を含む(ランの約45%をレースペースで実施)
テーパーの深さ: 5Kはピークボリュームの80%まで、マラソンは40%までテーパー — 短いレースほど回復の必要性が低い
インターバル: 5K/10Kは 6 × 1000m、ハーフ/マラソンは 5 × 1000m
VDOTとペースゾーン
ジャック・ダニエルズのランニング・フォーミュラに基づいています。ゾーンはVDOTの割合として計算されます:
ゾーン | VDOTの割合 | 用途 |
イージー | 65% | 日々のラン、ロングラン |
マラソン | 80% | マラソンペース区間 |
閾値 | 86% | テンポ走 |
インターバル | 98% | VO2maxインターバル |
レペティション | 105% | スピード練習 / ストライド |
友人向けの計画生成(手動モード)
strava_generate_training_plan は、Stravaを完全にバイパスする手動モードをサポートしています。current_weekly_km と goal_time を同時に渡すことで、Stravaアカウントなしで計画を生成できます。自身のClaude Desktopから友人の計画を作成するのに便利です。
必須パラメータ
パラメータ | 説明 | 例 |
| レース距離 |
|
| レース日 (YYYY-MM-DD) |
|
| 目標完走タイム |
|
| 現在の週次走行距離 |
|
プロンプト例
Génère un plan marathon pour mon ami, il court 55km par semaine et vise 3h45, la course est le 18 octobre 2026Mon amie veut courir un semi-marathon en 1h50 le 2026-09-14, elle fait environ 40km par semainecurrent_weekly_km と goal_time の両方が提供されると、ツールはすべてのStrava API呼び出しをスキップします。レスポンス内の resume には、どのモードが使用されたかを確認するために source_volume: "Fourni manuellement" が含まれます。
モード比較
Stravaモード | 手動モード | |
Stravaアカウントが必要 | はい | いいえ |
ボリュームの調整 | 4週平均 + CTL | 提供された値 |
VDOT推定 | 最近のアクティビティまたは |
|
ユースケース | 自分自身のトレーニング | Stravaを使用していない友人/アスリート |
開発
# Watch mode (no build step needed)
npm run dev
# Build TypeScript
npm run build
# Run built server
npm start
# Clean build artifacts
npm run cleanプロジェクト構造
src/
├── index.ts # MCP server entry point
├── config.ts # Env vars, Strava constants, race distances
├── types.ts # Shared TypeScript interfaces
├── auth/
│ ├── oauth.ts # OAuth2 URL builder, token exchange
│ ├── tokenStore.ts # Load/save tokens.json, expiry check
│ ├── callbackServer.ts # Local HTTP server for OAuth redirect
│ └── authTools.ts # MCP auth tools
├── strava/
│ ├── client.ts # Axios instance with auto token refresh
│ ├── activities.ts # Strava activities API
│ ├── athlete.ts # Strava athlete/stats API
│ └── activityTools.ts # MCP activity tools
├── analytics/
│ ├── metrics.ts # Weekly stats, pace zones, consistency score
│ ├── trainingLoad.ts # TRIMP, CTL/ATL/TSB computation
│ └── analysisTools.ts # MCP analysis tools
├── prediction/
│ ├── riegel.ts # Riegel race time prediction formula
│ ├── vdot.ts # VDOT computation, training paces, race equivalents
│ └── predictionTools.ts # MCP prediction tools
└── planning/
├── workouts.ts # Workout templates and distance bounds
├── plan.ts # Plan generation, phase allocation, VDOT estimation
└── planTools.ts # MCP planning toolsトークン
tokens.json はStravaのアクセストークンとリフレッシュトークンを保存します。これは .gitignore に含まれているため、絶対にコミットしないでください。トークンは期限切れになると自動的に更新されます(Stravaのアクセストークンの有効期限は6時間です)。
プロンプト例
Stravaモード(自分のアカウント)
Analyse mes 8 dernières semaines d'entraînementQuelle serait mon heure sur un marathon si je cours un 10K en 45min ?Génère-moi un plan d'entraînement pour un semi-marathon le 2026-09-20Calcule ma charge d'entraînement actuelle et dis-moi si je suis en forme pour une course ce week-endMontre-moi la répartition de mes allures sur les 4 dernières semaines手動モード(友人 / Stravaなし)
Génère un plan marathon pour mon ami, il court 55km par semaine et vise 3h45, la course est le 18 octobre 2026Mon amie veut courir un semi-marathon en 1h50 le 14 septembre 2026, elle fait 40km par semaineライセンス
MIT
Available Tools
13 toolsstrava_analyze_trainingAnalyser l'entraînementA
Analyse la charge d'entraînement récente : volume hebdomadaire (km, temps, sorties), longue sortie, allure moyenne par semaine, score de régularité.
Inputs: weeks.
strava_athlete_statsStatistiques de l'athlèteA
Récupère les statistiques globales Strava : kilomètres cette semaine, ce mois, cette année, et all-time.
Inputs: no named parameters.
strava_auth_statusVérifier le statut d'authentificationA
Vérifie si des tokens Strava valides existent et quand ils expirent.
Inputs: no named parameters.
strava_exchange_tokenÉchanger le code d'autorisation contre des tokensA
Échange le code OAuth2 (depuis l'URL de redirection après autorisation dans le navigateur) contre des tokens d'accès et de rafraîchissement. Les tokens sont sauvegardés localement.
Inputs: code (required).
strava_generate_training_planGénérer un plan d'entraînement personnaliséA
Génère un plan d'entraînement structuré depuis aujourd'hui jusqu'au jour de la course, en 4 phases : Base (fondation aérobie), Build (développement du seuil), Peak (VO2max et spécifique course), Taper (affûtage). Mode Strava : calibre automatiquement le volume et le VDOT depuis l'historique. Mode manuel : passer current_weekly_km + goal_time pour générer un plan sans compte Strava.
Inputs: target_race (required), race_date (required), goal_time, current_weekly_km, +1 more.
strava_get_activitiesRécupérer les activités StravaA
Récupère la liste des activités récentes de l'athlète avec distance, temps, allure et fréquence cardiaque.
Inputs: days, activity_type, max_results.
strava_get_activity_detailDétail d'une activitéB
Récupère le détail complet d'une activité Strava (laps, splits kilomètre par kilomètre, calories).
Inputs: activity_id (required).
strava_get_auth_urlObtenir l'URL d'autorisation StravaA
Génère l'URL OAuth2 Strava. Ouvrir cette URL dans un navigateur, autoriser l'application, puis copier le paramètre 'code' depuis l'URL de redirection et le passer à strava_exchange_token.
Inputs: no named parameters.
strava_pace_zonesDistribution des zones d'allureA
Analyse la répartition des kilomètres par zone d'allure (Récupération, Facile, Aérobie, Seuil, VO2max, Anaérobie). Aide à vérifier la règle 80/20 (80% en zones basses).
Inputs: weeks, threshold_pace_min_km.
strava_predict_race_timePrédire les temps de course (formule Riegel)A
Prédit les temps sur les distances standard (5K, 10K, Semi, Marathon) en utilisant la formule de Riegel (T2 = T1 × (D2/D1)^1.06) depuis une performance récente. Auto-détecte la meilleure performance récente sur Strava, ou accepte une entrée manuelle.
Inputs: known_distance_m, known_time, target_distances, days_lookback.
strava_training_loadCalculer la charge d'entraînement (CTL/ATL/TSB)A
Calcule les métriques de forme, fatigue et fraîcheur via des moyennes exponentielles. CTL (fitness chronique, 42j) / ATL (fatigue aiguë, 7j) / TSB = CTL - ATL (fraîcheur). TSB > +10 = frais pour une course ; TSB < -20 = surcharge.
Inputs: days, hr_rest, hr_max, show_daily.
strava_vdotCalculer VDOT et allures d'entraînementA
Calcule ton score VDOT (indice de capacité aérobie de Jack Daniels) depuis une performance récente. Retourne : score VDOT, 5 zones d'allure d'entraînement (Facile, Marathon, Seuil, Intervalle, Répétition), et les équivalents de temps sur toutes les distances standard.
Inputs: distance_m (required), time (required).
strava_weekly_workoutGénérer les séances de la semaine prochaineA
Génère uniquement les séances d'entraînement de la semaine prochaine, basées sur le VDOT et le volume actuel. Plus léger que le plan complet.
Inputs: vdot, weekly_km, phase, target_race, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools target distinct aspects of training analysis (load, pace zones, VDOT, weekly plan), but some overlap exists between race time prediction tools (predict_race_time and vdot both estimate race times, though from different formulas). Descriptions help differentiate, but potential confusion remains.
All tools start with 'strava_' and use snake_case, but there is inconsistency in verb-noun order: some start with a verb (strava_analyze_training, strava_get_activities) and others with a noun (strava_athlete_stats, strava_pace_zones). This mixed pattern reduces predictability.
13 tools is a well-scoped set for a training analysis server. It covers authentication, activity retrieval, multiple analysis dimensions, and plan generation without being overwhelming.
The tool set provides comprehensive coverage of training analysis (load, pace, VDOT, race prediction, plan generation) and basic activity retrieval. Minor gaps exist, such as no tool to fetch or modify generated training plans, but core workflows are supported.
Related MCP Connectors
Connect Intervals.icu to Claude and ChatGPT: read training, plan workouts. Training never stored.
tri-train is a training platform for triathletes that syncs activities from Strava and Garmin and exposes them to Claude through a remote MCP server. Ask Claude how your last block went, why your run pace dropped, or whether you are fresh enough for Sunday's race, and it answers from your real data: activities with laps and grade-adjusted pace, weekly load and the performance management chart (CTL/ATL/TSB), sleep, HRV and resting heart rate, and your race calendar with predictions. Claude can also act: create and adjust planned workouts with structured intervals, push them to your Garmin watch, add races and write notes. Every change is journaled and can be undone. Read and write access are separate OAuth scopes, and the server enforces them on every call. Built and hosted in Switzerland by a triathlete; data stays on our own servers (Swiss revDSG / GDPR).
Turn Claude or ChatGPT into a cycling coach that plans your week, grades it, and adapts. Free beta.
Pace is a remote MCP server that exposes wearable and fitness data to Claude via the Model Context Protocol. It connects to Garmin, Oura, Whoop, Polar, Fitbit and 20+ devices and provides 15 tools for querying sleep, activity, recovery, and training data. Hosted on Google Cloud Run, OAuth 2.1 authentication, Streamable HTTP transport. Instructions: First you need to create an account at: https://pacetraining.co and connect your wearables. After that you can connect the remote Server via Custom Connector in Claude and OAuth 2.1 Flow startet.
Related MCP Servers
- AlicenseBqualityDmaintenanceConnects Claude to the Strava API to provide direct access to fitness data, including athlete statistics, detailed activity logs, and time-series performance metrics. It enables users to analyze training progress, compare workouts, and retrieve specific segment details through natural language queries.8MIT
- AlicenseNot gradedqualityCmaintenanceConnects Claude to Strava data for natural language queries about rides, stats, and activities.8 npmMIT
- AlicenseAqualityDmaintenanceConnects Claude to your Strava account so you can query your activities, stats, routes, and segments using natural language.2721 npm1MIT
- AlicenseAqualityDmaintenanceConnects Strava training data to Claude, enabling personalized coaching through analysis of training load, workout planning, gear maintenance, and power metrics.1064 PyPI1MIT