TrainingPeaks MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TrainingPeaks MCP Server show my CTL trend for the last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-serverFeatures
14 tools organized across 5 categories:
Category | Tools | Description |
Auth |
| Check/refresh authentication |
Profile |
| Athlete profile + auto-detect ID |
Workouts |
| List and detail past workouts |
| Upcoming planned workouts with coach instructions | |
Fitness |
| CTL/ATL/TSB with computed values |
Peaks |
| Personal records by sport |
Analytics |
| Weekly/monthly TSS, load ramp rate |
| CTL trajectory, 7-day projection | |
| Efficiency factor, variability index | |
| Sport-specific volume & consistency | |
| 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.
Related MCP server: intervals-icu-mcp
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 | sh2. 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.comFind the cookie named
Production_tpAuthDouble-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.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.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 uvxThis 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 valueFor 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 formattingKnown 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.
Available Tools
14 toolstp_auth_statusA
Check TrainingPeaks authentication status.
Returns whether you have a valid auth cookie and bearer token. If not authenticated, provides instructions for setting up credentials.
Inputs: no named parameters. Returns: result
tp_fitness_trendA
Analyze CTL/ATL/TSB trajectory and project future values.
Args: days: Number of days to analyze (default 90).
Returns trend direction, rate of change, and 7-day projected CTL/ATL/TSB.
Inputs: days. Returns: result
tp_get_fitnessA
Get CTL (fitness), ATL (fatigue), and TSB (form) performance data.
Args: days: Number of days to look back (default 90). Ignored if start_date is set. start_date: Start date (YYYY-MM-DD). Overrides days parameter. end_date: End date (YYYY-MM-DD). Defaults to today.
Returns daily training load data with computed CTL/ATL/TSB values and current fitness status. To get accurate CTL/ATL values, the API fetches extra history for the exponential decay calculation.
Inputs: days, start_date, end_date. Returns: result
tp_get_peaksA
Get personal records by scanning recent workouts for a given sport.
Args: sport: Sport type — "Bike", "Run", "Swim", or "Hike" (default "Bike"). days: Number of days to scan (default 90, max 365). pr_class: Filter by PR class — "Power", "HeartRate", or None for all.
Scans workouts that have PRs and aggregates the best values per type. Shows the top record for each duration/distance across the time range.
Inputs: sport, days, pr_class. Returns: result
tp_get_planned_workoutsA
Get upcoming planned workouts from TrainingPeaks.
Args: start_date: Start date (YYYY-MM-DD). Defaults to today. end_date: End date (YYYY-MM-DD). Defaults to 14 days from now. workout_type: Filter by type (e.g. "Bike", "Run", "Swim", "Strength"). limit: Maximum number of workouts to return (default 20).
Returns planned workouts with date, type, planned duration/distance/TSS, workout instructions, and coach comments. Sorted chronologically (nearest first). The TP API limits requests to 90 days at a time.
Inputs: start_date, end_date, workout_type, limit. Returns: result
tp_get_profileA
Get your TrainingPeaks athlete profile.
Returns your name, athlete ID, email, and other profile information. The athlete ID is needed for other TrainingPeaks queries.
Inputs: no named parameters. Returns: result
tp_get_workoutA
Get detailed information about a specific workout.
Args: workout_id: The TrainingPeaks workout ID.
Returns full workout details including power, HR, speed, elevation, description, and coach comments.
Inputs: workout_id (required). Returns: result
tp_get_workout_prsB
Get personal records from a specific workout.
Args: workout_id: The TrainingPeaks workout ID.
Returns all PRs achieved in this workout, grouped by class (Power, HR, etc.) and time frame (All-Time, Last 90 Days, etc.).
Inputs: workout_id (required). Returns: result
tp_get_workoutsA
Get a list of workouts from TrainingPeaks.
Args: start_date: Start date (YYYY-MM-DD). Defaults to 30 days ago. end_date: End date (YYYY-MM-DD). Defaults to today. workout_type: Filter by type (e.g. "Bike", "Run", "Swim", "Strength"). limit: Maximum number of workouts to return (default 20).
Returns workouts with date, type, duration, distance, TSS, HR, and power data. The TP API limits requests to 90 days at a time.
Inputs: start_date, end_date, workout_type, limit. Returns: result
tp_performance_summaryA
Aggregated performance summary for a sport over time.
Args: sport: Sport type — "Bike", "Run", "Swim" (default "Bike"). days: Number of days to analyze (default 90).
Returns volume, intensity distribution, consistency metrics, and PR timeline for the specified sport.
Inputs: sport, days. Returns: result
tp_refresh_authA
Force refresh the TrainingPeaks bearer token.
Use this if you're getting authentication errors. Clears the cached token and obtains a fresh one from the auth cookie.
Inputs: no named parameters. Returns: result
tp_training_load_summaryB
Analyze training load trends over time.
Args: days: Number of days to analyze (default 90).
Returns weekly and monthly TSS totals, averages, load ramp rate, and comparison between recent and previous periods.
Inputs: days. Returns: result
tp_training_zones_distributionA
Analyze training time and TSS distribution across intensity zones.
Args: start_date: Start date (YYYY-MM-DD). Defaults to {days} days ago. end_date: End date (YYYY-MM-DD). Defaults to today. days: Days to look back if start_date not set (default 30).
Breaks down workouts by IF-based training zones showing how training time and stress are distributed. Helps identify polarized vs pyramidal vs threshold-heavy training patterns.
Inputs: start_date, end_date, days. Returns: result
tp_workout_analysisA
Deep analysis of a specific workout with derived metrics.
Args: workout_id: The TrainingPeaks workout ID.
Returns efficiency factor (NP/avg HR), variability index (NP/avg power), intensity distribution, and comparison context.
Inputs: workout_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool serves a distinct purpose without overlap. For example, tp_get_fitness returns daily CTL/ATL/TSB, tp_fitness_trend projects future values, and tp_training_load_summary provides weekly/monthly TSS totals. Similarly, tp_get_workout gives raw data while tp_workout_analysis computes derived metrics. Auth tools are separate, and each analytics tool focuses on a unique aspect.
All tools follow a tp_ prefix with snake_case naming. The verb usage is mostly consistent, with many using 'get_' (e.g., tp_get_fitness, tp_get_workouts) and others using descriptive verbs like 'fitness_trend' or 'performance_summary'. Some names like tp_auth_status or tp_training_zones_distribution are nouns rather than verbs, but overall the pattern is predictable.
14 tools cover a broad yet focused range of fitness data operations including authentication, profile, workouts (planned and completed), fitness metrics, trends, peaks/PRs, and detailed analysis. Each tool earns its place without redundancy or excessive specialization.
The tool set provides comprehensive coverage for a read-only analytics server. It includes auth, profile, workout retrieval (planned and historical), fitness metrics, trends, peaks/PRs, workout analysis, training load summary, and zones distribution. No obvious gaps for the domain.
Related MCP Connectors
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).
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
Turn Claude or ChatGPT into a cycling coach that plans your week, grades it, and adapts. Free beta.
Adaptive running coach MCP server — training data, plans, and recovery for AI assistants.
Related MCP Servers
- AlicenseBqualityCmaintenanceTrainingPeaks MCP server for Claude Desktop and AI assistants. Query workouts, analyze fitness, power peaks and more.85196MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for Intervals.icu integration. Access your training data, wellness metrics, and performance analysis through Claude and other LLMs.4839MIT
- AlicenseBqualityDmaintenanceConnect TrainingPeaks to Claude and other AI assistants via the Model Context Protocol to query workouts, build structured intervals, manage calendar, track fitness trends, and control training through natural conversation.65MIT
- AlicenseAqualityCmaintenanceLocal MCP server that connects Claude Desktop with Garmin and Apple Health data to read training and recovery, estimate heart rate and pace zones, analyze performance, and create structured workouts.22MIT