Skip to main content
Glama

Fitbit MCP Server

用于 AI 的 Fitbit MCP 连接器

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

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

它的作用

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

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

快速入门

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

选项 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. 在包目录中创建.env文件:首次运行mcp-fitbit时,它会告诉你创建.env文件的确切位置。它看起来像这样:
    C:\Users\YourName\AppData\Roaming\npm\node_modules\mcp-fitbit\.env
  4. 将您的凭据添加到.env文件:
    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. 创建.env文件:
    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 天)startDateendDate (YYYY-MM-DD)
get_exercises日期之后的活动/锻炼日志afterDate (YYYY-MM-DD), limit (1-100)
get_daily_activity_summary每日活动总结及目标date (YYYY-MM-DD)
get_activity_goals用户的活动目标(每日/每周)perioddailyweekly
get_activity_timeseries活动时间序列数据(最多 30 天)resourcePathstartDateendDate (YYYY-MM-DD)
get_azm_timeseries活跃区间分钟数时间序列(最多 1095 天)startDateendDate (YYYY-MM-DD)
get_heart_rate某时间段的心率period1d7d30d1w1m 、可选date
get_heart_rate_by_date_range日期范围内的心率(最多 1 年)startDateendDate (YYYY-MM-DD)
get_food_log一天的完整营养数据date (YYYY-MM-DD 或“今天”)
get_nutrition随时间推移的个体营养素resource , period , 可选date
get_nutrition_by_date_range日期范围内的个别营养素resourcestartDateendDate
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了解改进机会和技术细节。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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 通过定义的工具请求和检索用户健康和健身数据。

  1. 它的作用
    1. 快速入门
      1. 选项 1:从 npm 安装(推荐)
      2. 选项 2:开发设置
    2. 安装
      1. 对于最终用户(npm 包)
      2. 对于开发人员(来自源代码)
    3. 可用工具
      1. 克劳德桌面
      2. 首次运行授权
    4. 发展

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        A 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 -
        2
        Python
      • -
        security
        A
        license
        -
        quality
        A 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 -
        Python
        GPL 3.0
        • Linux
        • Apple
      • -
        security
        F
        license
        -
        quality
        A 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 -
        2
        Python
        • Apple
      • A
        security
        A
        license
        A
        quality
        A 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 -
        13
        13
        TypeScript
        MIT License

      View all related MCP servers

      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