WHOOP MCP Server
Enables access to WHOOP fitness and health data through all WHOOP v2 API endpoints. Supports OAuth 2.0 authentication and provides comprehensive access to user profiles, physiological cycles, recovery metrics, sleep analysis, and workout data.
README
WHOOP MCP Server
A Model Context Protocol (MCP) server that provides access to all WHOOP API endpoints. This server allows you to integrate WHOOP fitness and health data into your applications through the MCP standard.
Features
- Complete WHOOP API Coverage: Access to all WHOOP v2 API endpoints
- OAuth 2.0 Authentication: Secure authentication flow
- User Data: Profile information and body measurements
- Cycles: Physiological cycle data with strain and heart rate metrics
- Recovery: Recovery scores, HRV, and resting heart rate data
- Sleep: Detailed sleep analysis including stages and performance metrics
- Workouts: Exercise data with strain, heart rate zones, and activity metrics
- Pagination Support: Handle large datasets with pagination
- TypeScript: Full type safety and IntelliSense support
Prerequisites
- Node.js 18+
- WHOOP Developer Account
- WHOOP API credentials
Setup
1. Install Dependencies
npm install
2. WHOOP API Setup
- Go to the WHOOP Developer Platform
- Create a new application
- Note your
Client IDandClient Secret - Set your redirect URI (e.g.,
http://localhost:3000/callback)
3. Environment Configuration
Copy the example environment file and configure your WHOOP credentials:
cp env.example .env
Edit .env with your WHOOP API credentials:
# WHOOP API Configuration
WHOOP_CLIENT_ID=your_client_id_here
WHOOP_CLIENT_SECRET=your_client_secret_here
WHOOP_REDIRECT_URI=http://localhost:3000/callback
# MCP Server Configuration
MCP_SERVER_PORT=3001
4. Build and Run
# Build the project
npm run build
# Run the MCP server
npm start
# Or run in development mode
npm run dev
Authentication Flow
The MCP server supports OAuth 2.0 authentication with WHOOP. Here's how to authenticate:
- Get Authorization URL: Use the
whoop-get-authorization-urltool to get the OAuth URL - User Authorization: Direct users to the authorization URL
- Copy Authorization Code: When WHOOP redirects you back, copy the authorization code from the URL
- Share Code with Claude: IMPORTANT - You must copy and paste the authorization code directly to Claude in the chat
- Exchange Code: Claude will use the
whoop-exchange-code-for-tokentool with the authorization code - Set Access Token: Claude will use the
whoop-set-access-tokentool to set the access token for API calls
⚠️ Important Note About Authorization Codes
When you complete the WHOOP authorization in your browser, you'll be redirected to a URL that contains an authorization code. You must copy this code and paste it directly into your chat with Claude. The code will look something like this in the URL:
http://localhost:3000/callback?code=ABC123XYZ789&scope=read:recovery%20read:cycles...
Copy the code parameter value (e.g., ABC123XYZ789) and paste it in your chat with Claude. Claude will then use this code to exchange it for an access token and set up the connection to your WHOOP data.
Available Tools
User Tools
whoop-get-user-profile- Get basic user profile informationwhoop-get-user-body-measurements- Get body measurements (height, weight, max heart rate)whoop-revoke-user-access- Revoke user access token
Cycle Tools
whoop-get-cycle-by-id- Get specific cycle data by IDwhoop-get-cycle-collection- Get paginated list of cycleswhoop-get-sleep-for-cycle- Get sleep data for a specific cycle
Recovery Tools
whoop-get-recovery-collection- Get paginated recovery datawhoop-get-recovery-for-cycle- Get recovery data for a specific cycle
Sleep Tools
whoop-get-sleep-by-id- Get specific sleep record by IDwhoop-get-sleep-collection- Get paginated sleep records
Workout Tools
whoop-get-workout-by-id- Get specific workout record by IDwhoop-get-workout-collection- Get paginated workout records
OAuth Tools
whoop-get-authorization-url- Get OAuth authorization URLwhoop-exchange-code-for-token- Exchange authorization code for access tokenwhoop-refresh-token- Refresh access tokenwhoop-set-access-token- Set access token for API calls
Usage Examples
Getting User Profile
// First set your access token
await callTool('whoop-set-access-token', { accessToken: 'your_access_token' });
// Then get user profile
const profile = await callTool('whoop-get-user-profile', {});
Getting Recent Cycles
const cycles = await callTool('whoop-get-cycle-collection', {
limit: 10,
start: '2024-01-01T00:00:00Z'
});
Getting Sleep Data
const sleepData = await callTool('whoop-get-sleep-collection', {
limit: 5,
end: '2024-01-31T23:59:59Z'
});
Getting Workout Data
const workouts = await callTool('whoop-get-workout-collection', {
limit: 10,
start: '2024-01-01T00:00:00Z'
});
Data Types
The server provides comprehensive TypeScript types for all WHOOP API responses:
- User Data: Profile information, body measurements
- Cycles: Strain scores, heart rate data, kilojoule expenditure
- Recovery: Recovery scores, HRV, resting heart rate, SpO2, skin temperature
- Sleep: Sleep stages, performance metrics, respiratory rate, efficiency
- Workouts: Activity strain, heart rate zones, distance, altitude data
Pagination
Most collection endpoints support pagination with the following parameters:
limit: Number of records to return (max 25)start: Start time filter (ISO 8601)end: End time filter (ISO 8601)nextToken: Token for next page
Error Handling
The MCP server includes comprehensive error handling:
- Invalid credentials
- Rate limiting
- Network errors
- Invalid parameters
- Missing required fields
Development
Project Structure
src/
├── index.ts # Main entry point
├── mcp-server.ts # MCP server implementation
├── whoop-api.ts # WHOOP API client
└── types.ts # TypeScript type definitions
Available Scripts
npm run build- Build the TypeScript projectnpm start- Run the built servernpm run dev- Run in development mode with hot reloadnpm run watch- Watch for changes and rebuild
Adding New Endpoints
To add new WHOOP API endpoints:
- Add the endpoint method to
WhoopApiClientinwhoop-api.ts - Add corresponding types to
types.ts - Add the tool definition and handler to
mcp-server.ts
WHOOP API Documentation
For detailed information about the WHOOP API, visit:
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the WHOOP API documentation
- Review the error messages from the MCP server
- Ensure your OAuth credentials are correctly configured
- Verify your access token is valid and not expired
Migration Notice
IMPORTANT: WHOOP v2 API is now available and migration is required by October 1, 2025. The current v1 API and webhooks will be removed after this date. This MCP server uses the v2 API.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。