
WHOOP MCP
io.github.cunicopia-devPublished by GitHub account cunicopia-devv0.1.0Updated Oct 24, 2026
Sync WHOOP recovery, sleep, strain, and workouts into Postgres and query them from any MCP client.
Overview
Syncs WHOOP recovery, sleep, strain and workout data into a Postgres database you own, then lets an assistant query it offline through read-only MCP tools.
- What you can do
- Set up and authorize the WHOOP connection: get an OAuth authorization URL and exchange the returned code for stored tokens
- Sync WHOOP data into Postgres: pull cycles, recovery, sleep, workouts and body measurements for a chosen window or the full history, with per-collection counts and errors
- Check sync health: last sync time, watermark, row counts and last error per collection
- Read recovery and vitals: recent recovery scores, resting heart rate, HRV, SpO2 and skin temperature, plus a 30-day mean and standard deviation baseline
- Read sleep, workouts and cycles: stage breakdowns, sleep need and efficiency, workout strain, heart rate, energy, distance and zone minutes, and daily strain
- When to use it
- Useful when you want an assistant to answer questions about your own WHOOP history, such as comparing this week's HRV to a baseline, without hitting WHOOP API rate limits. It suits users who already run Postgres and are comfortable registering a WHOOP developer app and completing an OAuth flow.
- Requirements
- Runs locally over stdio as a Python package (Python 3.12+), typically via uvx or uv tool install. Needs a Postgres database (14+ is fine) and a WHOOP developer app. Required environment variables: WHOOP_CLIENT_ID, WHOOP_CLIENT_SECRET, WHOOP_REDIRECT_URI and WHOOP_DB_URL. The database schema must be created first, and network access to WHOOP is needed for sync.
Installation
In SourceWeft
- Open WHOOP MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit 328722c
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts