
tomekkorbak/strava-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Strava API の統合のための MCP サーバー
概要
Strava API へのアクセスを提供するモデルコンテキストプロトコル(MCP)サーバー。 これにより、言語モデルは、Strava API からアクティビティデータを照会することができます。 - get activities(limit:int = 10): 認証されたアスリートの最近の活動 - get activities by date range(start date: str, end date: str, limit: int = 30): 特定の日付範囲内のアクティビティを取得する - get active by id(active id: int): 特定のアクティビティに関する詳細情報を入手 - get recent activities(days: int = 7, limit: int = 10): 過去のX日からの活動を得る ISO 形式 (YYY-MM-DD) で指定します。 サーバは、一貫したフィールド名と単位でアクティビティデータを返します。 このサーバーを使用するには、 Strava API を認証する必要があります。 次の手順に従ってください: 1。 Strava APIアプリケーションを作成する: - Strava API設定に移動 - クライアントIDとクライアントシークレットを取得するためのアプリケーションを作成 - Authorizationコールバックドメインをlocalhostに設定する 2.
概要(AI 翻訳)
Strava API へのアクセスを提供するモデルコンテキストプロトコル(MCP)サーバー。 これにより、言語モデルは、Strava API からアクティビティデータを照会することができます。
利用可能なツール
サーバは、次のツールを公開します。
活動内容
- [
get_activity_by_id(activity_id: int): 特定の活動に関する詳細情報を入手
ISO形式([YYYY-MM-DD])で日付を指定してください。
活動データ形式
サーバは、一貫したフィールド名と単位でアクティビティデータを返します。
| フィールド | 説明 | ユニット | お問い合わせ | [[T5] | 活動名 | | | | 【[T6] | スポーツの種類 | | | | | [[T7] | 開始日時 | ISO 8601 | | 【[T8] | 距離 | メートル | | [[T9] | 経過時間合計 | 秒 | | [[T10] | 移動時間 | 秒 | | 【[T11] | 平均速度 | メートル毎秒 |
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Strava MCP Server
A Model Context Protocol (MCP) server that provides access to the Strava API. It allows language models to query athlete activities data from the Strava API.
Available Tools
The server exposes the following tools:
Activities Queries
get_activities(limit: int = 10): Get the authenticated athlete’s recent activitiesget_activities_by_date_range(start_date: str, end_date: str, limit: int = 30): Get activities within a specific date rangeget_activity_by_id(activity_id: int): Get detailed information about a specific activityget_recent_activities(days: int = 7, limit: int = 10): Get activities from the past X days
Dates should be provided in ISO format (YYYY-MM-DD).
Activity Data Format
The server returns activity data with consistent field names and units:
| Field | Description | Unit |
|---|---|---|
name |
Activity name | - |
sport_type |
Type of sport | - |
start_date |
Start date and time | ISO 8601 |
distance_metres |
Distance | meters |
elapsed_time_seconds |
Total elapsed time | seconds |
moving_time_seconds |
Moving time | seconds |
average_speed_mps |
Average speed | meters per second |
max_speed_mps |
Maximum speed | meters per second |
total_elevation_gain_metres |
Total elevation gain | meters |
elev_high_metres |
Highest elevation | meters |
elev_low_metres |
Lowest elevation | meters |
calories |
Calories burned | kcal |
start_latlng |
Start coordinates | [lat, lng] |
end_latlng |
End coordinates | [lat, lng] |
Authentication
To use this server, you’ll need to authenticate with the Strava API. Follow these steps:
-
Create a Strava API application:
- Go to Strava API Settings
- Create an application to get your Client ID and Client Secret
- Set the Authorization Callback Domain to
localhost
-
Get your refresh token:
- Use the included
get_strava_token.pyscript:
python get_strava_token.py- Follow the prompts to authorize your application
- The script will save your tokens to a
.envfile
- Use the included
-
Set environment variables: The server requires the following environment variables:
インストール
uvx strava-mcp-server設定
{
"mcpServers": {
"strava": {
"command": "uvx",
"args": [
"strava-mcp-server"
],
"env": {
"STRAVA_CLIENT_ID": "YOUR_CLIENT_ID",
"STRAVA_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"STRAVA_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
}
}
}
}