Athlete MCP

Athlete MCP

An open-source, Strava-first remote MCP server that enables users to authorize with Strava and ask AI about their training data.

Category
访问服务器

README

Athlete MCP

An open-source, Strava-first remote MCP server for ChatGPT, Claude, and Gemini clients.

Athlete MCP lets each user authorize with Strava and then ask an AI about their own training. It is a hosted, multi-user MCP service—not a local script and not a shared Strava token. The initial release is read-only by design.

Why this exists

FitMCP demonstrates a strong product shape: hosted onboarding, per-user sports connections, and one remote MCP URL. Athlete MCP keeps that low-friction shape but starts much narrower and deeper:

  • One-click delegated Strava authorization; no separate Athlete MCP password.
  • Streamable HTTP at /mcp, OAuth 2.1-style authorization code + PKCE, protected-resource metadata, refresh-token rotation, and dynamic client registration.
  • Encrypted Strava access and refresh tokens in PostgreSQL.
  • Deterministic analysis instead of asking the model to calculate from thousands of samples.
  • Rate-limit-aware caching and Strava webhook invalidation.
  • No raw GPS coordinates in tool requests or responses.
  • Read-only tools and least-privilege MCP annotations.

Tools

Tool Best use
strava_get_profile Athlete identity, recent totals, lifetime totals
strava_list_activities Find workouts and answer calendar/history questions
strava_get_activity Exact laps, splits, best efforts, and activity facts
strava_analyze_activity Power, HR zones, splits, aerobic decoupling, pacing
strava_training_summary Weekly volume, sport mix, consistency, Relative Effort
strava_compare_activities Compare repeated routes, races, or workouts

The analysis layer labels estimates and missing sensor data. Strava's activity API does not provide the sleep, HRV, Body Battery, or readiness data that a Garmin-native integration can expose.

Architecture

flowchart LR
  C["ChatGPT / Claude / Gemini client"] -->|"OAuth + Streamable HTTP"| M["Athlete MCP"]
  M -->|"Authorization code"| S["Strava OAuth"]
  M -->|"Encrypted token storage + cache"| P[("PostgreSQL")]
  M -->|"V3 API"| A["Strava API"]
  A -->|"Activity webhooks"| M

There are two separate trust boundaries:

  1. The MCP client authenticates to Athlete MCP. Athlete MCP issues short-lived access tokens and rotating refresh tokens.
  2. Athlete MCP authenticates to Strava for that athlete. Strava tokens are encrypted with AES-256-GCM before storage.

The user's Strava login is the Athlete MCP account. The authorization endpoint delegates directly to Strava, then returns an MCP authorization code to the requesting client.

Local setup

Requirements: Node.js 22+, Docker, and a registered Strava API application.

New Strava applications begin with an athlete capacity of 1 (Single Player Mode). The API settings dashboard can raise this to 10 once the app is configured; connecting more than 10 athletes requires Strava review. A technically public MCP server does not bypass this platform limit.

  1. Copy .env.example to .env and fill in the values.

  2. Set the Strava application's authorization callback domain to the hostname in PUBLIC_BASE_URL.

  3. Start PostgreSQL:

    docker compose up -d postgres
    
  4. Install and run:

    npm install
    npm run dev
    

Strava must redirect to:

https://YOUR_HOST/oauth/strava/callback

For local development, use an HTTPS tunnel and set PUBLIC_BASE_URL to the public tunnel URL. Remote AI clients cannot call localhost directly.

Webhooks

Register one Strava webhook subscription for the application. One subscription receives events for all athletes who authorized that Strava app.

curl -X POST https://www.strava.com/api/v3/push_subscriptions \
  -F client_id="$STRAVA_CLIENT_ID" \
  -F client_secret="$STRAVA_CLIENT_SECRET" \
  -F callback_url="https://YOUR_HOST/webhooks/strava" \
  -F verify_token="$STRAVA_WEBHOOK_VERIFY_TOKEN"

Activity events invalidate cached activity lists. Athlete deauthorization deletes the athlete connection and cascades deletion of MCP tokens and cached data.

Connect clients

Use the same endpoint for every client:

https://YOUR_HOST/mcp

Claude

In Claude, go to Customize → Connectors → Add custom connector, enter the MCP URL, and complete the OAuth flow. Claude remote connectors support Streamable HTTP, OAuth, refresh tokens, and dynamic client registration. See Anthropic's current custom connector guide.

Gemini CLI

gemini mcp add --transport http athlete-mcp https://YOUR_HOST/mcp

Then run /mcp auth athlete-mcp if authentication does not start automatically. Gemini CLI supports OAuth discovery and dynamic client registration for remote HTTP MCP servers. See the Gemini CLI MCP documentation.

ChatGPT

Create a custom app in Settings → Apps (or the workspace Apps settings), supply the MCP URL, scan tools, and complete OAuth. Availability is currently plan/workspace dependent; consult the current ChatGPT developer-mode documentation.

Production checklist

  • Terminate TLS at a trusted public hostname; never deploy OAuth over plain HTTP.
  • Run the SQL migrations before starting the app.
  • Store TOKEN_ENCRYPTION_KEY and the Strava client secret in a secret manager.
  • Back up PostgreSQL and test token-key rotation before production.
  • Add request-level rate limiting at the edge for registration, authorization, and token endpoints.
  • Add OpenTelemetry/audit events without logging bearer tokens, refresh tokens, activity descriptions, or tool payloads.
  • Configure Strava webhooks; default Strava limits are small enough that polling is not a viable multi-user design.
  • Upgrade the Strava application's athlete capacity and complete Strava review before promising open signup.
  • Complete a security review before enabling any future activity:write tool.
  • Publish a privacy policy and data deletion path before inviting external users.

Current limitations

  • No user-facing dashboard or token-revocation UI yet.
  • No weather correlation, route matching, or FIT-file ingestion yet.
  • No write tools. Strava cannot schedule structured workouts through the V3 activity API.
  • PostgreSQL migrations are plain SQL; there is no migration runner yet.
  • Tool output is English-only.

Development

npm run typecheck
npm test
npm run build

The project follows the MCP Streamable HTTP recommendation, the MCP authorization specification, and Strava's official OAuth, API reference, webhook, and rate-limit documentation.

License

MIT. See LICENSE.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选