fitbit-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> **Retired. Use google-health-mcp instead.**
>
> The Fitbit Web API shuts down on **30 September 2026**. Fitbit has also stopped accepting new app registrations, so this package can no longer be set up from scratch: step 2 below needs a registered personal app and there is no longer a way to create one. An existing install keeps working until the shutdown date.
>
> google-health-mcp covers the same measurements through the Google Health API, and adds ECG and irregular-rhythm notifications. It reads history from Google rather than from this package's cache, so there is nothing to migrate: install it and run one backfill.
>
> Not everything carries over. Fitbit's activity goals and its server-side lifetime totals have no equivalent there, and among the fields Google does not serve are heart rate zones, the active-minutes breakdown, VO2 max as a range rather than a single number, sleep efficiency, SpO2 high and low, and BMI. After 30 September this package can no longer fetch them either, so copy your fitbit.db before then if you want to keep them.
MCP server for the Fitbit Web API with OAuth PKCE, local SQLite cache, and trend analysis.
Designed for Claude Code and other MCP clients. Syncs your Fitbit data to a local database for fast, offline queries - no API calls needed after the initial sync.
Features
- **OAuth 2.0 PKCE** - Secure auth flow, no client secret needed
- **Local SQLite cache** - Sync once, query instantly
- **Incremental sync** - Only fetches new data since last sync
- **MCP tools** - Sync, query (cached data types plus live-only devices/lifetime/goals), and trend analysis
- **Live mode** - Bypass cache and query the API directly
- **CLI** - Auth setup, sync, and JSON import from the command line
- **Rate limit handling** - Activity and food log syncs sleep and retry on 429; other data types report rate_limited and resume on the next sync
Data types
| Tool | Data |
|------|------|
| fitbit_get_heart_rate | Resting HR, HR zones |
| fitbit_get_activity | Steps, calories, active minutes, distance |
| fitbit_get_exercises | Exercise sessions (name, duration, HR, calories) |
| fitbit_get_sleep | Duration, efficiency, sleep stages |
| fitbit_get_weight | Weight, BMI, body fat % |
| fitbit_get_spo2 | Blood oxygen saturation (avg/min/max) |
| fitbit_get_hrv | Heart rate variability (RMSSD) |
| fitbit_get_azm | Active Zone Minutes with per-zone breakdown |
| fitbit_get_breathing_rate | Nightly breaths per minute |
| fitbit_get_skin_temperature | Nightly skin temperature variation (degrees C from baseline) |
| fitbit_get_core_temperature | Manually-logged core (body) temperature readings (degrees C) |
| fitbit_get_cardio_fitness | VO2 Max / Cardio Fitness Score |
| fitbit_get_food_log | Daily food calories + water intake |
| fitbit_get_devices | Paired devices, battery level, last sync (live) |
| fitbit_get_lifetime_stats | All-time totals and personal best records (live) |
| fitbit_get_goals | User-set daily/weekly activity goals (live) |
| fitbit_trends | Aggregated averages (weekly/monthly/quarterly) |
Requirements
- Python 3.13+ (tested on 3.13 and 3.14 in CI)
- A Fitbit developer account with a registered personal app
Setup
1. Install
Or run it without installing:
For development from a clone:
2. Register a Fitbit app
1. Go to dev.fitbit.com/apps and create a new app
2. Set **OAuth 2.0 Application Type** to **Personal**
3. Set **Redirect URL** to http://localhost:8080
4. Note your **Client ID** (you won't need the client secret - PKCE doesn't use one)
3. Authenticate
This opens your browser for Fitbit login, exchanges the auth code via PKCE, and saves tokens locally.
Tokens are stored in ~/.config/fitbit-mcp/fitbit_tokens.json with 0600 permissions. Access tokens expire in 8 hours and are refreshed automatically. Refresh tokens expire after 90 days of inactivity.