Expand description
Read-only WHOOP MCP server.
A Rust implementation of the whoop-ai-mcp
Model Context Protocol server. It exposes WHOOP recovery, sleep, strain,
workout, and personal analytics data to AI assistants over stdio or
Streamable HTTP, with identical tools, schemas, resources, and prompts.
Most users run the whoop-mcp binary; the library is exposed for embedding
and testing (for example server::McpServer with a custom api::WhoopApi).
Modulesยง
- api
- WHOOP REST API: endpoints, typed errors, client, and pagination.
- app
- Process entry: environment parsing, deferred WHOOP authentication, transport wiring, and CLI dispatch.
- auth
- WHOOP OAuth: token storage, browser authorization flow, and locking.
- cache
- In-memory cache with TTL expiry, LRU eviction, and in-flight request deduplication.
- catalog
- Tool definitions advertised by the server.
- cli
- Command-line subcommands:
setup,doctor, and client configuration helpers. - crypto
- Cryptographic helpers backed by
ring. - http_
util - Small helpers for hyper-based HTTP servers.
- js
- JavaScript-compatible primitives.
- logging
- Structured logger writing JSON lines (or a pretty format) to stderr.
- net
- Shared outbound HTTP client configuration (rustls with the
ringprovider). - prompts
- MCP prompts: conversation starters that reference tools and resources.
- resources
- MCP resources: ambient health context backed by the shared API cache.
- schema
- Validation of JSON values against the JSON Schemas advertised by the TypeScript server, using Zod parsing semantics.
- server
- MCP protocol handling: JSON-RPC dispatch, tool execution with input/output contracts, resources, prompts, and telemetry hooks.
- telemetry
- Opt-in, aggregate-only usage telemetry.
- tools
- Tool implementations (one module per tool family).
- transport
- MCP transports: stdio and Streamable HTTP (with the optional OAuth connector).