@thebriangao/totem

general MCP Server

Model Context Protocol server giving Claude (or any MCP client) full read + write access to your Whoop fitness data via the private reverse-engineered iOS API. 47 tools: recovery, sleep, strain, HRV trends, Strength Trainer, journal, Whoop Coach, and smart alarm. TypeScript + zod, auto-refresh Cognito auth.

VerifiedInstall ReadyReviewed
generalgeneraltypescript
4 views82 stars18 forksv1.4.4NOASSERTION

Why This Matters

Discovered via github-seeds:mcp-new and last synced 2mo ago.

VerifiedInstall ReadyReviewed
Source
github-seeds:mcp-new
Stars
82
Last synced
2mo ago
Install
Instructions detected

Install

1. Install the package

npx @thebriangao/totem

2. Add to claude_desktop_config.json

{
  "mcpServers": {
    "-thebriangao-totem": {
      "command": "npx",
      "args": [
        "@thebriangao/totem"
      ]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

27
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (27)

Capability

Tool

various

If recovery + sleep totals + workout list is enough for you, use the public OAuth API. If anything in the table is interesting, you need this. The iOS API was discovered via mitmproxy — full methodology in [`WHOOP.md`](WHOOP.md). --- ## What it does The MCP runs as a local Node process. It speaks **Model Context Protocol** over stdio (or HTTP for remote deployments), registers 48 tools at startup, and waits for tool calls from a connected MCP client. When a tool is called: 1. Authenticates via the cached Cognito access token (auto-refreshes if expired) 2. Issues HTTP requests to `api.prod.whoop.com` 3. Walks the response to extract a flat domain object (the **projection** step) 4. Validates the projected object against a zod schema (catches Whoop API drift) 5. Returns the structured JSON to the MCP client Writes follow the same path plus a **preview gate**: every write tool defaults `confirm: false`, returning a preview of what would be sent. Claude must explicitly re-call with `confirm: true` to fire. See [The 48 tools](#the-48-tools) for the full per-tool reference. --- ## Architecture ``` Claude Desktop / Code ──stdio──▶ src/server.ts ──▶ 48 tool handlers │ ┌──────────────────┼──────────────────┐ ▼ ▼ ▼ schemas (zod) projections (raw→flat) whoop/client │ ▼ HTTPS api.prod.whoop.com ``` ### Three layers per tool Every tool is a schema + projection + handler: - **`src/schemas/<tool>.ts`** — zod schema. The contract Claude sees. Used at runtime to validate the projection's output before returning. - **`src/projections/<tool>.ts`** — pure function turning Whoop's raw BFF response into a flat object. All the "Whoop puts this data over there, not where you'd expect" knowledge lives here. Tested against captured fixtures. - **`src/tools/v2/<tool>.ts`** — ~25-100 lines. Registers the tool, parses input args, calls the client, runs the projection, validates with zod, returns. Almost no logic in the tool file. That's all in the projection — which makes the codebase highly testable (projections are pure transformations, tested against `tests/fixtures/*.json` without hitting the network). ### Shape drift handling When Whoop changes a response shape, the projection emits unexpected data, zod's `.parse()` fails, and the MCP throws `WhoopProjectionError` instead of silently returning malformed data to Claude. Fix: use `whoop_raw` + `whoop_endpoints` to capture the new shape, update the projection, update the fixture, ship. > **Recent example:** in May 2026, Whoop migrated recovery + strain deep-dives from `GRAPHING_CARD` tiles (keyed by `content.title` like `"RECOVERY"`) to `SCORE_GAUGE` + `CONTRIBUTORS_TILE` items with stable `content.id` keys (`RECOVERY_SCORE_GAUGE`, `CONTRIBUTORS_TILE_HRV`). Other deep-dives still use the old card-based shape. The escape-hatch tools made the migration trivial to debug. --- ## The 48 tools Compact summary. **Full per-tool reference (input shape · source endpoints · output shape · notes) → [`TOOLS.md`](TOOLS.md).** Tools marked ⚠️ are writes (default `confirm: false`, preview-first). Tools marked 🔒 are gated — the catalog tool in the same group must be called once per session before they'll run.

Error

When

WhoopApiError

4xx with body

WhoopServerError

5xx

WhoopProjectionError

Projection output failed zod parse

Catalog

Entries

308

`whoop_journal_catalog`

372

`whoop_lift_catalog`

203

`whoop_sports_catalog`

311

`whoop_endpoints`

Variable

Required

WHOOP_EMAIL

Your Whoop account email

WHOOP_PASSWORD

yes (bootstrap only)

WHOOP_IOS_BEARER_TOKEN

From `totem auth` on your local machine (written to `.env`)

WHOOP_COGNITO_REFRESH_TOKEN

From `totem auth` on your local machine (written to `.env`)

WHOOP_USER_ID

From `.env` after running `totem auth`

WHOOP_TIMEZONE

no

WHOOP_INSTALLATION_ID

no (auto)

WHOOP_TOKEN_STORE

no

MCP_AUTH_TOKEN

Generate one with `openssl rand -hex 32` (or reuse the value from `.env.deploy` if you ran a deploy flow)

AUTH_PASSWORD

A password you'll type once when adding the Claude connector

PUBLIC_URL

Your Space's public URL — e.g. `https://<your-hf-username>-<your-space-name>.hf.space`

PORT

`7860` — HuggingFace's required port. Without this the container listens on 3000 and is unreachable.

Group

Commands

Approach

Pros

WhoopAuthExpiredError

401 from Whoop

Works Well With - Skills

revops

When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and proc

1104 starsHas guide

schema

When the user wants to add, fix, or optimize schema markup and structured data on their site. Also use when the user mentions "schema markup," "structured data," "JSON-LD," "rich snippets," "schema.org," "FAQ schema," "product schema," "review schema," "breadcrumb schema," "Google rich results," "knowledge panel," "star ratings in search," or "add structured data." Use this whenever someone wants their pages to show enhanced results in Google. For broader SEO issues, see seo-audit. For AI search

1104 starsHas guide

referrals

When the user wants to create, optimize, or analyze a referral program, affiliate program, or word-of-mouth strategy. Also use when the user mentions 'referral,' 'affiliate,' 'ambassador,' 'word of mouth,' 'viral loop,' 'refer a friend,' 'partner program,' 'referral incentive,' 'how to get referrals,' 'customers referring customers,' or 'affiliate payout.' Use this whenever someone wants existing users or partners to bring in new customers. For launch-specific virality, see launch.

1104 starsHas guide

social

When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms, or wants to do social listening and engagement triage. Also use when the user mentions 'LinkedIn post,' 'Twitter thread,' 'social media,' 'content calendar,' 'social scheduling,' 'engagement,' 'viral content,' 'what should I post,' 'repurpose this content,' 'tweet ideas,' 'LinkedIn carousel,' 'social media strategy,' 'grow my following,' 'Tik

1104 starsHas guide