Back to MCP Servers

Trainingpeaks

Query TrainingPeaks workouts, analyze CTL/ATL/TSB fitness metrics, and compare power/pace PRs through Claude Desktop.

sportsai
By JamsusMaximus
12263Updated 2 days agoPythonMIT

Installation

npx -y trainingpeaks-mcp

Configuration

{
  "mcpServers": {
    "trainingpeaks-mcp": {
      "command": "npx",
      "args": ["-y", "trainingpeaks-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

TrainingPeaks MCP Server

<a href="https://glama.ai/mcp/servers/@JamsusMaximus/TrainingPeaks-MCP"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@JamsusMaximus/TrainingPeaks-MCP/badge" alt="TrainingPeaks MCP server" /> </a>

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

Example conversation with Claude using TrainingPeaks MCP

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"

Tools (84)

Workouts

ToolDescription
tp_get_workoutsList workouts in a date range (max 90 days)
tp_get_workoutGet full details for a single workout
tp_create_workoutCreate a workout with optional interval structure, auto-computed IF/TSS, and optional planned start time
tp_update_workoutUpdate any field of an existing workout, including structured intervals and planned start time
tp_delete_workoutDelete a workout
tp_copy_workoutCopy a workout to a new date (preserves structure and planned fields)
tp_reorder_workoutsReorder workouts on a given day
tp_pair_workoutPair a completed workout with a planned workout (merges into one)
tp_unpair_workoutUnpair a workout (splits into separate completed and planned workouts)
tp_validate_structureValidate interval structure without creating a workout
tp_get_workout_commentsGet comments on a workout
tp_add_workout_commentAdd a comment to a workout
tp_get_workout_noteGet the private workout note for a workout
tp_set_workout_noteSet or update the private workout note
tp_upload_workout_fileUpload a FIT/TCX/GPX file to a workout
tp_download_workout_fileDownload a workout's device file
tp_delete_workout_fileDelete an attached file from a workout

Analysis & Performance

ToolDescription
tp_analyze_workoutDetailed analysis with time-series data, zones, and laps
tp_get_peaksPower PRs (5s-90min) and running PRs (400m-marathon)
tp_get_workout_prsPRs set during a specific session
tp_get_fitnessCTL, ATL, and TSB trend (fitness, fatigue, form)
tp_get_weekly_summaryCombined workouts + fitness for a week with totals
tp_get_atpAnnual Training Plan - weekly TSS targets, periods, races

Athlete Settings

ToolDescription
tp_get_athlete_settingsGet FTP, thresholds, zones, profile
tp_update_ftpUpdate FTP for a sport's power set (bike default; preserves the set's calculation method)
tp_update_hr_zonesUpdate HR threshold/max/resting for a sport (general/bike/run/swim), preserving the method
tp_update_speed_zonesUpdate run/swim threshold pace, preserving the method
tp_create_zonesCreate a NEW per-sport zone set from scratch (choose the calculation method); errors if one already exists
tp_get_zone_methodsList available zone-calculation methods per metric (power/HR/pace) with each method's zone count and labels
tp_update_nutritionUpdate daily planned calories
tp_get_pool_length_settingsGet pool length options

Zone updates — how they work & one limitation. The zone setters target the right per-sport zone set (by workoutTypeId) and recompute the bands with TrainingPeaks' own zone calculator (the same call the web UI's Calculate makes), so the athlete's calculation method (%LTHR, Karvonen, Andy Coggan, …) is honoured exactly. They update a threshold (FTP / LTHR / threshold pace).

Limitation — test-based (Distance/Time) methods. A zone set whose method derives its threshold from a test result (Speed/Pace Distance / Time) cannot have a threshold set directly — there is no stable value to set. These tools detect that case and return TEST_BASED_METHOD (writing nothing) rather than storing a wrong threshold; configure such a set via a test in the TrainingPeaks UI. This is deliberate: the connector owns threshold-anchored zones; test-protocol setup stays in the UI.

Health Metrics

ToolDescription
tp_log_metricsLog weight, HRV, sleep, steps, SpO2, pulse, RMR, injury
tp_get_metricsGet health metrics for a date range
tp_get_nutritionGet nutrition data for a date range

Equipment

ToolDescription
tp_get_equipmentList bikes and shoes with distances
tp_create_equipmentAdd a bike or shoe
tp_update_equipmentUpdate equipment details, retire
tp_delete_equipmentDelete equipment

Events & Calendar

ToolDescription
tp_get_focus_eventGet A-priority focus event with goals
tp_get_next_eventGet nearest future event
tp_get_eventsList events in a date range
tp_create_eventAdd a race/event with priority (A/B/C) and CTL target
tp_update_eventUpdate event details, attach workouts as legs (multisport)
tp_delete_eventDelete an event
tp_create_noteCreate a calendar note
tp_list_notesList calendar notes for a date range
tp_get_noteGet a calendar note by ID
tp_update_noteUpdate title, description, date or visibility of a note
tp_delete_noteDelete a calendar note
tp_get_note_commentsList all comments on a note
tp_add_note_commentAdd a comment to a note
tp_get_availabilityList unavailable/limited periods
tp_create_availabilityMark dates as unavailable or limited
tp_delete_availabilityRemove availability entry

Workout Library

ToolDescription
tp_get_librariesList workout library folders
tp_get_library_itemsList templates in a library
tp_get_library_itemGet full template details including structure
tp_create_libraryCreate a library folder
tp_delete_libraryDelete a library folder
tp_create_library_itemSave a workout template
tp_update_library_itemEdit a template
tp_schedule_library_workoutSchedule a template to a calendar date, for one athlete or (coach accounts) several at once via athletes

Strength Workouts

ToolDescription
tp_search_exercisesSearch the built-in strength exercise library by name (offline)
tp_create_strength_workoutCreate a structured strength/gym workout (blocks of exercises with sets and parameters)
tp_get_strength_summaryGet a strength workout's compliance summary (blocks/prescriptions/sets completed)
tp_get_strength_workoutsList strength/gym workouts in a date range (they don't appear in tp_get_workouts)
tp_get_strength_workoutGet a strength workout's full detail: blocks, exercises, sets, prescribed vs executed weights
tp_update_strength_workoutUpdate a strength workout in place (replace/append blocks, retitle, mark complete) - preserves Garmin TSS and FIT files, so use this rather than delete-and-recreate on device-synced workouts
tp_delete_strength_workoutDelete a strength workout by ID

Athlete Groups (coach accounts)

ToolDescription
tp_list_groupsList the coach's athlete groups (TP tags)
tp_list_athletes_in_groupList the athletes in one group, with names resolved from the roster
tp_create_groupCreate a new athlete group
tp_rename_groupRename an athlete group (default group cannot be renamed)
tp_delete_groupDelete a group - the grouping only, athletes are not deleted
tp_add_athletes_to_groupAdd one or more athletes to a group
tp_remove_athletes_from_groupRemove one or more athletes from a group

Training Plans (multi-week)

ToolDescription
tp_list_training_plansList the coach's authored multi-week training plans
tp_get_training_planSummary of one plan: weeks, per-week duration/distance, sport breakdown
tp_get_training_plan_workoutsAll workouts of a plan laid out by week/day
tp_apply_training_planApply a plan to an athlete's calendar from a start date (safe synthetic copy)

Reference & Auth

ToolDescription
tp_get_workout_typesList all sport types and subtypes with IDs
tp_get_profileGet athlete profile
tp_auth_statusCheck authentication status
tp_list_athletesList athletes (coach accounts)
tp_refresh_authRe-authenticate from browser cookie

MCP Apps (inline charts)

On clients that support the MCP Apps extension (spec 2026-07-28), some tools render an interactive UI inline in the conversation as well as returning their normal text payload. On every other client the tools behave exactly as before - the text answer is always complete on its own.

PMC fitness chart rendered inline

ToolApp
tp_get_fitnessInteractive CTL/ATL/TSB performance-management chart
tp_get_weekly_summaryWeek card: per-day load bars, planned vs completed, totals
tp_get_workoutInterval-profile viewer for structured workouts (summary fallback otherwise)

(Note: as of July 2026, Claude clients still connect to local stdio servers over the pre-2026 protocol, so the apps ship ready but won't render until client support rolls out. The tools' text output is unaffected either way.)

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 -e ".[browser]"  # One-time: install browser support
tp-mcp auth --from-browser chrome  # Or: firefox, safari, edge, auto

macOS 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

  1. Log into app.trainingpeaks.com
  2. Open DevTools (F12) -> Application tab -> Cookies
  3. Find Production_tpAuth and copy its value
  4. Run tp-mcp auth and paste when prompted

Option C: Environment variable (headless servers, containers, CI)

Se

View source on GitHub