home / mcp / trainingpeaks mcp server

TrainingPeaks MCP Server

Provides MCP access to TrainingPeaks data for querying workouts, fitness metrics, and PRs through AI assistants.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jamsusmaximus-trainingpeaks-mcp": {
      "command": "/path/to/trainingpeaks-mcp/.venv/bin/tp-mcp",
      "args": [
        "serve"
      ]
    }
  }
}

You can connect TrainingPeaks to Claude and other AI assistants using the Model Context Protocol (MCP) to query workouts, monitor training metrics, and discover trends through natural language conversations. This enables you to ask questions like which workouts you did last week or how your fitness is progressing, and to retrieve detailed workout data without leaving your chat interface.

How to use

You access TrainingPeaks tools through an MCP client integrated with your AI assistant. Start by authenticating once to securely store your TrainingPeaks session cookie. After setup, you can ask questions such as what workouts you did in a date range, compare power PRs across time, review your CTL/ATL/TSB trends, or see PRs from a specific ride. The assistant will call the available tools to fetch real-time data from TrainingPeaks and present it in conversational responses.

How to install

Prerequisites: Python 3.8+ and a Python virtual environment. You will also need a supported MCP client to connect to the TrainingPeaks MCP server.

Step 1: Clone the project and enter the directory.

Step 2: Create and activate a virtual environment.

Step 3: Install the package in editable mode.

Step 4: Authenticate to store your TrainingPeaks credentials securely.

Additional sections

Configuration and security details are provided to ensure you can use the TrainingPeaks MCP server safely and reliably.

Cookie-based authentication is used to access TrainingPeaks data. Your credentials are stored securely in your system’s keyring and are not written to logs or files. If the cookie expires, you can re-authenticate to resume access.

For headless or non-interactive environments, an encrypted file fallback is available to avoid storing credentials in plaintext.

The MCP server only offers read-only access to TrainingPeaks data; no workouts can be modified through MCP calls.

If you need to reset credentials, you can clear the stored cookie and re-authenticate.

{
  "mcpServers": {
    "trainingpeaks": {
      "command": "/path/to/trainingpeaks-mcp/.venv/bin/tp-mcp",
      "args": ["serve"]
    }
  }
}

Cookie expiration

TrainingPeaks cookies last several weeks. When a cookie expires, you will receive authentication errors. Run the authentication step again to refresh credentials.

Security

Credentials are stored in your system keyring and are not written to logs or error messages. An encrypted file fallback is available for headless environments. The MCP transport is stdio-based, preventing unintended network exposure, and the tool provides read-only access to TrainingPeaks data.

Development

If you are contributing or testing locally, install development dependencies and run the test suite to validate your changes.

Available tools

tp_get_workouts

Query workouts by date range (planned and completed) and retrieve basic workout lists.

tp_get_workout

Get detailed metrics for a single workout, including power, heart rate, cadence, and TSS.

tp_get_peaks

Compare power PRs (5sec to 90min) and running PRs (400m to marathon) to rank performance.

tp_get_fitness

Track training load metrics over time: CTL, ATL, and TSB.

tp_get_workout_prs

Fetch personal records set during a specific workout.