A Model Context Protocol server for the Fitbit Web API with OAuth 2.1 authentication
Report Bug
·
Request Feature
Table of Contents
A self-hosted MCP server that gives Claude access to your Fitbit health and fitness data. Uses MCP OAuth 2.1 with third-party delegation — when Claude connects, you're redirected to Fitbit to authorize. No manual token management needed.
53 read-only tools covering activity, sleep, heart rate, HRV, SpO2, breathing rate, body composition, nutrition, temperature, cardio fitness, and more.
- Docker and Docker Compose
- A Fitbit developer account with a registered app
- A Cloudflare Tunnel token
- Go to dev.fitbit.com/apps and register a new app
- Set OAuth 2.0 Application Type to Personal
- Set Redirect URL to
https://<your-tunnel-url>/fitbit-callback - Grant Read-Only access
- Note your Client ID and Client Secret
-
Clone the repo
git clone https://github.com/npab19/fitbit-mcp.git cd fitbit-mcp -
Copy the environment template
cp .env.example .env
-
Fill in your credentials in
.env:FITBIT_CLIENT_ID=your_client_id FITBIT_CLIENT_SECRET=your_client_secret SERVER_URL=https://your-tunnel-url.example.com Cloudflare_Token=your_cloudflare_tunnel_token
-
Start the services
docker compose up -d
Tip: You can also use the pre-built image from GHCR instead of building locally.
Set the connector URL to:
https://<your-tunnel-url>/mcp
OAuth authentication will be handled automatically when you first connect.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"fitbit": {
"type": "http",
"url": "https://<your-tunnel-url>/mcp"
}
}
}| Category | Tools | Description |
|---|---|---|
| Activity | 7 | Daily summaries, activity log, goals, favorites, frequent, recent, lifetime stats |
| Activity Time Series | 2 | Steps, calories, distance, floors, elevation, and more over time periods or date ranges |
| Sleep | 4 | Sleep logs by date/range, paginated list, sleep goal |
| Heart Rate | 2 | Heart rate zones and resting HR by period or date range |
| HRV | 2 | Heart rate variability (RMSSD) by date or range |
| SpO2 | 2 | Blood oxygen saturation by date or range |
| Breathing Rate | 2 | Average breaths per minute by date or range |
| Cardio Fitness | 2 | VO2 Max estimates by date or range |
| Active Zone Minutes | 2 | Fat burn, cardio, and peak zone minutes over time |
| Body | 5 | Weight, body fat, BMI logs and time series, body goals |
| Temperature | 4 | Core and skin temperature by date or range |
| Nutrition | 9 | Food/water logs, goals, favorites, frequent, recent, meals, food search |
| Intraday | 6 | Granular activity, heart rate, breathing, HRV, SpO2, AZM data |
| Devices | 1 | Paired device info, battery, last sync |
| User | 2 | Profile and badges |
| Friends | 2 | Friends list and step leaderboard |
- Core Fitbit API read endpoints
- MCP OAuth 2.1 with Fitbit delegation
- Docker + Cloudflare Tunnel deployment
- Token persistence across restarts
- Subscription/webhook support for real-time data
- Write endpoints (log activities, food, water)
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.