Domestique

Domestique

Integrates with Intervals.icu, Whoop, and TrainerRoad to provide unified access to fitness data, including completed workouts, recovery metrics, planned training, and performance trends across all sports.

Category
访问服务器

README

Domestique

A TypeScript MCP (Model Context Protocol) server that integrates with Intervals.icu, Whoop, and TrainerRoad to provide unified access to fitness data across all activities and sports.

Features

  • Query completed workouts from Intervals.icu
  • Access recovery metrics (HRV, sleep, recovery score) from Whoop
  • View planned workouts from TrainerRoad and Intervals.icu calendars
  • Analyze fitness trends (CTL/ATL/TSB)
  • Cross-platform activity matching

Available Tools

Current/Today

  • get_todays_recovery - Today's Whoop recovery, sleep, and HRV data
  • get_todays_strain - Today's Whoop strain data including strain score, heart rate, and calories
  • get_todays_completed_workouts - Today's completed workouts from Intervals.icu
  • get_todays_planned_workouts - Today's scheduled workouts from both TrainerRoad and Intervals.icu calendars

Historical/Trends

  • get_workout_history - Historical workouts with matched Whoop strain data. Supports ISO dates or natural language (e.g., "30 days ago"). Returns expanded metrics including speed, cadence, efficiency, power data, and per-activity fitness snapshot
  • get_strain_history - Whoop strain scores and activities for a date range
  • get_recovery_trends - HRV, sleep, and recovery patterns over time with summary statistics
  • get_training_load_trends - Training load trends including CTL (fitness), ATL (fatigue), TSB (form), ramp rate, and ACWR for injury risk. Takes number of days (default: 42). Returns daily data sorted oldest to newest

Planning

  • get_upcoming_workouts - Planned workouts for a future date range from both TrainerRoad and Intervals.icu calendars
  • get_planned_workout_details - Detailed information about a specific planned workout by ID or date

Setup

Prerequisites

  • Node.js 20+
  • Intervals.icu account with API key
  • Whoop account with OAuth credentials
  • TrainerRoad account with calendar feed URL

Environment Variables

Copy .env.example to .env and fill in your credentials:

cp .env.example .env

Required variables:

  • MCP_AUTH_TOKEN - Secret token for MCP authentication

For Intervals.icu integration:

  • INTERVALS_API_KEY - Your Intervals.icu API key
  • INTERVALS_ATHLETE_ID - Your Intervals.icu athlete ID

For Whoop integration:

  • WHOOP_CLIENT_ID
  • WHOOP_CLIENT_SECRET
  • WHOOP_REDIRECT_URI - Defaults to http://localhost:3000/callback
  • REDIS_URL - Required for token storage (e.g., redis://localhost:6379)

For TrainerRoad integration:

  • TRAINERROAD_CALENDAR_URL - Private iCal feed URL

Whoop OAuth Setup

Whoop uses OAuth 2.0, which requires a one-time authorization flow to obtain refresh tokens. The refresh tokens are single-use, so each time the server refreshes the access token, it receives a new refresh token that gets stored in Redis.

First-time setup:

  1. Create a Whoop developer app at https://developer.whoop.com to get your WHOOP_CLIENT_ID and WHOOP_CLIENT_SECRET

  2. Make sure Redis is running and REDIS_URL is set in your .env

  3. Start the Docker environment:

    docker compose up -d
    
  4. Run the OAuth setup script:

    docker compose exec domestique npm run whoop:auth
    
  5. The script will display an authorization URL. Open it in your browser and log in to Whoop

  6. After authorizing, you'll be redirected to a URL like:

    http://localhost:3000/callback?code=AUTHORIZATION_CODE
    
  7. Copy the code parameter value and paste it into the script

  8. The script exchanges the code for tokens and stores them in Redis. You're done!

The server will automatically refresh tokens as needed and store new refresh tokens in Redis.

Common Commands

Docker Commands

All commands should be run in the Docker container:

# Start development server with hot reload
docker compose up

# Start in background
docker compose up -d

# View logs
docker compose logs domestique -f

# Restart container
docker compose restart domestique

# Stop containers
docker compose down

# Rebuild containers after dependency changes
docker compose build

# Run commands in container
docker compose exec domestique <command>

# Examples:
docker compose exec domestique npm run typecheck
docker compose exec domestique npm run whoop:auth

Testing with MCP Inspector

The MCP Inspector is a useful tool for testing and debugging your MCP server:

# Install MCP Inspector globally (if not already installed)
npm install -g @modelcontextprotocol/inspector

# Run inspector pointing to your local server
npx @modelcontextprotocol/inspector http://localhost:3000/mcp?token=YOUR_SECRET_TOKEN

# Or with Authorization header (if your terminal supports it)
npx @modelcontextprotocol/inspector http://localhost:3000/mcp \
  --header "Authorization: Bearer YOUR_SECRET_TOKEN"

The inspector will open a web interface where you can:

  • Browse available tools
  • Test tool calls with different parameters
  • View request/response payloads
  • Debug connection issues

Local Development

Using Docker Compose (recommended)

# Start development server with hot reload
docker compose up

# Server runs at http://localhost:3000

Using Node.js directly

# Install dependencies
npm install

# Run in development mode with hot reload
npm run dev

# Or build and run production
npm run build
npm start

Deployment to Fly.io

1. Install Fly CLI and Login

curl -L https://fly.io/install.sh | sh
fly auth login

2. Deploy Redis

Redis is required for Whoop token storage. Deploy it first:

cd fly-redis

# Create the Redis app (first time only)
fly apps create domestique-redis

# Create a volume for persistence
fly volumes create redis_data --region iad --size 1

# Deploy Redis
fly deploy

cd ..

3. Deploy Domestique

# Create the app (first time only)
fly apps create domestique

# Set secrets
fly secrets set MCP_AUTH_TOKEN=your-secret-token
fly secrets set INTERVALS_API_KEY=your-api-key
fly secrets set INTERVALS_ATHLETE_ID=your-athlete-id
fly secrets set WHOOP_CLIENT_ID=your-client-id
fly secrets set WHOOP_CLIENT_SECRET=your-client-secret
fly secrets set REDIS_URL=redis://domestique-redis.internal:6379

# Deploy
fly deploy

# View logs
fly logs

4. Set Up Whoop Tokens (if using Whoop)

After deploying, run the OAuth setup to get initial Whoop tokens:

fly ssh console -C "npm run whoop:auth"

Follow the prompts to authorize with Whoop and store the tokens in Redis.

Connecting to Claude

Add this MCP server to your Claude configuration. The server supports two authentication methods:

Method 1: Authorization Header (Recommended)

{
  "mcpServers": {
    "domestique": {
      "url": "https://domestique.fly.dev/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_SECRET_TOKEN"
      }
    }
  }
}

Method 2: Query Parameter (For Claude UI)

If you're using Claude's custom connector UI (which doesn't support custom headers), use the query parameter method:

{
  "mcpServers": {
    "domestique": {
      "url": "https://domestique.fly.dev/mcp?token=YOUR_SECRET_TOKEN"
    }
  }
}

Note: Replace YOUR_SECRET_TOKEN with your actual MCP_AUTH_TOKEN value.

Example Queries

Once connected, you can ask Claude:

  • "How did my workout go today?"
  • "What's my recovery like this morning?"
  • "Show me my fitness trends for the last month"
  • "What workouts do I have planned this week?"
  • "How has my HRV trended compared to my training load?"

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选