# Fitbit MCP

> Fitbit. Get all your health and fitness data via your AI client. Query sleep logs, heart rate trends, activity summaries, and nutrition intake—all in natural conversation. You can track daily steps, see blood oxygen levels (SpO2), monitor weight changes, and check your deep sleep stages without opening the Fitbit app. It brings your entire wearable history directly into your agent's context.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** health-tracking, wearables, fitness, sleep-analysis, heart-rate

## Description

Got your Fitbit account linked to your agent? You can pull every piece of health and fitness data you've collected without even opening the app. Your agent handles it all via natural conversation. You'll get a full history of your wearable data right into your context.

**Activity Tracking**

You can grab a summary of your daily steps, calories, distance, and active minutes for any single date using `get_activities_date`. If you wanna see how those numbers stack up over weeks or months, `get_activities_timeseries` pulls detailed time series data for steps, distance, and calories across a range of dates. You can also check your basic profile info, like name, age, height, and gender, with `get_profile`.

**Sleep and Heart Rate**

Need to know about your sleep? `get_sleep_date` gives you a deep dive into a single night's sleep, showing start time, total duration, and minutes spent in deep, light, and REM stages, plus the efficiency score. For long-term views, `get_sleep_timeseries` tracks those sleep summaries and stages over an extended date range. You can monitor your heart health too. `get_heart_date` reports your resting heart rate and heart rate zones for a specific date, while `get_heart_timeseries` tracks those rates and zones over time. You'll also get your VO2 Max score and percentile ranking for a specific date using `get_cardio_fitness_score`.

**Daily Metrics and Logging**

`get_spo2` retrieves your blood oxygen saturation (SpO2) percentage and its minimum and maximum values for a specific date. You can check your breathing rate in breaths per minute for a specific date using `get_breathing_rate`. To track what you eat and drink, `get_foods_date` gives you a summary of calories consumed, macros, and water intake for a specific day. `get_water` checks your water intake volume and timestamps for a specific date. You can also check your body composition—weight, BMI, and fat percentage—for a specified date using `get_body_weight`.

**System Checks**

Want to know what's connected? `get_devices` lists every Fitbit gadget, showing its version, MAC address, and whether it's synced up.

*How it works:* You subscribe to this server, generate an OAuth2 access token from your Fitbit Developer Portal, and your AI client uses the tool names—like `get_sleep_date` or `get_activities_timeseries`—to pull your data.

## Tools

### get_activities_date
Gets a summary of steps, calories, distance, and active minutes for one specific day.

### get_activities_timeseries
Gets detailed time series data for steps, calories, distance, and other activity metrics over a date range.

### get_body_weight
Gets your body weight, BMI, and fat percentage for a specified date.

### get_breathing_rate
Gets your breathing rate in breaths per minute for a specific date.

### get_cardio_fitness_score
Gets your VO2 Max score and percentile ranking for a specific date.

### get_devices
Lists all connected Fitbit devices, showing their version, MAC address, and sync status.

### get_foods_date
Gets a summary of calories consumed, macros, and water intake for one specific day.

### get_heart_date
Gets your resting heart rate and heart rate zones for a specific date.

### get_heart_timeseries
Gets resting heart rate and heart rate zones over a date range.

### get_profile
Retrieves your basic profile details like name, age, height, and gender.

### get_sleep_date
Gets a detailed sleep log, including stages (deep, light, REM) and efficiency, for one specific night.

### get_sleep_timeseries
Gets sleep summaries and stages over an extended date range.

### get_spo2
Gets your blood oxygen saturation (SpO2) percentage for a specific date.

### get_water
Gets your water intake volume and timestamps for a specific date.

## Prompt Examples

**Prompt:** 
```
How did I sleep last night?
```

**Response:** 
```
You slept 7h 23m total. Deep sleep: 1h 45m (24%), Light: 3h 52m (53%), REM: 1h 20m (18%), Awake: 26m. Your sleep score was 82/100 — above your weekly average of 76.
```

**Prompt:** 
```
Show my heart rate trends for the past week.
```

**Response:** 
```
Your average resting heart rate this week was 62 bpm, down from 65 bpm last week. Peak zone time increased to 45 minutes total across 3 workout sessions. Cardio fitness score: 42 (Good).
```

## Capabilities

### Retrieve Activity Summary
Gets steps, calories, distance, and active minutes for a specific date.

### Track Activity Over Time
Pulls detailed time series data for steps, distance, and calories across user-defined date ranges.

### Review Sleep Stages
Retrieves sleep start time, duration, and minutes in deep, light, and REM stages for a specific night.

### Monitor Heart Rate Trends
Queries resting heart rate and heart rate zones for a specific date or time period.

### Check Blood Oxygen Levels
Retrieves average SpO2 percentage and its min/max values for a specific date.

### Log Nutrition and Water
Accesses total calories, macros, and water intake logs for a specific day.

## Use Cases

### Tracking Recovery After a Marathon
A runner needs to know if they are ready for a long run. They prompt their agent: 'What was my sleep quality and heart rate last week?' The agent runs `get_sleep_timeseries` and `get_heart_timeseries`. It then compares the low sleep efficiency to the elevated resting heart rate, advising a rest day.

### Analyzing Diet Impact on Energy
The user suspects their carb intake affects their activity levels. They ask their agent to run `get_foods_date` for the last 10 days and compare the total carbs to the daily `get_activities_date` (steps). The agent reports if high-carb days consistently show higher step counts.

### Monitoring Chronic Conditions
A patient needs to track long-term SpO2 changes. They ask the agent to pull `get_spo2` for the last three months. The agent presents the data trend, which the patient's care team can use for an informed consultation.

### Routine Health Checkup Data Prep
The user asks the agent to compile all metrics for their doctor's visit. The agent sequentially calls `get_profile` for demographics, `get_body_weight` for weight, and `get_heart_date` for heart rate, giving a clean, comprehensive summary.

## Benefits

- See deep sleep stages and total duration instantly. Instead of opening the Fitbit app to find your sleep score, your agent runs `get_sleep_date` and gives you the numbers right away. This saves minutes of dashboard clicking.
- Track trends across weeks or months without manual export. Use `get_activities_timeseries` to pull steps and calories for a 30-day view, letting your agent spot dips or spikes you'd otherwise miss.
- Correlate physical metrics effortlessly. You can combine `get_heart_date` (resting heart rate) with `get_activities_date` (steps) in one prompt. The agent handles the data joins, not you.
- Monitor advanced biometrics on demand. Use `get_spo2` or `get_breathing_rate` to check blood oxygen or breathing rates without knowing the exact API endpoint. Just ask your agent.
- Manage data flow from one place. `get_devices` lets you verify if your Fitbit sync is broken before you start an analysis. It tells you if the data you're about to pull is even current.
- Get a full picture of daily intake. Use `get_foods_date` and `get_water` together to get a complete picture of your diet and hydration for a given day.

## How It Works

The bottom line is: your agent reads the raw data from Fitbit and structures it into plain text for you.

1. Subscribe to the server and generate an OAuth2 access token from your Fitbit Developer Portal.
2. Pass the desired date or date range parameters (e.g., 'last night', 'last 7 days') to the agent's tool call.
3. The agent executes the tool, which returns the raw, structured data to your AI client for synthesis.

## Frequently Asked Questions

**How do I check my sleep trends using get_sleep_timeseries?**
Use `get_sleep_timeseries` and provide a start and end date (YYYY-MM-DD). This tool gives you daily summaries, including sleep efficiency and the breakdown of sleep stages, across a full date range.

**Can I compare my heart rate data with my activity data?**
Yes. Your agent can run `get_heart_timeseries` and `get_activities_timeseries` in sequence. This allows you to see how your resting heart rate changes over time relative to your physical activity levels.

**What is the best tool for checking weight changes?**
Use `get_body_weight` for a single date, or `get_activities_timeseries` if you want weight trends over a period (though `get_body_weight` is the primary source). The tool returns weight in kg, BMI, and fat percentage.

**How do I get my blood oxygen saturation (SpO2) data?**
Call `get_spo2` and provide the specific date. This tool returns the average SpO2 percentage and the minimum and maximum values recorded on that day.

**How do I check my food intake for a specific day using get_foods_date?**
The `get_foods_date` tool returns total calories, macros (carbs, protein, fat), water intake, and a list of logged foods for that day. You can use this to quickly see your nutritional summary and track dietary adherence.

**How can I see my total activity data over a long period with get_activities_timeseries?**
The `get_activities_timeseries` tool gets activity metrics like steps, distance, and calories over periods ranging from 1 day up to 1 year. You can specify the date range and detail level to analyze trends.

**What is the process for setting up the Fitbit connection?**
You must first subscribe to the server and generate an OAuth2 access token from your Fitbit Developer Portal. This token allows your AI client to access your health data securely.

**Does the server support retrieving data from multiple connected devices using get_devices?**
Yes, the `get_devices` tool returns details for all Fitbit devices linked to your account. This includes version, MAC address, battery level, and last sync time, letting you manage your connected hardware.

**Can I query sleep data for a specific date range?**
Yes! Use the sleep time series tool to query sleep trends across any date range. You can also inspect a single night in detail with the sleep date tool, including all sleep stages.

**What health metrics can I access?**
You can access 14 different health metrics: activities, sleep (date & time series), heart rate (date & time series), SpO2, breathing rate, cardio fitness score, body weight, water intake, food logs, device info, and user profile.