mcp-fitbit

mcp-fitbit

1

The Fitbit MCP Server allows AI assistants to access and analyze Fitbit health data, providing features like exercise logs, sleep analysis, and nutrition tracking. Users can connect these insights with MCP-compatible AI tools for a comprehensive health overview.

Fitbit MCP Server

CI Coverage Status License: ISC TypeScript Node.js Fitbit API

Connect AI assistants to your Fitbit health data

Give your AI assistant access to your Fitbit data for personalized health insights, trend analysis, and automated tracking. Works with Claude Desktop and other MCP-compatible AI tools.

What it does

🏃 Exercise & Activities - Get detailed workout logs and activity data
😴 Sleep Analysis - Retrieve sleep patterns and quality metrics
⚖️ Weight Tracking - Access weight trends over time
❤️ Heart Rate Data - Monitor heart rate patterns and zones
🍎 Nutrition Logs - Review food intake, calories, and macros
👤 Profile Info - Access basic Fitbit profile details

Ask your AI things like: "Show me my sleep patterns this week" or "What's my average heart rate during workouts?"

Quick Start

🚀 Want to test the tools right away?

  1. Get Fitbit API credentials (see Installation below)
  2. Then run:
git clone https://github.com/TheDigitalNinja/mcp-fitbit
cd mcp-fitbit
npm install
# Create .env with your Fitbit credentials
npm run dev

This opens the MCP Inspector at http://localhost:5173 where you can test all tools interactively and handle the OAuth flow.

Installation

  1. Get Fitbit API credentials at dev.fitbit.com

    • Set OAuth 2.0 Application Type to Personal
    • Set Callback URL to http://localhost:3000/callback
  2. Create .env file:

    FITBIT_CLIENT_ID=your_client_id_here
    FITBIT_CLIENT_SECRET=your_client_secret_here
    
  3. Build the server:

    npm run build
    

Available Tools

ToolDescriptionParameters
get_weightWeight data over time periodsperiod: 1d, 7d, 30d, 3m, 6m, 1y
get_sleep_by_date_rangeSleep logs for date range (max 100 days)startDate, endDate (YYYY-MM-DD)
get_exercisesActivity/exercise logs after dateafterDate (YYYY-MM-DD), limit (1-100)
get_daily_activity_summaryDaily activity summary with goalsdate (YYYY-MM-DD)
get_activity_goalsUser's activity goals (daily/weekly)period: daily, weekly
get_activity_timeseriesActivity time series data (max 30 days)resourcePath, startDate, endDate (YYYY-MM-DD)
get_azm_timeseriesActive Zone Minutes time series (max 1095 days)startDate, endDate (YYYY-MM-DD)
get_heart_rateHeart rate for time periodperiod: 1d, 7d, 30d, 1w, 1m, optional date
get_heart_rate_by_date_rangeHeart rate for date range (max 1 year)startDate, endDate (YYYY-MM-DD)
get_food_logComplete nutrition data for a daydate (YYYY-MM-DD or "today")
get_nutritionIndividual nutrient over timeresource, period, optional date
get_nutrition_by_date_rangeIndividual nutrient for date rangeresource, startDate, endDate
get_profileUser profile informationNone

Nutrition resources: caloriesIn, water, protein, carbs, fat, fiber, sodium

Activity time series resources: steps, distance, calories, activityCalories, caloriesBMR, tracker/activityCalories, tracker/calories, tracker/distance

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "fitbit": {
      "command": "node",
      "args": ["C:\\path\\to\\mcp-fitbit\\build\\index.js"]
    }
  }
}

Config file locations:

  • Windows: %AppData%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

First Run Authorization

When you first ask your AI assistant to use Fitbit data:

  1. The server opens your browser to http://localhost:3000/auth
  2. Log in to Fitbit and grant permissions
  3. You'll be redirected to a success page
  4. Your AI can now access your Fitbit data!

Development

npm run lint          # Check code quality
npm run format        # Fix formatting
npm run build         # Compile TypeScript
npm run dev           # Run with MCP inspector

Architecture: See for improvement opportunities and technical details.