The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the WHOOP MCP listing page.
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:
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
Two write-side tools talk to the WHOOP API; everything else reads Postgres only.
| Tool | Args | What it does |
|---|---|---|
whoop_auth_url | none | Returns the OAuth authorization URL to open in a browser. |
whoop_connect | code | Exchanges the OAuth code for tokens, stores them, returns the connected user. |
whoop_sync | days=7, full=false | Pulls data from WHOOP into Postgres. Returns per-collection counts and errors. |
whoop_status | none | Per-collection sync health: last sync, watermark, row count, last error. |
whoop_overview | days=7 | Latest recovery and vitals vs. 30-day baseline, last night's sleep, recent workouts and strain. |
whoop_recovery | days=7, limit=50 | Recent recovery scores, resting HR, HRV, SpO2, skin temperature. |
whoop_sleep | days=7, limit=50 | Recent sleeps and naps with stage breakdown, need, performance, efficiency. |
whoop_workouts | days=14, limit=50 | Recent workouts with strain, HR, energy, distance, and zone minutes. |
whoop_cycles | days=7, limit=50 | Recent physiological cycles (WHOOP days) with day strain and HR. |
whoop_baseline | none | 30-day mean and standard deviation per vital. |
days is capped at 365 and limit at 200. All tools return JSON text.
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.
The same flow is available as MCP tools (whoop_auth_url, whoop_connect,
whoop_sync) so an agent can drive the whole setup.
All configuration is by environment variable. The server validates every variable at startup and exits with a message naming each missing one.
| Variable | Required | Meaning |
|---|---|---|
WHOOP_CLIENT_ID | yes | Client ID of your WHOOP developer app. |
WHOOP_CLIENT_SECRET | yes | Client secret of your WHOOP developer app. |
WHOOP_REDIRECT_URI | yes | Redirect URI, exactly as registered on the app. Any URL works; the server does not listen on it. You copy the code from the address bar. |
WHOOP_DB_URL | yes | Postgres DSN, e.g. postgresql://user:pass@host:5432/db. Tokens and data live here. |
Claude Code:
Claude Desktop (claude_desktop_config.json) or any client that takes a
stdio command:
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:
days days, which catches late re-scores;newest_updated_at in
whoop_sync_state). If the last sync is older than days, the window is
stretched back to the watermark minus a two-day lookback so a gap never
leaves a hole;id, or cycle_id for recovery),
so overlapping windows are harmless and re-running is safe;whoop_sync_state and 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.
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 treat WHOOP_DB_URL as a secret.whoop_connect and whoop_sync
talk to WHOOP. Everything else is a SQL query against your database.read:* scopes plus offline for
refresh tokens. It cannot modify anything in your WHOOP account.whoop_tokens and remove the app from
your WHOOP account settings.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:
MIT. See LICENSE.