用于 AI 的 Fitbit MCP 连接器
将 AI 助手连接到您的 Fitbit 健康数据
让您的 AI 助手访问您的 Fitbit 数据,从而获得个性化健康洞察、趋势分析和自动追踪。可与 Claude Desktop 和其他兼容 MCP 的 AI 工具配合使用。
它的作用
🏃锻炼与活动- 获取详细的锻炼日志和活动数据
😴睡眠分析- 检索睡眠模式和质量指标
⚖️体重追踪- 了解一段时间内的体重趋势
❤️心率数据- 监测心率模式和区域
🍎营养日志- 回顾食物摄入量、卡路里和宏量营养素
👤个人资料信息- 访问基本的 Fitbit 个人资料详细信息
向你的人工智能询问这样的问题:“告诉我我这周的睡眠模式”或“我锻炼期间的平均心率是多少?”
快速入门
🚀 想要立即测试这些工具吗?
选项 1:从 npm 安装(推荐)
使用 OAuth 2.0 创建应用程序应用程序类型:
Personal
设置回调URL:
http://localhost:3000/callback
记下您的客户端 ID和客户端密钥
全局安装包:
添加到您的 Claude Desktop 配置文件:
配置文件位置:
Windows:%AppData%\Claude\claude_desktop_config.json
macOS:〜/资源库/应用程序支持/Claude/claude_desktop_config.json
Linux:~/.config/Claude/claude_desktop_config.json
重新启动 Claude Desktop 并询问您的 Fitbit 数据!
选项 2:开发设置
获取 Fitbit API 凭证(请参阅下面的安装)
然后运行:
这两个选项都会在http://localhost:5173
打开MCP 检查器,您可以在其中以交互方式测试所有工具并处理 OAuth 流程。
安装
对于最终用户(npm 包)
在dev.fitbit.com获取 Fitbit API 凭证
将OAuth 2.0 应用程序类型设置为
Personal
将回调 URL设置为
http://localhost:3000/callback
安装软件包:
npm install -g mcp-fitbit在包目录中创建
首次运行
mcp-fitbit
时,它会告诉你创建.env
文件的确切位置。它看起来像这样:C:\Users\YourName\AppData\Roaming\npm\node_modules\mcp-fitbit\.env将您的凭据添加到
FITBIT_CLIENT_ID=your_client_id_here FITBIT_CLIENT_SECRET=your_client_secret_here运行服务器:
mcp-fitbit
对于开发人员(来自源代码)
在dev.fitbit.com获取 Fitbit API 凭证
将OAuth 2.0 应用程序类型设置为
Personal
将回调 URL设置为
http://localhost:3000/callback
克隆和设置:
git clone https://github.com/TheDigitalNinja/mcp-fitbit cd mcp-fitbit npm install创建
FITBIT_CLIENT_ID=your_client_id_here FITBIT_CLIENT_SECRET=your_client_secret_here构建服务器:
npm run build
可用工具
工具 | 描述 | 参数 |
| 一段时间内的加权数据 |
:
,
,
,
,
,
|
| 特定日期范围内的睡眠日志(最多 100 天) |
、
(YYYY-MM-DD) |
| 日期之后的活动/锻炼日志 |
(YYYY-MM-DD),
(1-100) |
| 每日活动总结及目标 |
(YYYY-MM-DD) |
| 用户的活动目标(每日/每周) |
:
、
|
| 活动时间序列数据(最多 30 天) |
、
、
(YYYY-MM-DD) |
| 活跃区间分钟数时间序列(最多 1095 天) |
、
(YYYY-MM-DD) |
| 某时间段的心率 |
:
、
、
、
、
、可选
|
| 日期范围内的心率(最多 1 年) |
、
(YYYY-MM-DD) |
| 一天的完整营养数据 |
(YYYY-MM-DD 或“今天”) |
| 随时间推移的个体营养素 |
,
, 可选
|
| 日期范围内的个别营养素 |
、
、
|
| 用户个人资料信息 | 没有任何 |
营养资源: caloriesIn
、 water
、 protein
、 carbs
、 fat
、 fiber
、 sodium
活动时间序列资源: steps
、 distance
、 calories
、 activityCalories
、 caloriesBMR
、 tracker/activityCalories
、 tracker/calories
、 tracker/distance
克劳德桌面
使用 npm 包(推荐):
添加到claude_desktop_config.json
:
使用本地开发版本:
添加到claude_desktop_config.json
:
配置文件位置:
Windows:
%AppData%\Claude\claude_desktop_config.json
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
首次运行授权
当您第一次要求您的 AI 助手使用 Fitbit 数据时:
服务器打开浏览器访问
http://localhost:3000/auth
登录 Fitbit 并授予权限
您将被重定向到成功页面
您的 AI 现在可以访问您的 Fitbit 数据!
发展
**架构:**请参阅TASKS.md了解改进机会和技术细节。
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器将 LLM(如 Claude)与 Fitbit API 连接起来,允许 LLM 通过定义的工具请求和检索用户健康和健身数据。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that allows Claude to interact with Linear's API for managing teams, issues, projects, and cycles.Last updated -102MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables Claude to interact with the ConnectWise Manage API to perform operations like retrieving, creating, updating, and deleting tickets, companies, contacts, and other entities.Last updated -MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.Last updated -417185MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides unified access to multiple LLM APIs including ChatGPT, Claude, and DeepSeek, allowing users to call different LLMs from MCP-compatible clients and combine their responses.Last updated -7292MIT License