fitbit-google-health-mcp

fitbit-google-health-mcp

Read-only MCP access to Fitbit-synced health data through Google Health API v4. Provides tools for metrics, summaries, trends, and data quality without write or arbitrary HTTP operations.

Category
访问服务器

README

fitbit-google-health-mcp

Read-only MCP access to Fitbit-synced health data through Google Health API v4. This is not a direct Fitbit Web API integration. The server is MCP-only: there is no dashboard, database, health-data cache, write operation, or arbitrary HTTP tool.

It isolates unavailable metrics so one Google Health API limitation does not fail an entire request.

Setup

  1. Create a Google Cloud project and enable the Google Health API.

  2. Configure an OAuth consent screen and add your Google/Fitbit account as a test user.

  3. Create a Web application OAuth client with this exact redirect URI:

    http://127.0.0.1:42813/oauth/callback

  4. Copy .env.example to .env and fill in the client ID and secret. Never commit .env or OAuth tokens.

  5. Install and build:

    pnpm install
    pnpm build
    
  6. Authorize the account:

    set -a; source .env; set +a
    pnpm auth
    
  7. Add the server to your MCP client using the built dist/src/index.js and the same environment variables. run.sh is a convenient stdio launcher.

The Fitbit Air must already be paired to the Fitbit mobile app. Fitbit devices sync through the Fitbit app; they do not expose a direct third-party Bluetooth path. Open the Fitbit app and sync before asking the MCP for new readings.

Tools

  • get_data_source_info: provider, data path, read-only boundary, and limitations. Call this first when interpreting results.
  • list_available_metrics: the broad Google Health v4 catalog implemented by this server.
  • get_metrics: query any supported data types over a range, raw or daily aggregate, with source filtering.
  • get_daily_summary: common daily metrics in one call.
  • get_profile, get_devices, get_settings: connected account metadata.
  • get_recent_metrics: recent-range queries with per-metric failure isolation.
  • get_health_snapshot: compact current-day summary.
  • get_trends: numeric averages, ranges, and changes.
  • get_sleep_summary: normalized sleep sessions and stages.
  • get_sync_status: account, devices, and recent-data availability.
  • compare_periods: compare the current period with the prior period.
  • get_data_quality: report coverage, missing data, sources, and API limitations.
  • get_activity_summary: normalized movement and activity trends.
  • get_recovery_summary: informational sleep, heart, oxygen, and respiration summary.
  • get_body_metrics: normalized weight, body-fat, temperature, height, and glucose data.

The server requests read-only scopes only. It does not expose write, delete, webhook, or arbitrary HTTP tools.

Multi-source data

Every metric query and summary accepts:

  • source: FITBIT, HEALTH_KIT, or all (default).
  • source_priority: source precedence when same-time records disagree; defaults to Fitbit first, then HealthKit.
  • deduplicate: remove exact duplicates and resolve same-time cross-source conflicts (default: true).

Responses retain raw records and add sourceAnalysis metadata containing source coverage, returned versus raw record counts, duplicates removed, and conflicts detected. Source filtering is most precise with raw data; rollup-only Google Health types may report unknown coverage because the rollup response does not carry source metadata.

Development

pnpm install
pnpm check

The project requires Node 20+ and pnpm. Run pnpm auth once to create the local OAuth token, then use pnpm start or ./run.sh with your MCP client.

Privacy and security

This server handles sensitive health data. Keep OAuth credentials private, use a restricted Google Cloud test-user list, and never paste token contents into issues or logs. Tokens default to ~/.config/fitbit-mcp/tokens.json (or $XDG_CONFIG_HOME/fitbit-mcp/tokens.json) with owner-only permissions. Set FITBIT_MCP_TOKEN_PATH for another secure location.

The server does not diagnose conditions or provide medical advice. Metric availability varies; unavailable results are missing data, not zero.

Notes

Metric presence varies by Fitbit device, account, country, permissions, and recent sync. Google Health API query ranges are constrained: heart-rate, active-minutes, total-calories, and heart-rate-zone queries should be kept to 14 days or less; most other types support up to 90 days per request. Historical data can be fetched in multiple ranges.

Recent and summary tools accept an IANA timezone such as America/Detroit. Raw API records are preserved, while summary tools add normalized distance, weight, calorie, and sleep-duration fields. Missing data is reported explicitly and is never interpreted as zero.

OpenClaw

Register the local stdio server without a hardcoded tool allowlist so newly added read-only tools become available automatically:

openclaw mcp add fitbit-google-health \
  --command /Users/rithvik/fitbit-mcp/run.sh \
  --cwd /Users/rithvik/fitbit-mcp
openclaw mcp doctor fitbit-google-health --probe
openclaw mcp reload

Use an OpenClaw tool filter only when you intentionally want to restrict the agent. The get_data_source_info tool is the canonical way for an agent to understand that this server uses Google Health API v4 and may contain Fitbit-synced records rather than direct Fitbit Web API records.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选