Strava API 与模型上下文协议 (MCP) SDK 集成
使用模型上下文协议 SDK 集成基于 Strava 数据的训练分析和建议。
🚀 功能
Strava 锻炼分析
培训建议
自动令牌更新
API 请求的速率限制
📋 要求
⚙️ 安装
安装 MCP SDK
🔧 设置
设置 Strava API
前往API 设置页面
创建应用程序:
应用程序名称:MCP Strava Integration
类别:训练分析
网站: http://localhost
授权回调域:localhost
设置环境
创建包含环境变量的文件:
cp .env-template .env获取访问令牌:
python scripts/auth.py检查设置:
mcp dev src/server.py curl -X GET "http://localhost:8000/activities"
📚 API 和示例
资源和工具
类型 | 姓名 | 描述 |
资源 |
| 活动列表 |
资源 |
| 活动详情 |
资源 |
| 训练区 |
资源 |
| 运动员俱乐部 |
资源 |
| 设备信息 |
工具 |
| 训练分析 |
工具 |
| 负载分析 |
工具 |
| 建议 |
使用示例
🛠 开发
CI/CD 和安全
GitHub Actions 中的检查
类型 | 工具 | 描述 |
代码检查 | 皱领 | 代码格式化和分析 |
测试 | pytest | 单元和集成测试 |
涂层 | pytest-cov | 代码覆盖率报告 |
安全和秘密
代币保护:
.env
到.gitignore
GitHub 的 CI/CD 秘诀
速率限制: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创建拉取请求
📫 支持
GitHub 问题:创建问题
电报: @greg_kisel
📄 许可证
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Strava API 与模型上下文协议 SDK 的集成
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityEnables integration with OpenMetadata by wrapping its REST API for standardized interaction through the Model Context Protocol.Last updated -18MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides language models with access to Strava API data, allowing them to query and analyze athlete activities from Strava.Last updated -415MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables language models to interact with Strava data, including activities, athlete statistics, routes, achievements, and social features.Last updated -2MIT License
- AsecurityAlicenseAqualityA 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.Last updated -34MIT License