TrainingPeaks-MCP

TrainingPeaks-MCP

TrainingPeaks MCP server for Claude Desktop and AI assistants. Query workouts, analyze fitness, power peaks and more.

Category
访问服务器

README

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 your workouts, analyze training load, compare power data, and track fitness trends 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 questions like:

  • "Compare my FTP progression this year vs last year"
  • "What was my TSS ramp rate in the 6 weeks before my best 20-min power?"
  • "Am I ready to race? Show my form trend and recent workout quality"
  • "Which days of the week do I typically train hardest?"
  • "Find weeks where I exceeded 800 TSS and show what happened to my form after"

Features

Tool Description
tp_get_workouts Query workouts by date range (planned and completed)
tp_get_workout Get detailed metrics for a single workout
tp_get_peaks Compare power PRs (5sec to 90min) and running PRs (400m to marathon)
tp_get_fitness Track CTL, ATL, and TSB (fitness, fatigue, form)
tp_get_workout_prs See personal records set in a specific session

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, 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

Other auth commands:

tp-mcp auth-status  # Check if authenticated
tp-mcp auth-clear   # Remove stored cookie

Step 4: Add to Claude Desktop

Run this to get your config snippet:

tp-mcp config

Edit ~/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!


Tool Reference

tp_get_workouts

List workouts in a date range. Max 90 days per query.

{ "start_date": "2026-01-01", "end_date": "2026-01-07", "type": "completed" }

tp_get_workout

Get full details for one workout including power, HR, cadence, TSS.

{ "workout_id": "123456789" }

tp_get_peaks

Get ranked personal records. Bike: power metrics. Run: pace/speed metrics.

{ "sport": "Bike", "pr_type": "power20min", "days": 365 }

Bike types: power5sec, power1min, power5min, power10min, power20min, power60min, power90min

Run types: speed400Meter, speed1K, speed5K, speed10K, speedHalfMarathon, speedMarathon

tp_get_fitness

Get training load metrics over time.

{ "days": 90 }

Returns daily CTL (chronic training load / fitness), ATL (acute training load / fatigue), and TSB (training stress balance / form).

tp_get_workout_prs

Get PRs set during a specific workout.

{ "workout_id": "123456789" }

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, never shown to Claude, and only ever sent to TrainingPeaks. The server is read-only and has no network ports.

This server is designed with defense-in-depth. Your TrainingPeaks session cookie is sensitive - it grants access to your training data - so we treat it accordingly.

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 Fernet symmetric encryption with a machine-specific key.

Cookie Never Leaks to AI

The AI assistant (Claude) never sees your cookie value. Multiple layers ensure this:

  1. Return value sanitization: Tool results are scrubbed for any keys containing cookie, token, auth, credential, password, or secret before being sent to Claude
  2. Masked repr(): The BrowserCookieResult class overrides __repr__ to show cookie=<present> instead of the actual value
  3. Sanitized exceptions: Error messages use only exception type names, never full messages that could contain data
  4. 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.

Read-Only Access

This server provides read-only access to TrainingPeaks:

  • ✅ Query workouts, fitness metrics, personal records
  • ❌ Cannot create, modify, or delete workouts
  • ❌ Cannot change account settings
  • ❌ Cannot access billing or payment info

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.

What This Server Cannot Do

Action Possible?
Read your workouts ✅ Yes
Read your fitness metrics ✅ Yes
Modify any TrainingPeaks data ❌ No
Access other websites ❌ No (domain hardcoded)
Send your cookie anywhere except TrainingPeaks ❌ No
Expose your cookie to Claude ❌ No (sanitized)
Open network ports ❌ No (stdio only)

Open Source

This server is fully open source. You can audit every line of code before running it. Key security files:

Cookie Expiration

Training Peaks session cookies last several weeks. When expired, tools will return auth errors. Run tp-mcp auth again with a fresh cookie from your browser.

Development

pip install -e ".[dev]"
pytest tests/ -v
mypy src/
ruff check src/

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选