WHOOP MCP Server

WHOOP MCP Server

Exposes WHOOP recovery, sleep, strain, and workout metrics to MCP-compatible AI assistants using OAuth 2.0 authentication, enabling daily wellbeing snapshots, trend analysis, and workload recommendations.

Category
访问服务器

README

WHOOP MCP Server

WHOOP MCP Server is a TypeScript Model Context Protocol (MCP) server that gives MCP-compatible assistants access to personal WHOOP recovery, sleep, strain, and workout data.

The server runs locally over stdio. It authenticates with WHOOP through OAuth 2.0, stores reusable tokens on disk, refreshes tokens when needed, and exposes structured tools that assistants can use for workload planning and recovery-aware context.

Features

  • Daily WHOOP recovery, sleep, cycle strain, and workout snapshots
  • Sleep-stage and sleep-performance summaries
  • Recovery score, HRV, resting heart rate, SpO2, and skin temperature summaries
  • Short-window versus long-window trend analysis
  • Historical baseline profiles
  • Change alerts versus yesterday and personal baseline
  • Workload guardrails based on recovery signals
  • Local OAuth token cache with refresh-token support

Requirements

  • Node.js 20 or newer
  • npm
  • A WHOOP account
  • A WHOOP Developer Dashboard app

Create the WHOOP app at:

https://developer-dashboard.whoop.com

The app must have a redirect URI registered. The default used by this project is:

whoop://mcp/callback

Quick Start

Install dependencies:

npm install

Run the setup wizard:

npm run setup

The wizard asks for:

  • WHOOP Client ID
  • WHOOP Client Secret
  • Redirect URI
  • Token cache folder
  • OAuth scopes

It then opens the WHOOP authorization page in your browser, exchanges the authorization code for tokens, writes the token cache, and offers to create a local .env file.

Build the MCP server:

npm run build

Authentication

WHOOP uses OAuth 2.0 Authorization Code flow for API access. This project does not collect or store your WHOOP username or password.

The setup wizard stores API tokens in:

.whoop-tokens/tokens.json

By default it also offers to write local MCP settings to:

.env

Both .env and .whoop-tokens/ are ignored by git.

The default OAuth scopes are:

read:profile read:body_measurement read:recovery read:cycles read:sleep read:workout offline

The offline scope is required for refresh-token support. Without it, the server may require a new browser login when the access token expires.

Redirect URI Behavior

WHOOP supports redirect URLs such as https://... and custom schemes such as whoop://....

With the default whoop://mcp/callback redirect, the setup wizard asks you to paste the final redirected URL from the browser after approving access. If your WHOOP app is configured with a loopback redirect such as http://127.0.0.1:8787/callback, the wizard can capture the callback automatically with a temporary local HTTP server.

MCP Tools

Tool Description
whoop_wellbeing_snapshot Returns recovery, sleep, cycle strain, workouts, and a workload recommendation for a date.
whoop_sleep_summary Returns sleep-stage, sleep-performance, recovery, HRV, and resting-heart-rate context.
whoop_training_load_trend Compares short-window and long-window trends for sleep, recovery, HRV, resting heart rate, and day strain.
whoop_baseline_profile Computes baseline ranges over a historical window.
whoop_change_alerts Highlights meaningful changes versus yesterday and baseline.
whoop_workload_guard Evaluates a proposed workload against current recovery signals.

MCP Resource

Resource Description
whoop://wellbeing/today Today's WHOOP wellbeing snapshot as JSON.

MCP Prompt

Prompt Description
whoop_workload_guardrails Guidance for using WHOOP data during workload planning without treating it as medical advice.

Configuration

The setup wizard can create .env automatically. You can also create it manually:

Copy-Item .env.example .env

Supported environment variables:

Variable Required Description
WHOOP_CLIENT_ID Yes OAuth Client ID from the WHOOP Developer Dashboard.
WHOOP_CLIENT_SECRET Yes OAuth Client Secret from the WHOOP Developer Dashboard.
WHOOP_REDIRECT_URI Yes Registered OAuth redirect URI. Defaults to whoop://mcp/callback.
WHOOP_TOKEN_DIR Yes Directory used to read and write WHOOP OAuth tokens. Defaults to .whoop-tokens.
WHOOP_SCOPES No Space- or comma-separated OAuth scopes. Defaults to the scopes listed above.

Use an absolute WHOOP_TOKEN_DIR when configuring an MCP client. MCP clients often start servers from a different working directory, and an absolute path avoids token-cache lookup problems.

Running Locally

Validate the project:

npm run typecheck
npm run build

Start the MCP server:

npm run start

The server communicates over stdio, so it will appear idle in a normal terminal until an MCP client connects.

Codex Configuration

Example Codex MCP configuration:

[mcp_servers.whoop]
command = "node"
args = ["C:\\path\\to\\whoop-mcp-server\\dist\\index.js"]

[mcp_servers.whoop.env]
WHOOP_CLIENT_ID = "your-client-id"
WHOOP_CLIENT_SECRET = "your-client-secret"
WHOOP_REDIRECT_URI = "whoop://mcp/callback"
WHOOP_TOKEN_DIR = "C:\\path\\to\\whoop-mcp-server\\.whoop-tokens"

Restart Codex after updating the configuration.

Claude Desktop Configuration

Example Claude Desktop MCP configuration:

{
  "mcpServers": {
    "whoop": {
      "command": "node",
      "args": ["C:\\path\\to\\whoop-mcp-server\\dist\\index.js"],
      "env": {
        "WHOOP_CLIENT_ID": "your-client-id",
        "WHOOP_CLIENT_SECRET": "your-client-secret",
        "WHOOP_REDIRECT_URI": "whoop://mcp/callback",
        "WHOOP_TOKEN_DIR": "C:\\path\\to\\whoop-mcp-server\\.whoop-tokens"
      }
    }
  }
}

Restart Claude Desktop after updating the configuration.

Troubleshooting

If setup fails:

  • Confirm the Client ID and Client Secret are copied from the WHOOP Developer Dashboard.
  • Confirm the redirect URI entered in the terminal exactly matches a redirect URI registered on the WHOOP app.
  • Confirm the app has access to the requested scopes.
  • Delete .whoop-tokens/ and run npm run setup again if tokens are stale.

If the MCP client cannot fetch WHOOP data:

  • Confirm npm run build completed successfully.
  • Confirm dist/index.js exists.
  • Use an absolute WHOOP_TOKEN_DIR in the MCP client configuration.
  • Include WHOOP_CLIENT_ID and WHOOP_CLIENT_SECRET in the MCP client environment so token refresh can work.
  • Restart the MCP client after changing configuration.

If token refresh fails:

  • Confirm WHOOP_SCOPES includes offline.
  • Run npm run setup again to create a fresh token cache.
  • Avoid running multiple server instances against the same token cache at the same time. WHOOP refresh tokens can rotate, and concurrent refreshes may invalidate one instance's cached token.

Security

  • Do not commit .env or .whoop-tokens/.
  • Treat WHOOP data as private health-related information.
  • Keep the WHOOP Client Secret local to trusted machines.
  • Revoke the WHOOP app or delete the token cache if a machine is lost or no longer trusted.

Development

npm run dev
npm run setup
npm run typecheck
npm run build

推荐服务器

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

官方
精选