FI

FitBit MCP Server Unofficial API Integration

Explore the MCP server unofficial Fitbit API integration, connect and sync data via Fitbit's public API; not affiliated with Fitbit.

Quick Install
npx -y @NitayRabi/fitbit-mcp

Overview

The FitBit MCP Server is an unofficial Model Context Protocol (MCP) implementation that exposes Fitbit public API data to AI assistants and developer tools. It acts as a small bridge that translates locally-run MCP requests into authenticated calls to your Fitbit account, allowing AI agents or local apps to read profile, activity, sleep, heart rate, and other health-related records.

This server is useful when you want programmatic access to Fitbit telemetry inside an assistant or automation pipeline without building OAuth handling and endpoint mapping from scratch. It runs as a CLI/microservice (npx-friendly), supports stdio mode for MCP-style integrations, and relies on a Fitbit OAuth access token that you provide.

Disclaimer: This project is not affiliated with or endorsed by Fitbit Inc. It uses Fitbit’s public Web API and requires you to obtain and supply your own access token.

Features

  • MCP-compatible server for AI assistants (stdin/stdout / stdio mode)
  • Read-only access to a wide range of Fitbit data types: profile, activities, sleep, heart rate, steps, weight, food, water, devices, badges, etc.
  • Simple configuration via environment variable or CLI argument
  • Support for date and period parameters (YYYY-MM-DD, 1d/7d/30d)
  • Fast local run via npx with no global install
  • MIT-licensed, source available on GitHub

Installation / Configuration

Install and run the MCP server quickly using npx. Provide your Fitbit OAuth access token either as an environment variable or as a CLI argument.

Run via environment variable (recommended for MCP integrations):

FITBIT_ACCESS_TOKEN=YOUR_FITBIT_ACCESS_TOKEN npx -y fitbit-mcp --stdio

Run via explicit CLI argument:

npx -y fitbit-mcp --stdio --fitbit-token=YOUR_FITBIT_ACCESS_TOKEN

Example JSON configuration snippet for an AI assistant framework:

{
  "command": "npx",
  "args": ["-y", "fitbit-mcp", "--stdio"],
  "env": {
    "FITBIT_ACCESS_TOKEN": "YOUR_FITBIT_ACCESS_TOKEN"
  }
}

Obtaining a Fitbit access token (summary):

  1. Register an app at the Fitbit Developer Portal: https://dev.fitbit.com/apps/new
  2. Set OAuth 2.0 Application Type to “Personal” and Callback URL to “http://localhost:3000” (or your redirect).
  3. Use the OAuth 2.0 authorization flow to get an access token (Authorization Code flow). See Fitbit OAuth docs for details.

Available Tools

The MCP exposes a set of tools (methods) that correspond to common Fitbit API resources. Most accept optional parameters: date (YYYY-MM-DD, defaults to today) and period (1d, 7d, 30d, 1w, 1m).

Tool nameWhat it returnsCommon params
getUserProfileProfile data (name, age, locale, goals)none
getActivitiesActivity summary & logsdate, period
getSleepLogsSleep stages and summariesdate
getHeartRateHR time series and zonesdate, period
getStepsStep counts (intraday or aggregated)date, period
getBodyMeasurementsWeight, body fat historydate, period
getFoodLogsLogged foods and nutrientsdate
getWaterLogsWater intake entriesdate
getLifetimeStatsLifetime activity statisticsnone
getUserSettingsAccount settings and preferencesnone
getFloorsClimbedFloors climbed datadate, period
getDistanceDistance totals and intradaydate, period
getCaloriesCalorie burn summariesdate, period
getActiveZoneMinutesActive Zone Minutesdate, period
getDevicesPaired Fitbit devices infonone
getBadgesEarned badges and achievementsnone

Example JSON RPC-style request (MCP client -> server) might supply the tool name and params; the server returns JSON results directly from Fitbit API mappings.

Use Cases

  • AI assistant health summary: Query getUserProfile, getActivities, and getCalories to generate a daily health summary for the user.
  • Sleep trend analysis: Fetch getSleepLogs for a range of dates (period=7d or call per date) and feed results into a model to detect sleep pattern regressions.
  • Recovery recommendations: Combine getHeartRate (resting heart rate) and getActivities to suggest rest days or intensity adjustments.
  • Export or sync: Periodically fetch getSteps and getDistance and export to CSV or push to another analytics pipeline.
  • Device diagnostics: Use getDevices to list paired trackers and troubleshoot missing data.

Concrete CLI example (quick fetch of today’s steps):

FITBIT_ACCESS_TOKEN=TOKEN npx -y fitbit-mcp --stdio --tool=getSteps --date=$(date +%F)

(Usage varies by MCP client; the server accepts MCP tool invocations via stdio.)

Development & Contribution

  • Clone the repository, run npm install, build, and run in dev mode:
git clone https://github.com/NitayRabi/fitbit-mcp.git
cd fitbit-mcp
npm install
npm run build
npm run dev
  • Contributions: Fork, create a feature branch, commit, push, and open a pull request. CI builds and checks run on PRs.

License: MIT. Repository and source code available on GitHub: https://github.com/NitayRabi/fitbit-mcp

Notes: This is a read-only integration using Fitbit’s public API. Keep your access tokens secure and rotate them as needed.