Fitbit MCP server

Integrates with Fitbit to provide access to personal health data including weight measurements, sleep logs, and profile information through OAuth 2.0 authentication for enhanced health tracking and fitness analysis.
Back to servers
Setup instructions
Provider
TheDigitalNinja
Release date
May 03, 2025
Stats
6 stars

The MCP Fitbit Connector provides AI assistants with access to your Fitbit health data, enabling personalized insights, trend analysis, and automated tracking. It works with Claude Desktop and other MCP-compatible AI tools to analyze your exercise, sleep, weight, heart rate, and nutrition data.

Installation Options

Option 1: Install from NPM (Recommended)

  1. Get Fitbit API credentials:

    • Visit dev.fitbit.com
    • Create an app with OAuth 2.0 Application Type: Personal
    • Set Callback URL: http://localhost:3000/callback
    • Note your Client ID and Client Secret
  2. Install the package globally:

    npm install -g mcp-fitbit
    
  3. Add to your Claude Desktop config file:

    {
      "mcpServers": {
        "fitbit": {
          "command": "mcp-fitbit",
          "args": [],
          "env": {
            "FITBIT_CLIENT_ID": "your_client_id_here",
            "FITBIT_CLIENT_SECRET": "your_client_secret_here"
          }
        }
      }
    }
    

    Config file location:

    • Windows: %AppData%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  4. Restart Claude Desktop and ask about your Fitbit data!

Option 2: Using Environment File

  1. Get Fitbit API credentials (as described above)

  2. Install the package globally:

    npm install -g mcp-fitbit
    
  3. Create .env file: When you run mcp-fitbit for the first time, it will tell you where to create the .env file. It will look something like:

    C:\Users\YourName\AppData\Roaming\npm\node_modules\mcp-fitbit\.env
    
  4. Add your credentials to the .env file:

    FITBIT_CLIENT_ID=your_client_id_here
    FITBIT_CLIENT_SECRET=your_client_secret_here
    
  5. Run the server:

    mcp-fitbit
    

Option 3: From Source (for Developers)

  1. Get Fitbit API credentials (as described above)

  2. Clone and setup:

    git clone https://github.com/TheDigitalNinja/mcp-fitbit
    cd mcp-fitbit
    npm install
    
  3. Create .env file:

    FITBIT_CLIENT_ID=your_client_id_here
    FITBIT_CLIENT_SECRET=your_client_secret_here
    
  4. Build and run the server:

    npm run build
    npm run dev
    

Using the MCP Fitbit Connector

Authorization

On first use:

  1. The server will open 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

Available Tools

You can use the following tools through your AI assistant:

Tool Description Parameters
get_weight Weight data over time period: 1d, 7d, 30d, 3m, 6m, 1y
get_sleep_by_date_range Sleep logs for date range startDate, endDate (YYYY-MM-DD)
get_exercises Activity/exercise logs afterDate (YYYY-MM-DD), limit (1-100)
get_daily_activity_summary Daily activity summary date (YYYY-MM-DD)
get_activity_goals User's activity goals period: daily, weekly
get_activity_timeseries Activity time series data resourcePath, startDate, endDate
get_azm_timeseries Active Zone Minutes data startDate, endDate (YYYY-MM-DD)
get_heart_rate Heart rate for time period period: 1d, 7d, 30d, 1w, 1m, optional date
get_heart_rate_by_date_range Heart rate for date range startDate, endDate (YYYY-MM-DD)
get_food_log Nutrition data for a day date (YYYY-MM-DD or "today")
get_nutrition Individual nutrient over time resource, period, optional date
get_nutrition_by_date_range Nutrient for date range resource, startDate, endDate
get_profile User profile information None

Example Queries for Your AI

  • "Show me my sleep patterns this week"
  • "What's my average heart rate during workouts?"
  • "How many steps did I take last month?"
  • "What's my weight trend over the past 6 months?"
  • "Show me my nutrition breakdown for yesterday"

Testing with MCP Inspector

The MCP Inspector is available at http://localhost:5173 when running the server. You can use it to test all tools interactively and handle the OAuth flow before using with your AI assistant.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "fitbit" '{"command":"mcp-fitbit","args":[],"env":{"FITBIT_CLIENT_ID":"your_client_id_here","FITBIT_CLIENT_SECRET":"your_client_secret_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "fitbit": {
            "command": "mcp-fitbit",
            "args": [],
            "env": {
                "FITBIT_CLIENT_ID": "your_client_id_here",
                "FITBIT_CLIENT_SECRET": "your_client_secret_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "fitbit": {
            "command": "mcp-fitbit",
            "args": [],
            "env": {
                "FITBIT_CLIENT_ID": "your_client_id_here",
                "FITBIT_CLIENT_SECRET": "your_client_secret_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later