TrainingPeaks MCP
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 Build a 4x8min threshold interval session for tomorrow"
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
Connect TrainingPeaks to Claude and other AI assistants via the Model Context Protocol (MCP). Query workouts, build structured intervals, manage your calendar, track fitness trends, and control your training through natural conversation.
No API approval required. The official Training Peaks API is approval-gated, but this server uses secure cookie authentication that any user can set up in minutes. Your cookie is stored in your system keyring, never transmitted anywhere except to TrainingPeaks.
What You Can Do

Ask your AI assistant things like:
"Build me a 4x8min threshold session for Tuesday with warm-up and cool-down"
"Schedule my mobility session for April 14, 2026 at 16:45"
"Compare my FTP progression this year vs last year"
"Copy last week's long ride to this Saturday"
"Log my weight at 74.5kg and sleep at 7.5 hours"
"What's my weekly TSS so far? Am I on track for my ATP target?"
"Show my race calendar and how many weeks until my A race"
"Set my FTP to 310 and update my power zones"
"Add a calendar note for next Monday: rest day, travel"
Related MCP server: TrainingPeaks MCP Server
Tools (64)
Workouts
Tool | Description |
| List workouts in a date range (max 90 days) |
| Get full details for a single workout |
| Create a workout with optional interval structure, auto-computed IF/TSS, and optional planned start time |
| Update any field of an existing workout, including structured intervals and planned start time |
| Delete a workout |
| Copy a workout to a new date (preserves structure and planned fields) |
| Reorder workouts on a given day |
| Pair a completed workout with a planned workout (merges into one) |
| Unpair a workout (splits into separate completed and planned workouts) |
| Validate interval structure without creating a workout |
| Get comments on a workout |
| Add a comment to a workout |
| Get the private workout note for a workout |
| Set or update the private workout note |
| Upload a FIT/TCX/GPX file to a workout |
| Download a workout's device file |
| Delete an attached file from a workout |
Analysis & Performance
Tool | Description |
| Detailed analysis with time-series data, zones, and laps |
| Power PRs (5s-90min) and running PRs (400m-marathon) |
| PRs set during a specific session |
| CTL, ATL, and TSB trend (fitness, fatigue, form) |
| Combined workouts + fitness for a week with totals |
| Annual Training Plan - weekly TSS targets, periods, races |
Athlete Settings
Tool | Description |
| Get FTP, thresholds, zones, profile |
| Update FTP and recalculate the default power zones |
| Update heart rate zones |
| Update run/swim pace zones |
| Update daily planned calories |
| Get pool length options |
Health Metrics
Tool | Description |
| Log weight, HRV, sleep, steps, SpO2, pulse, RMR, injury |
| Get health metrics for a date range |
| Get nutrition data for a date range |
Equipment
Tool | Description |
| List bikes and shoes with distances |
| Add a bike or shoe |
| Update equipment details, retire |
| Delete equipment |
Events & Calendar
Tool | Description |
| Get A-priority focus event with goals |
| Get nearest future event |
| List events in a date range |
| Add a race/event with priority (A/B/C) and CTL target |
| Update event details, attach workouts as legs (multisport) |
| Delete an event |
| Create a calendar note |
| Get a calendar note by ID |
| Update title, description, date or visibility of a note |
| Delete a calendar note |
| List all comments on a note |
| Add a comment to a note |
| List unavailable/limited periods |
| Mark dates as unavailable or limited |
| Remove availability entry |
Workout Library
Tool | Description |
| List workout library folders |
| List templates in a library |
| Get full template details including structure |
| Create a library folder |
| Delete a library folder |
| Save a workout template |
| Edit a template |
| Schedule a template to a calendar date |
Reference & Auth
Tool | Description |
| List all sport types and subtypes with IDs |
| Get athlete profile |
| Check authentication status |
| List athletes (coach accounts) |
| Re-authenticate from browser cookie |
Setup Options
Option A: Auto-Setup with Claude Code
If you have Claude Code, paste this prompt:
Set up the TrainingPeaks MCP server from https://github.com/JamsusMaximus/trainingpeaks-mcp - clone it, create a venv, install it, then walk me through getting my TrainingPeaks cookie from my browser and run tp-mcp auth. Finally, add it to my Claude Desktop config.Claude will handle the installation and guide you through authentication step-by-step.
Option B: Manual Setup
Step 1: Install
git clone https://github.com/JamsusMaximus/trainingpeaks-mcp.git
cd trainingpeaks-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .Step 2: Authenticate
Option A: Auto-extract from browser (easiest)
If you're logged into TrainingPeaks in your browser:
pip install tp-mcp[browser] # One-time: install browser support
tp-mcp auth --from-browser chrome # Or: firefox, safari, edge, automacOS note: You may see security prompts for Keychain or Full Disk Access. This is normal - browser cookies are encrypted and require permission to read.
Option B: Manual cookie entry
Log into app.trainingpeaks.com
Open DevTools (
F12) -> Application tab -> CookiesFind
Production_tpAuthand copy its valueRun
tp-mcp authand paste when prompted
Other auth commands:
tp-mcp auth-status # Check if authenticated
tp-mcp auth-clear # Remove stored cookieStep 3: Add to Claude Desktop
Run this to get your config snippet:
tp-mcp configEdit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and paste it inside mcpServers. Example with multiple servers:
{
"mcpServers": {
"some-other-server": {
"command": "npx",
"args": ["some-other-mcp"]
},
"trainingpeaks": {
"command": "/Users/you/trainingpeaks-mcp/.venv/bin/tp-mcp",
"args": ["serve"]
}
}
}Restart Claude Desktop. You're ready to go!
Structured Workouts
Create workouts with full interval structure. The server auto-computes duration, IF, and TSS from the structure:
{
"date": "2026-03-01",
"sport": "Bike",
"title": "Sweet Spot Intervals",
"structure": {
"primaryIntensityMetric": "percentOfFtp",
"steps": [
{"name": "Warm Up", "duration_seconds": 600, "intensity_min": 40, "intensity_max": 55, "intensityClass": "warmUp"},
{"type": "repetition", "reps": 4, "steps": [
{"name": "Sweet Spot", "duration_seconds": 480, "intensity_min": 88, "intensity_max": 93, "intensityClass": "active"},
{"name": "Recovery", "duration_seconds": 120, "intensity_min": 50, "intensity_max": 60, "intensityClass": "rest"}
]},
{"name": "Cool Down", "duration_seconds": 600, "intensity_min": 40, "intensity_max": 55, "intensityClass": "coolDown"}
]
}
}The LLM builds this JSON naturally from conversation - just say "build me 4x8min sweet spot with 2min rest".
You can use the same simplified structure object with tp_update_workout:
{
"workout_id": "3658666303",
"duration_minutes": 57,
"tss_planned": 62.3,
"structure": {
"primaryIntensityMetric": "percentOfThresholdHr",
"steps": [
{"name": "Warm-up", "duration_seconds": 900, "intensity_min": 65, "intensity_max": 80, "intensityClass": "warmUp"},
{"type": "repetition", "name": "4x5min controlled tempo", "reps": 4, "steps": [
{"name": "Interval", "duration_seconds": 300, "intensity_min": 89, "intensity_max": 94, "intensityClass": "active"},
{"name": "Jog recovery", "duration_seconds": 180, "intensity_min": 65, "intensity_max": 83, "intensityClass": "rest"}
]},
{"name": "Cool-down", "duration_seconds": 600, "intensity_min": 65, "intensity_max": 80, "intensityClass": "coolDown"}
]
}
}If duration_minutes and tss_planned are omitted, they are derived from the structure. If you pass them explicitly, they override the derived values.
For advanced round-trip use cases, tp_create_workout and tp_update_workout also accept a native structured_workout payload in TrainingPeaks builder format. When a workout already has a native structure, tp_get_workout returns it as structured_workout.
Workout comments are exposed via tp_get_workout()["workout_comments"] or tp_get_workout_comments(). The older top-level coach_comments and athlete_comments fields are no longer returned by tp_get_workout.
{
"workout_id": "3658666303",
"structured_workout": {
"structure": [],
"polyline": [],
"primaryLengthMetric": "duration",
"primaryIntensityMetric": "percentOfFtp",
"primaryIntensityTargetOrRange": "range"
}
}Use either structure or structured_workout in a single create/update call, not both.
For planned workout scheduling, tp_create_workout and tp_update_workout accept:
YYYY-MM-DDfor all-day planning on a calendar dateYYYY-MM-DDTHH:MM:SSfor a planned start time on that date
TrainingPeaks stores planned workout times separately from the calendar day. Internally this means:
workoutDaystays at midnight for the selected datestartTimePlannedstores the planned start timeplanned end time is derived from
startTimePlanned + totalTimePlanned
Example with a planned start time:
{
"date": "2026-04-14T16:45:00",
"sport": "Strength",
"title": "Core & Mobility",
"duration_minutes": 60,
"description": "Core stabilisation and stretching."
}What is MCP?
Model Context Protocol is an open standard for connecting AI assistants to external data sources. MCP servers expose tools that AI models can call to fetch real-time data, enabling assistants like Claude to access your Training Peaks account through natural language.
Security
TL;DR: Your cookie is encrypted on disk, exchanged for short-lived OAuth tokens, never shown to Claude, and only ever sent to TrainingPeaks. The server has no network ports.
This server is designed with defence-in-depth. Your TrainingPeaks session cookie is sensitive - it grants access to your training data - so we treat it accordingly.
Write access: v2.0 adds full calendar management (create, update, delete workouts, events, notes, equipment, settings). All mutations go through Pydantic validation. The server cannot access billing or payment info.
Cookie Storage
Platform | Primary Storage | Fallback |
macOS | System Keychain | Encrypted file |
Windows | Windows Credential Manager | Encrypted file |
Linux | Secret Service (GNOME/KDE) | Encrypted file |
Your cookie is never stored in plaintext. The encrypted file fallback uses AES-256-GCM authenticated encryption with a PBKDF2-derived key (600,000 iterations) and a machine-specific salt.
Cookie Never Leaks to AI
The AI assistant (Claude) never sees your cookie value. Multiple layers ensure this:
Return value sanitisation: Tool results are scrubbed for any keys containing
cookie,token,auth,credential,password, orsecretbefore being sent to ClaudeMasked repr(): The
BrowserCookieResultandCredentialResultclasses override__repr__to showcookie=<present>instead of the actual valueSanitised exceptions: Error messages use only exception type names, never full messages that could contain data
No logging: Cookie values are never written to any log
Domain Hardcoding (Cannot Be Changed)
The browser cookie extraction only accesses .trainingpeaks.com:
# From src/tp_mcp/auth/browser.py - HARDCODED, not a parameter
cj = func(domain_name=".trainingpeaks.com")Claude cannot modify this via tool parameters. The only parameter is browser (chrome/firefox/etc), not the domain. To change the domain would require modifying the source code.
No Network Exposure
The MCP server uses stdio transport only - it communicates with Claude Desktop via stdin/stdout, not over the network. There is no HTTP server, no open ports, no remote access.
Open Source
This server is fully open source. You can audit every line of code before running it. Key security files:
src/tp_mcp/auth/browser.py- Cookie extraction with hardcoded domainsrc/tp_mcp/auth/encrypted.py- AES-256-GCM credential encryptionsrc/tp_mcp/tools/_validation.py- Pydantic input validationsrc/tp_mcp/tools/refresh_auth.py- Result sanitisationtests/test_tools/test_refresh_auth_security.py- Security tests
Authentication Flow
The server uses a two-step authentication process:
Cookie to OAuth Token: Your stored cookie is exchanged for a short-lived OAuth access token (expires in 1 hour)
Automatic Refresh: Tokens are cached in memory and automatically refreshed before expiry
This means:
You only need to authenticate once with
tp-mcp authAPI calls use proper Bearer token auth, not cookies
If your session cookie expires (typically after several weeks), use
tp_refresh_authin Claude or runtp-mcp authagain
Development
pip install -e ".[dev]"
pytest tests/ -v
mypy src/
ruff check src/Licence
MIT
Available Tools
65 toolstp_add_note_commentA
Add a comment to a calendar note.
Inputs: comment (required), note_id (required), athlete.
tp_add_workout_commentC
Add a comment to a workout.
Inputs: comment (required), workout_id (required), athlete.
tp_analyze_workoutB
Get workout analysis: metrics, zones, laps. Saves full time-series to JSON file.
Inputs: workout_id (required), athlete.
tp_auth_statusA
Check auth status. Use only when other tools return auth errors.
Inputs: no named parameters.
tp_copy_workoutB
Copy a workout to a new date. Copies structure, description, planned fields.
Inputs: workout_id (required), target_date (required), title, athlete.
tp_create_availabilityC
Mark dates as unavailable or limited.
Inputs: end_date (required), start_date (required), athlete, limited, +1 more.
tp_create_equipmentB
Add new equipment (bike or shoe).
Inputs: name (required), type (required), brand, model, +8 more.
tp_create_eventB
Create a race/event with priority (A/B/C) and CTL target.
Inputs: date (required), name (required), athlete, priority, +4 more.
tp_create_libraryC
Create a workout library folder.
Inputs: name (required), athlete.
tp_create_library_itemC
Save a workout template to a library.
Inputs: name (required), library_id (required), sport_type_id (required), sport_family_id (required), +5 more.
tp_create_noteC
Create a calendar note.
Inputs: date (required), title (required), athlete, description.
tp_create_workoutA
Create a planned workout with optional simplified interval structure or native TrainingPeaks structured_workout payload. Duration is auto-computed only from simplified structure when not provided.
Inputs: date (required), sport (required), title (required), rpe, +11 more.
tp_delete_availabilityC
Remove an availability entry.
Inputs: availability_id (required), athlete.
tp_delete_equipmentC
Delete equipment.
Inputs: equipment_id (required), athlete.
tp_delete_eventC
Delete an event.
Inputs: event_id (required), athlete.
tp_delete_libraryB
Delete a library folder and all templates.
Inputs: library_id (required), athlete.
tp_delete_noteB
Delete a calendar note.
Inputs: note_id (required), athlete.
tp_delete_workoutC
Delete a workout.
Inputs: workout_id (required), athlete.
tp_delete_workout_fileB
Delete a workout file by file_id. Get file_id from tp_get_workout device_files/attachment_files.
Inputs: file_id (required), workout_id (required), athlete.
tp_download_workout_fileA
Download a workout file by file_id. Get file_id from tp_get_workout device_files/attachment_files.
Inputs: file_id (required), workout_id (required), athlete, output_path.
tp_get_athlete_settingsA
Get athlete settings: FTP, thresholds, zones, profile.
Inputs: athlete.
tp_get_atpA
Get Annual Training Plan - weekly TSS targets, training periods, races. Max 90 days.
Inputs: end_date (required), start_date (required), athlete.
tp_get_availabilityB
Get availability entries for a date range.
Inputs: end_date (required), start_date (required), athlete.
tp_get_equipmentB
List equipment (bikes, shoes).
Inputs: type, athlete.
tp_get_eventsA
List events in a date range.
Inputs: end_date (required), start_date (required), athlete.
tp_get_fitnessA
Get fitness/fatigue trend (CTL/ATL/TSB). Supports historical date ranges.
Inputs: days, athlete, end_date, start_date.
tp_get_focus_eventB
Get the A-priority focus event with goals and results.
Inputs: athlete.
tp_get_librariesA
List workout library folders.
Inputs: athlete.
tp_get_library_itemC
Get full template details including structure.
Inputs: item_id (required), library_id (required), athlete.
tp_get_library_itemsB
List templates in a workout library.
Inputs: library_id (required), athlete.
tp_get_metricsC
Get health metrics for a date range.
Inputs: end_date (required), start_date (required), athlete.
tp_get_next_eventC
Get the nearest future planned event.
Inputs: athlete.
tp_get_noteA
Get a calendar note by ID.
Inputs: note_id (required), athlete.
tp_get_note_commentsA
Get all comments on a calendar note.
Inputs: note_id (required), athlete.
tp_get_nutritionB
Get nutrition data for a date range.
Inputs: end_date (required), start_date (required), athlete.
tp_get_peaksA
Get top performances by type. For comparing PRs over time.
Inputs: sport (required), pr_type (required), days, athlete.
tp_get_pool_length_settingsC
Get pool length settings.
Inputs: athlete.
tp_get_profileA
Get athlete profile. Rarely needed - other tools work without it.
Inputs: athlete.
tp_get_weekly_summaryA
Combined view of workouts + fitness for a week. Totals TSS, duration, end-of-week CTL/ATL/TSB.
Inputs: athlete, week_of.
tp_get_workoutA
Get workout details by ID. Use after tp_get_workouts.
Inputs: workout_id (required), athlete.
tp_get_workout_commentsC
Get comments on a workout.
Inputs: workout_id (required), athlete.
tp_get_workout_noteC
Get the private workout note for a workout.
Inputs: workout_id (required), athlete.
tp_get_workout_prsC
Get PRs set during a specific workout.
Inputs: workout_id (required), athlete.
tp_get_workoutsA
List workouts in date range. Query only days needed. Max 90 days.
Inputs: end_date (required), start_date (required), type, athlete.
tp_get_workout_typesA
List all sport types and subtypes with IDs. Use to find subtype_id for create/update.
Inputs: no named parameters.
tp_list_athletesA
List athletes available to this account (coach accounts).
Inputs: no named parameters.
tp_list_notesB
List calendar notes for a date range.
Inputs: end_date (required), start_date (required), athlete.
tp_log_metricsB
Log health metrics (weight, HRV, sleep, steps, etc.) for a date.
Inputs: date (required), hrv, rmr, spo2, +6 more.
tp_pair_workoutA
Pair a completed workout with a planned workout. Attaches the completed data to the planned workout, merging them into one.
Inputs: planned_workout_id (required), completed_workout_id (required), athlete.
tp_refresh_authA
Refresh auth by extracting cookie from user's browser. Use when other tools return auth errors.
Inputs: browser.
tp_reorder_workoutsB
Reorder workouts on a given day.
Inputs: workout_ids (required), athlete.
tp_schedule_library_workoutC
Schedule a library template to a calendar date.
Inputs: date (required), item_id (required), library_id (required), athlete.
tp_set_workout_noteA
Set or update the private workout note for a workout.
Inputs: note (required), workout_id (required), athlete.
tp_unpair_workoutA
Unpair a workout. Detaches the completed workout file from the planned workout, creating two separate workouts. No data is lost.
Inputs: workout_id (required), athlete.
tp_update_equipmentC
Update equipment details.
Inputs: equipment_id (required), name, brand, model, +7 more.
tp_update_eventC
Update an event.
Inputs: event_id (required), date, name, athlete, +6 more.
tp_update_ftpA
Update FTP and recalculate the default power zones.
Inputs: ftp (required), athlete.
tp_update_hr_zonesC
Update heart rate zones.
Inputs: max_hr, athlete, resting_hr, threshold_hr, +1 more.
tp_update_library_itemC
Edit a workout template.
Inputs: item_id (required), library_id (required), tss, name, +6 more.
tp_update_noteC
Update a calendar note. Provide at least one of: title, description, date, is_hidden.
Inputs: note_id (required), date, title, athlete, +2 more.
tp_update_nutritionC
Update daily planned calories.
Inputs: planned_calories (required), athlete.
tp_update_speed_zonesC
Update run/swim pace zones.
Inputs: athlete, run_threshold_pace, swim_threshold_pace.
tp_update_workoutA
Update fields of an existing workout. Supports the same simplified interval structure format as tp_create_workout plus an optional native structured_workout payload, then fetches existing, merges, and saves.
Inputs: workout_id (required), rpe, date, tags, +14 more.
tp_upload_workout_fileB
Upload a workout file (.fit, .tcx, .gpx) to an existing workout.
Inputs: workout_id (required), athlete, file_path, workout_day, +1 more.
tp_validate_structureA
Validate workout interval structure without creating a workout. Returns block count, duration, estimated IF/TSS.
Inputs: structure (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 65 tools
Most tools target a distinct resource and action, but there is some overlap between event-related tools like tp_get_focus_event, tp_get_next_event, and tp_get_events, and between tp_get_fitness and tp_get_weekly_summary. Descriptions help clarify, so the ambiguity is limited.
All tools follow a consistent pattern: 'tp_' prefix followed by a verb_noun in snake_case (e.g., get_workouts, create_workout, delete_equipment). There are no mixed conventions or unpredictable naming styles.
With 65 tools, the server is heavily over-scoped for typical MCP usage, even for a large platform like TrainingPeaks. Many tools could be consolidated (e.g., event fetching, PR comparisons), making the set unwieldy for agents.
The tool surface covers most CRUD operations for workouts, events, notes, equipment, libraries, and availability. Minor gaps exist, such as no delete operation for library items and no update operation for availability, but these are workarounds.
Maintenance
Related MCP Connectors
Connect Intervals.icu to Claude and ChatGPT: read training, plan workouts. Training never stored.
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
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).
Your endurance training data in your AI assistant: activities, recovery, plan, workout edits.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants like Claude to interact with TrainingPeaks, allowing users to query workouts, build structured intervals, track fitness trends, and add comments through natural language, with automatic secure login.8MIT
- FlicenseNot gradedqualityAmaintenanceConnects AI assistants to a TrainingPeaks account over the Model Context Protocol using cookie-based authentication that requires no API approval, letting users query and build structured workouts, schedule races and notes, manage equipment and workout libraries, and control zone settings through natural conversation. It also exposes fitness trends (CTL/ATL/TSB), power and running PRs, health metrics, and coach-level athlete groups and multi-week training plans.-
- FlicenseNot gradedqualityAmaintenanceEnables Claude and other AI assistants to query workouts, build structured intervals, manage calendars, track fitness trends, and control training through natural conversation without official API approval.-
- FlicenseNot gradedqualityAmaintenanceConnects TrainingPeaks to Claude and other AI assistants over the Model Context Protocol, enabling natural-language querying and management of workouts, structured intervals, calendar events, fitness trends (CTL/ATL/TSB), power PRs, health metrics, equipment, and athlete settings. It uses secure cookie authentication kept in the system keyring, so no API approval is needed and any account can be used.-