mcp-server-strava
Strava API와 MCP(Model Context Protocol) SDK 통합
Model Context Protocol SDK를 사용하여 Strava 데이터를 기반으로 한 교육 분석 및 추천을 통합합니다.
🚀 특징
Strava에서 운동 분석
교육 권장 사항
자동 토큰 업데이트
API 요청에 대한 속도 제한
Related MCP server: Strava MCP Server
📋 요구 사항
⚙️ 설치
지엑스피1
MCP SDK 설치
uv add "mcp[cli]"🔧 설정
Strava API 설정
API 설정 페이지 로 이동
애플리케이션을 생성하세요:
애플리케이션 이름: MCP Strava 통합
카테고리: 교육 분석
웹사이트: http://localhost
권한 부여 콜백 도메인: localhost
환경 설정
환경 변수가 있는 파일을 만듭니다.
cp .env-template .env액세스 토큰을 받으세요:
python scripts/auth.py설정을 확인하세요:
mcp dev src/server.py curl -X GET "http://localhost:8000/activities"
📚 API 및 예제
리소스 및 도구
유형 | 이름 | 설명 |
의지 |
| 활동 목록 |
의지 |
| 활동 세부 정보 |
의지 |
| 훈련 구역 |
의지 |
| 운동선수 클럽 |
의지 |
| 장비 정보 |
도구 |
| 훈련 분석 |
도구 |
| 부하 분석 |
도구 |
| 추천사항 |
사용 예
from mcp import ClientSession
# Получение активностей
async with ClientSession() as session:
activities = await session.read_resource("strava://activities")
activity = await session.read_resource("strava://activities/12345678")
# Анализ тренировки
result = analyze_activity(activity_id="12345678")
"""
{
"type": "Run",
"distance": 5000,
"moving_time": 1800,
"analysis": {
"pace": 5.5, # мин/км
"effort": "Средняя"
}
}
"""
# Анализ нагрузки
summary = analyze_training_load(activities)
"""
{
"activities_count": 10,
"total_distance": 50.5, # км
"total_time": 5.2, # часы
"heart_rate_zones": {
"easy": 4, # ЧСС < 120
"medium": 4, # ЧСС 120-150
"hard": 2 # ЧСС > 150
}
}
"""
# Получение тренировочных зон
async with ClientSession() as session:
zones = await session.read_resource("strava://athlete/zones")
"""
{
"heart_rate": {
"custom_zones": true,
"zones": [
{"min": 0, "max": 120, "name": "Z1 - Recovery"},
{"min": 120, "max": 150, "name": "Z2 - Endurance"},
{"min": 150, "max": 170, "name": "Z3 - Tempo"},
{"min": 170, "max": 185, "name": "Z4 - Threshold"},
{"min": 185, "max": -1, "name": "Z5 - Anaerobic"}
]
},
"power": {
"zones": [
{"min": 0, "max": 180},
{"min": 181, "max": 250},
{"min": 251, "max": 300},
{"min": 301, "max": 350},
{"min": 351, "max": -1}
]
}
}
"""🛠 개발
CI/CD 및 보안
GitHub Actions의 체크
유형 | 도구 | 설명 |
린팅 | 주름 옷깃 | 코드 포맷팅 및 분석 |
테스트 | 파이테스트 | 단위 및 통합 테스트 |
코팅 | pytest-cov | 코드 커버리지 보고서 |
보안 및 비밀
토큰 보호:
.env에서.gitignore로CI/CD를 위한 GitHub의 비밀
속도 제한: 100개 요청/15분
비밀 설정:
# В GitHub: Settings → Secrets → Actions STRAVA_CLIENT_ID=<client_id> STRAVA_CLIENT_SECRET=<client_secret> STRAVA_REFRESH_TOKEN=<refresh_token>
기여하다
저장소를 포크하세요
종속성 설치:
uv pip install -e ".[dev]"브랜치를 생성합니다:
git checkout -b feature/name변경 사항을 확인하세요:
ruff format . ruff check . pytest --cov=src풀 리퀘스트 만들기
📫 지원
📄 라이센스
Available Tools
4 toolsanalyze_activityC
Анализ активности из Strava
Args:
activity_id: ID активности (строка или число)
Returns:
dict: Результаты анализа активности
Inputs: activity_id (required).
analyze_training_loadD
Анализ тренировочной нагрузки
Inputs: activities (required).
get_activity_by_idC
Get activity details from Strava
Args:
activity_id (Union[str, int]): Activity ID to fetch
Returns:
Dict: Activity details including type, distance, time and other metrics
Inputs: activity_id (required).
get_activity_recommendationsB
Получить рекомендации по тренировкам на основе анализа последних активностей
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
There is significant overlap between analyze_activity and get_activity_by_id, as both appear to retrieve and process activity data based on activity_id, making them easily confused. analyze_training_load and get_activity_recommendations are more distinct but still related to activity analysis, creating some ambiguity in the set.
The naming is mixed with both English and Russian terms (e.g., analyze_activity vs. analyze_training_load in English, but get_activity_recommendations in Russian description), and the verb patterns vary (analyze_ vs. get_). While readable, this inconsistency reduces predictability and coherence.
With 4 tools, the count is borderline thin for a Strava server, as it might lack broader functionality like user management, activity creation, or social features. However, it covers core analysis aspects, so it's not severely mismatched but feels slightly under-scoped.
The tool set is focused on activity analysis and recommendations, but there are significant gaps: no CRUD operations for activities (e.g., create, update, delete), no user profile or authentication tools, and no social or leaderboard features typical of Strava's domain. This will likely cause agent failures for common workflows.
Maintenance
Related MCP Connectors
Strava MCP tools for AI: athletes, activities, segments, clubs, routes. Powered by HAPI MCP server.
Ask your AI about your fitness: activities and data from Garmin, COROS, Strava, GPX and more
An athlete's training, recovery and plan data from Dravr, read with their consent.
Training calendar, workouts and health data from Garmin, Wahoo, Polar, Apple Health and more
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides language models with access to Strava API data, allowing them to query and analyze athlete activities from Strava.425MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables language models to interact with Strava data, including activities, athlete statistics, routes, achievements, and social features.6MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables users to access Strava fitness data, including user activities, activity details, segments, and leaderboards through a structured API interface.34MIT
- AlicenseBqualityBmaintenancePrivacy-first MCP server for Strava activities, streams, routes and training data.29235 npm3MIT