by NitayRabi
Fitbit MCP (Model Context Protocol) enables AI assistants to access and analyze your Fitbit health and fitness data. It acts as an MCP server, connecting to the Fitbit API to provide a wide range of health metrics.
Fitbit MCP (Model Context Protocol) is an implementation that enables AI assistants to access and analyze your Fitbit health and fitness data. It acts as an MCP server that connects to the Fitbit API using a token obtained from an OAuth flow.
Fitbit MCP can be used with AI assistant frameworks by configuring it with a JSON object. You can provide the Fitbit access token either as an environment variable (FITBIT_ACCESS_TOKEN
) or as a command-line argument (--fitbit-token
).
Example JSON configuration:
{
"command": "npx",
"args": ["-y", "fitbit-mcp", "--stdio"],
"env": {
"FITBIT_ACCESS_TOKEN": "YOUR_FITBIT_ACCESS_TOKEN"
}
}
To obtain a Fitbit access token, you need to create an application on the Fitbit Developer Portal, set the OAuth 2.0 Application Type to "Personal", and the Callback URL to "http://localhost:3000". Then, use the OAuth 2.0 authorization flow to get the token.
Fitbit MCP provides a variety of tools for AI assistants to access different types of Fitbit data:
Most tools accept optional date
(YYYY-MM-DD) and period
(1d, 7d, 30d, 1w, 1m) parameters.
Q: How do I get a Fitbit access token? A: You need to create an application on the Fitbit Developer Portal, set the OAuth 2.0 Application Type to "Personal", and the Callback URL to "http://localhost:3000". Then, follow the OAuth 2.0 authorization flow to obtain the token.
Q: What data can I access with Fitbit MCP? A: You can access a wide range of data including user profile, activities, sleep logs, heart rate, steps, body measurements, food logs, water logs, lifetime stats, user settings, floors climbed, distance, calories, active zone minutes, connected devices, and earned badges.
A Model Context Protocol (MCP) implementation for Fitbit, enabling AI assistants to access and analyze your Fitbit health and fitness data.
For JSON configuration (for use with AI assistant frameworks):
{
"command": "npx",
"args": ["-y", "fitbit-mcp", "--stdio"],
"env": {
"FITBIT_ACCESS_TOKEN": "YOUR_FITBIT_ACCESS_TOKEN"
}
}
Or with arguments instead of environment variables:
{
"command": "npx",
"args": ["-y", "fitbit-mcp", "--stdio", "--fitbit-token=YOUR_FITBIT_ACCESS_TOKEN"]
}
This MCP provides the following tools for AI assistants to access your Fitbit data:
Most tools accept optional parameters:
date
: Date in YYYY-MM-DD format (defaults to today)period
: Time period for data (1d, 7d, 30d, 1w, 1m)To get a Fitbit access token:
For detailed instructions on OAuth authentication, see the Fitbit API Documentation.
Contributions are welcome! Here's how you can contribute:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)Every pull request triggers a GitHub Actions workflow that verifies the build process.
# Clone the repository
git clone https://github.com/your-username/fitbit-mcp.git
cd fitbit-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
To publish a new version to NPM:
package.json
v1.0.1
Make sure you have the NPM_TOKEN
secret configured in your GitHub repository settings.
This project is licensed under the MIT License - see the LICENSE file for details.
Reviews feature coming soon
Stay tuned for community discussions and feedback