
WHOOP MCP
io.github.cunicopia-dev由 GitHub 帳號 cunicopia-dev 發布v0.1.0更新於 Oct 24, 2026
Sync WHOOP recovery, sleep, strain, and workouts into Postgres and query them from any MCP client.
概覽
把 WHOOP 的恢復、睡眠、負荷與訓練資料同步到你自己的 Postgres 資料庫,並讓助理透過唯讀 MCP 工具離線查詢。
- 可以做什麼
- 完成授權與連線:取得 OAuth 授權網址,並用回呼中的 code 換取並儲存權杖
- 同步 WHOOP 資料到 Postgres:依指定天數或全量抓取週期、恢復、睡眠、訓練與身體測量,並回傳各集合的筆數與錯誤
- 查看同步狀態:每個集合的最後同步時間、水位線、資料列數與最近錯誤
- 讀取恢復與生理指標:近期恢復分數、靜止心率、HRV、血氧與皮膚溫度,以及 30 天平均值與標準差基準
- 讀取睡眠、訓練與週期:睡眠階段、睡眠需求與效率,訓練負荷、心率、能量、距離與心率區間分鐘數,以及每日負荷
- 適用情境
- 適合希望助理回答個人 WHOOP 歷史資料問題(例如本週 HRV 與基準相比如何),且不想受 WHOOP API 限流影響的情境。前提是你已有 Postgres,並願意註冊 WHOOP 開發者應用程式、完成 OAuth 授權流程。
- 執行需求
- 以本機 stdio 方式執行的 Python 套件(Python 3.12+),通常透過 uvx 或 uv tool install 啟動。需要一個 Postgres 資料庫(14+ 即可)和一個 WHOOP 開發者應用程式。必要環境變數為 WHOOP_CLIENT_ID、WHOOP_CLIENT_SECRET、WHOOP_REDIRECT_URI 與 WHOOP_DB_URL。需先初始化資料庫 schema,同步時需能連上 WHOOP 網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 WHOOP MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
whoop-mcp
[Python] [License: MIT] [storage: Postgres] [MCP]
An MCP server that syncs your WHOOP data into Postgres and lets AI agents query it.
WHOOP's public API is rate-limited, cursor-paginated, and returns one record at a time. That is fine for a sync job and terrible for an agent that wants to answer "how does my HRV this week compare to my baseline?". So this server splits the job in two:
- a sync path that pulls cycles, recovery, sleep, workouts, and body measurements from the WHOOP API into a documented Postgres schema, keeping the raw JSON of every record alongside the typed columns;
- a query path of MCP tools that read Postgres only. They are fast, never hit WHOOP's rate limits, and keep working offline once data is synced.
Your data lands in a database you own, in a schema you can read with any SQL client, and nothing leaves your machine except calls to WHOOP itself.
Python 3.12+ · MIT · stdio MCP server + CLI · Postgres storage
Contents
- Tools
- Install
- Quickstart
- Configuration
- Register with an MCP client
- How sync works
- Security model
- Development
- Project layout
- License
Tools
Two write-side tools talk to the WHOOP API; everything else reads Postgres only.
days is capped at 365 and limit at 200. All tools return JSON text.
Install
Or run it without installing:
You also need a Postgres database (any recent version; 14+ is fine) and a WHOOP developer app. docs/SETUP.md walks through both.
Quickstart
The same flow is available as MCP tools (whoop_auth_url, whoop_connect,
whoop_sync) so an agent can drive the whole setup.
Configuration
All configuration is by environment variable. The server validates every variable at startup and exits with a message naming each missing one.
Register with an MCP client
Claude Code:
Claude Desktop (claude_desktop_config.json) or any client that takes a
stdio command:
How sync works
WHOOP's collection endpoints filter on when a record occurred, not when it
was last modified, and records change after creation (a sleep is created as
PENDING_SCORE and scored later). The sync therefore:
- always re-fetches the last
daysdays, which catches late re-scores; - tracks a per-collection watermark (
newest_updated_atinwhoop_sync_state). If the last sync is older thandays, the window is stretched back to the watermark minus a two-day lookback so a gap never leaves a hole; - upserts every record on its natural key (
id, orcycle_idfor recovery), so overlapping windows are harmless and re-running is safe; - records per-collection errors in
whoop_sync_stateand carries on with the other collections rather than aborting the run.
full=true (or whoop-mcp sync --all) drops the lower bound and walks the
account's entire history. Body measurements are a single current record and are
refreshed on every sync.
Token refresh is proactive (five minutes before expiry) and serialized through
a Postgres advisory lock, so the MCP server and a cron-driven whoop-mcp sync
can share one token row without racing.
The full data model is documented in docs/SCHEMA.md.
Security model
- Database access is token access. OAuth tokens are stored in plaintext in
whoop.whoop_tokens. Anyone who can read that table can call the WHOOP API as you until the refresh token is revoked. Restrict database grants accordingly and treatWHOOP_DB_URLas a secret. - Read tools never reach the network. Only
whoop_connectandwhoop_synctalk to WHOOP. Everything else is a SQL query against your database. - Nothing is written outside Postgres. No files, no caches, no telemetry.
- Scopes are read-only. The app requests
read:*scopes plusofflinefor refresh tokens. It cannot modify anything in your WHOOP account. - To revoke access, delete the row from
whoop_tokensand remove the app from your WHOOP account settings.
Development
The live tests apply the schema and truncate every table in the target database before each test. Point them at a scratch database.
A throwaway Postgres for local testing:
Project layout
License
MIT. See LICENSE.
來源:README.md,提交 328722c
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分