用于 AI 的 Fitbit MCP 连接器
将 AI 助手连接到您的 Fitbit 健康数据
让您的 AI 助手访问您的 Fitbit 数据,从而获得个性化健康洞察、趋势分析和自动追踪。可与 Claude Desktop 和其他兼容 MCP 的 AI 工具配合使用。
它的作用
🏃锻炼与活动- 获取详细的锻炼日志和活动数据
😴睡眠分析- 检索睡眠模式和质量指标
⚖️体重追踪- 了解一段时间内的体重趋势
❤️心率数据- 监测心率模式和区域
🍎营养日志- 回顾食物摄入量、卡路里和宏量营养素
👤个人资料信息- 访问基本的 Fitbit 个人资料详细信息
向你的人工智能询问这样的问题:“告诉我我这周的睡眠模式”或“我锻炼期间的平均心率是多少?”
快速入门
🚀 想要立即测试这些工具吗?
选项 1:从 npm 安装(推荐)
- 获取 Fitbit API 凭证
- 使用 OAuth 2.0 创建应用程序应用程序类型:
Personal
- 设置回调URL:
http://localhost:3000/callback
- 记下您的客户端 ID和客户端密钥
- 使用 OAuth 2.0 创建应用程序应用程序类型:
- 全局安装包:
- 添加到您的 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
- 将OAuth 2.0 应用程序类型设置为
- 安装软件包:
- 在包目录中创建
.env
文件:首次运行mcp-fitbit
时,它会告诉你创建.env
文件的确切位置。它看起来像这样: - 将您的凭据添加到
.env
文件: - 运行服务器:
对于开发人员(来自源代码)
- 在dev.fitbit.com获取 Fitbit API 凭证
- 将OAuth 2.0 应用程序类型设置为
Personal
- 将回调 URL设置为
http://localhost:3000/callback
- 将OAuth 2.0 应用程序类型设置为
- 克隆和设置:
- 创建
.env
文件: - 构建服务器:
可用工具
工具 | 描述 | 参数 |
---|---|---|
get_weight | 一段时间内的加权数据 | period : 1d , 7d , 30d , 3m , 6m , 1y |
get_sleep_by_date_range | 特定日期范围内的睡眠日志(最多 100 天) | startDate 、 endDate (YYYY-MM-DD) |
get_exercises | 日期之后的活动/锻炼日志 | afterDate (YYYY-MM-DD), limit (1-100) |
get_daily_activity_summary | 每日活动总结及目标 | date (YYYY-MM-DD) |
get_activity_goals | 用户的活动目标(每日/每周) | period : daily 、 weekly |
get_activity_timeseries | 活动时间序列数据(最多 30 天) | resourcePath 、 startDate 、 endDate (YYYY-MM-DD) |
get_azm_timeseries | 活跃区间分钟数时间序列(最多 1095 天) | startDate 、 endDate (YYYY-MM-DD) |
get_heart_rate | 某时间段的心率 | period : 1d 、 7d 、 30d 、 1w 、 1m 、可选date |
get_heart_rate_by_date_range | 日期范围内的心率(最多 1 年) | startDate 、 endDate (YYYY-MM-DD) |
get_food_log | 一天的完整营养数据 | date (YYYY-MM-DD 或“今天”) |
get_nutrition | 随时间推移的个体营养素 | resource , period , 可选date |
get_nutrition_by_date_range | 日期范围内的个别营养素 | resource 、 startDate 、 endDate |
get_profile | 用户个人资料信息 | 没有任何 |
营养资源: 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
- -securityFlicense-qualityA Model Context Protocol server for tracking personal health and well-being, offering tools for workout logging, nutrition management, and daily journaling with AI-assisted analysis integration.Last updated -2Python
- -securityAlicense-qualityA Model Context Protocol server that provides health data from the Senechal API to LLM applications, enabling AI assistants to access, analyze, and respond to personal health information.Last updated -PythonGPL 3.0
- -securityFlicense-qualityA Model Context Protocol server that provides language models with access to personal Whoop fitness data, allowing queries for cycles, recovery, strain, and workout information from the Whoop API.Last updated -2Python
- AsecurityAlicenseAqualityA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.Last updated -1313TypeScriptMIT License