Skip to main content
Glama

用于 AI 的 Fitbit MCP 连接器

Fitbit API CI 覆盖状态 许可证:MIT npm 版本 npm 下载

将 AI 助手连接到您的 Fitbit 健康数据

让您的 AI 助手访问您的 Fitbit 数据,从而获得个性化健康洞察、趋势分析和自动追踪。可与 Claude Desktop 和其他兼容 MCP 的 AI 工具配合使用。

它的作用

🏃锻炼与活动- 获取详细的锻炼日志和活动数据
😴睡眠分析- 检索睡眠模式和质量指标
⚖️体重追踪- 了解一段时间内的体重趋势
❤️心率数据- 监测心率模式和区域
🍎营养日志- 回顾食物摄入量、卡路里和宏量营养素
👤个人资料信息- 访问基本的 Fitbit 个人资料详细信息

向你的人工智能询问这样的问题:“告诉我我这周的睡眠模式”或“我锻炼期间的平均心率是多少?”

Related MCP server: ConnectWise Manage MCP Server

快速入门

🚀 想要立即测试这些工具吗?

选项 1:从 npm 安装(推荐)

  1. 获取 Fitbit API 凭证

    • 使用 OAuth 2.0 创建应用程序应用程序类型: Personal

    • 设置回调URL: http://localhost:3000/callback

    • 记下您的客户端 ID客户端密钥

  2. 全局安装包:

npm install -g mcp-fitbit
  1. 添加到您的 Claude Desktop 配置文件:

{ "mcpServers": { "fitbit": { "command": "mcp-fitbit", "args": [], "env": { "FITBIT_CLIENT_ID": "your_client_id_here", "FITBIT_CLIENT_SECRET": "your_client_secret_here" } } } }
  • 配置文件位置:

    • Windows:%AppData%\Claude\claude_desktop_config.json

    • macOS:〜/资源库/应用程序支持/Claude/claude_desktop_config.json

    • Linux:~/.config/Claude/claude_desktop_config.json

  1. 重新启动 Claude Desktop 并询问您的 Fitbit 数据!

选项 2:开发设置

  1. 获取 Fitbit API 凭证(请参阅下面的安装)

  2. 然后运行:

git clone https://github.com/TheDigitalNinja/mcp-fitbit cd mcp-fitbit npm install # Create .env with your Fitbit credentials npm run dev

这两个选项都会在http://localhost:5173打开MCP 检查器,您可以在其中以交互方式测试所有工具并处理 OAuth 流程。

安装

对于最终用户(npm 包)

  1. dev.fitbit.com获取 Fitbit API 凭证

    • OAuth 2.0 应用程序类型设置为Personal

    • 回调 URL设置为http://localhost:3000/callback

  2. 安装软件包:

    npm install -g mcp-fitbit
  3. 在包目录中创建

    首次运行mcp-fitbit时,它会告诉你创建.env文件的确切位置。它看起来像这样:

    C:\Users\YourName\AppData\Roaming\npm\node_modules\mcp-fitbit\.env
  4. 将您的凭据添加到

    FITBIT_CLIENT_ID=your_client_id_here FITBIT_CLIENT_SECRET=your_client_secret_here
  5. 运行服务器:

    mcp-fitbit

对于开发人员(来自源代码)

  1. dev.fitbit.com获取 Fitbit API 凭证

    • OAuth 2.0 应用程序类型设置为Personal

    • 回调 URL设置为http://localhost:3000/callback

  2. 克隆和设置:

    git clone https://github.com/TheDigitalNinja/mcp-fitbit cd mcp-fitbit npm install
  3. 创建

    FITBIT_CLIENT_ID=your_client_id_here FITBIT_CLIENT_SECRET=your_client_secret_here
  4. 构建服务器:

    npm run build

可用工具

工具

描述

参数

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

用户个人资料信息

没有任何

营养资源: caloriesInwaterproteincarbsfatfibersodium

活动时间序列资源: stepsdistancecaloriesactivityCaloriescaloriesBMRtracker/activityCaloriestracker/caloriestracker/distance

克劳德桌面

使用 npm 包(推荐):

添加到claude_desktop_config.json

{ "mcpServers": { "fitbit": { "command": "mcp-fitbit", "args": [] } } }

使用本地开发版本:

添加到claude_desktop_config.json

{ "mcpServers": { "fitbit": { "command": "node", "args": ["C:\\path\\to\\mcp-fitbit\\build\\index.js"] } } }

配置文件位置:

  • 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 数据时:

  1. 服务器打开浏览器访问http://localhost:3000/auth

  2. 登录 Fitbit 并授予权限

  3. 您将被重定向到成功页面

  4. 您的 AI 现在可以访问您的 Fitbit 数据!

发展

npm run lint # Check code quality npm run format # Fix formatting npm run build # Compile TypeScript npm run dev # Run with MCP inspector

**架构:**请参阅TASKS.md了解改进机会和技术细节。

One-click Deploy
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheDigitalNinja/mcp-fitbit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server