TrainingPeaks MCP Server
A Model Context Protocol server for TrainingPeaks with an analytics focus — enabling real-time querying of training data, performance trends, CTL/ATL/TSB analysis, and training load optimization through Claude Desktop.
README
TrainingPeaks MCP Server
A Model Context Protocol server for TrainingPeaks with an analytics focus — enabling real-time querying of training data, performance trends, CTL/ATL/TSB analysis, and training load optimization through Claude Desktop.
# Install and run — no cloning needed
uvx tp-mcp-server
Features
14 tools organized across 5 categories:
| Category | Tools | Description |
|---|---|---|
| Auth | tp_auth_status, tp_refresh_auth |
Check/refresh authentication |
| Profile | tp_get_profile |
Athlete profile + auto-detect ID |
| Workouts | tp_get_workouts, tp_get_workout |
List and detail past workouts |
tp_get_planned_workouts |
Upcoming planned workouts with coach instructions | |
| Fitness | tp_get_fitness |
CTL/ATL/TSB with computed values |
| Peaks | tp_get_peaks, tp_get_workout_prs |
Personal records by sport |
| Analytics | tp_training_load_summary |
Weekly/monthly TSS, load ramp rate |
tp_fitness_trend |
CTL trajectory, 7-day projection | |
tp_workout_analysis |
Efficiency factor, variability index | |
tp_performance_summary |
Sport-specific volume & consistency | |
tp_training_zones_distribution |
IF-based zone breakdown |
Key feature: CTL/ATL/TSB are computed from TSS using standard exponential weighted moving averages (42-day/7-day time constants), since the TP API doesn't return these values directly.
Quick Start (recommended)
The fastest way to get running — no cloning or venv needed.
1. Install uv (if you don't have it)
uv is a fast Python package manager built by Astral (the company behind Ruff). It includes uvx, a tool that can download and run Python packages in isolated environments — no manual setup needed. It's open-source, widely adopted in the Python community, and used by projects like FastAPI, Pydantic, and many MCP servers.
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Get your TrainingPeaks auth cookie
- Open your browser and go to trainingpeaks.com and log in
- Open Developer Tools (
Cmd+Option+Ion Mac,F12on Windows/Linux) - Click the Application tab (Chrome/Edge) or Storage tab (Firefox)
- In the left sidebar, expand Cookies and click on
https://www.trainingpeaks.com - Find the cookie named
Production_tpAuth - Double-click its Value column and copy the entire string
3. Add to Claude Desktop
Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Note: If this file doesn't exist yet (first time configuring an MCP server), create it yourself. On macOS, the
Claudefolder insideApplication Supportshould already exist if you've opened Claude Desktop at least once — you just need to create theclaude_desktop_config.jsonfile inside it.
First, find the full path to uvx:
which uvx
This will output something like /Users/yourname/.local/bin/uvx.
Then add this to your config (replace the command path and your_cookie_value):
{
"mcpServers": {
"trainingpeaks": {
"command": "/Users/yourname/.local/bin/uvx",
"args": ["tp-mcp-server"],
"env": {
"TP_AUTH_COOKIE": "your_cookie_value"
}
}
}
}
Important: You must use the full absolute path to
uvx(not just"uvx"). Claude Desktop has a limited PATH and won't find it otherwise.
4. Restart Claude Desktop
Fully quit and reopen Claude Desktop. You should see "trainingpeaks" listed as a connected MCP server (look for the hammer icon).
That's it — no cloning, no virtual environments. uvx automatically downloads and runs the package from PyPI.
Alternative: Install from source
If you want to modify the code or contribute:
Prerequisites
- Python 3.12+
- uv (recommended) or pip
Steps
git clone https://github.com/banananovej-chuan/tp-mcp-server.git
cd tp-mcp-server
uv venv --python 3.12
uv pip install .
Get your cookie (see step 2 above), then configure the environment:
cp .env.example .env
# Edit .env and paste your cookie value
For Claude Desktop, use the absolute path to the venv Python:
{
"mcpServers": {
"trainingpeaks": {
"command": "/absolute/path/to/tp-mcp-server/.venv/bin/python",
"args": ["-m", "tp_mcp_server"],
"env": {
"TP_AUTH_COOKIE": "your_cookie_value"
}
}
}
}
Important: The
commandpath must be an absolute path. On macOS/Linux it starts with/, on Windows use the full path likeC:\\Users\\yourname\\tp-mcp-server\\.venv\\Scripts\\python.exe. Do not use~or relative paths.
Example Queries
Once connected in Claude Desktop, try:
- "What's my current fitness level?"
- "Show my planned workouts for the next 2 weeks"
- "Show my training load trend for the last 3 months"
- "Analyze my last bike workout"
- "What are my power PRs?"
- "How is my training zone distribution this month?"
- "Compare my bike performance over the last 90 days"
Refreshing Your Auth Cookie
The TrainingPeaks auth cookie expires periodically (typically every few days to weeks). When it expires:
- You'll see authentication errors in Claude Desktop
- Re-extract the cookie from your browser (repeat Step 2 from Quick Start)
- Update the
TP_AUTH_COOKIEvalue in your Claude Desktop config (and.envfile if using source install) - Restart Claude Desktop
Architecture
src/tp_mcp_server/
├── server.py # FastMCP entry point
├── mcp_instance.py # Shared MCP instance
├── config.py # Environment config
├── api/
│ ├── client.py # Async httpx client, token management
│ └── endpoints.py # API URL constants
├── auth/
│ ├── storage.py # Cookie storage (env/keyring)
│ └── browser.py # Browser cookie extraction
├── tools/
│ ├── auth.py # Auth status/refresh
│ ├── profile.py # Athlete profile
│ ├── workouts.py # Workout list/detail
│ ├── fitness.py # CTL/ATL/TSB data
│ ├── peaks.py # Personal records
│ └── analytics.py # Derived analytics
├── models/
│ ├── workout.py # Workout models
│ ├── fitness.py # Fitness models + CTL computation
│ ├── peaks.py # PR models
│ └── profile.py # Profile model
└── utils/
├── dates.py # Date helpers
└── formatting.py # Output formatting
Known Limitations
- Internal API: TrainingPeaks has no public API. This uses the same internal API as the web app, which could change without notice.
- Cookie auth: Requires periodic browser re-login to refresh the cookie.
- Sport-level PRs: The
/personalrecord/v2/athletes/{id}/{sport}endpoint returns 500. PRs are aggregated from individual workouts instead. - CTL/ATL/TSB: The API returns
"NaN"for these values. They are computed locally from TSS data. - Rate limiting: Requests are throttled to 150ms apart to avoid hitting TP rate limits.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。