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.
npx -y @NitayRabi/fitbit-mcpOverview
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
Run via explicit CLI argument:
Example JSON configuration snippet for an AI assistant framework:
Obtaining a Fitbit access token (summary):
- Register an app at the Fitbit Developer Portal: https://dev.fitbit.com/apps/new
- Set OAuth 2.0 Application Type to “Personal” and Callback URL to “http://localhost:3000” (or your redirect).
- 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 name | What it returns | Common params |
|---|---|---|
| getUserProfile | Profile data (name, age, locale, goals) | none |
| getActivities | Activity summary & logs | date, period |
| getSleepLogs | Sleep stages and summaries | date |
| getHeartRate | HR time series and zones | date, period |
| getSteps | Step counts (intraday or aggregated) | date, period |
| getBodyMeasurements | Weight, body fat history | date, period |
| getFoodLogs | Logged foods and nutrients | date |
| getWaterLogs | Water intake entries | date |
| getLifetimeStats | Lifetime activity statistics | none |
| getUserSettings | Account settings and preferences | none |
| getFloorsClimbed | Floors climbed data | date, period |
| getDistance | Distance totals and intraday | date, period |
| getCalories | Calorie burn summaries | date, period |
| getActiveZoneMinutes | Active Zone Minutes | date, period |
| getDevices | Paired Fitbit devices info | none |
| getBadges | Earned badges and achievements | none |
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
(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:
- 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.