google-health-mcp
google-health-mcp
面向 Google Health API 的 MCP 服务器,带有本地 SQLite 缓存和趋势分析功能。
专为 Claude Code 和其他 MCP 客户端设计。您的数据会同步到您自己机器上的数据库中,因此查询速度快、支持离线使用,且不消耗任何 API 配额。
功能特性
本地 SQLite 缓存 - 同步一次,即时查询
增量同步 - 每次运行只获取新增数据,从上次停止的地方继续
离线模式 - 无需凭据、无需网络即可使用缓存
趋势分析 - 按周、月、季度聚合,以及双周期对比
心电图 (ECG) - 完整存储读数,包括波形,仅在请求时返回
doctor- 离线、只读地诊断安装配置,不消耗配额
Related MCP server: google-health-mcp-server
数据类型
工具 | 数据 |
| 静息心率 |
| 步数、卡路里、距离、楼层数 |
| 锻炼(名称、时长、心率、卡路里) |
| 时长、睡眠阶段、睡眠周期 |
| 体重、体脂率 % |
| 夜间血氧饱和度 |
| 心率变异性 (RMSSD) |
| 活跃区间分钟数,含各区间细分 |
| 夜间每分钟呼吸次数 |
| 与基线的夜间变化量,以及背后的绝对值 |
| 您手动记录的体温读数 |
| 最大摄氧量 (VO2 max),在设备支持报告时 |
| 食物卡路里和水分摄入,在记录时可用 |
| 心电图:分类、平均心率、时长、按需返回波形 |
| 心律不齐通知及触发通知的时间窗口 |
| 已配对设备、电池电量、上次同步时间 |
| 缓存历史中的总计和最佳天数,以及覆盖范围 |
| 聚合平均值和周期对比 |
系统要求
Python 3.13+(已在 CI 中针对 3.13 和 3.14 测试)
一个包含健康数据的 Google 账号,以及一个用于授权的 Google Cloud 项目。无需绑定结算账号 - 控制台在整个设置过程中提供免费试用,您可以全部拒绝。
设置
1. 安装
pip install google-health-mcp或者不安装直接运行,此时您下面运行的每条 google-health-mcp ... 命令都变成 uvx google-health-mcp ...:
uvx google-health-mcp --version2. 创建 Google Cloud 项目
每个用户都注册自己的 OAuth 客户端。这需要七个控制台步骤,页面名称以 Google 2026 年 8 月为准。
Google 自己的设置页面会把您引导到别处 - 请按照下面的步骤操作。 其快速入门构建的是一个 Web 客户端,重定向 URI 为 https://www.google.com,这适用于 OAuth Playground 而不是运行在您机器上的程序;本服务器会拒绝该配置文件并给出相应提示。请仅使用该页面来检查下面的某个页面是否已被重命名。
项目。 在 console.cloud.google.com/projectcreate 创建项目并选中它。
API。 在 API 启用页面启用 Google Health API。
开始使用。 打开 Google Auth Platform 并完成开始使用 - 应用名称、支持邮箱、外部用户类型、联系邮箱。新项目在完成此步骤前没有"受众群体"、"数据访问"或"客户端"页面。
受众群体。 在测试用户下,添加您自己的 Google 账号。跳过此步骤会导致登录失败并提示
403: access_denied。数据访问。 点击添加或移除范围,搜索"Google Health API",勾选下方 OAuth 范围中列出的只读范围。
客户端。 创建类型为桌面应用的 OAuth 客户端并下载其 JSON 文件。桌面客户端会自动允许环回重定向,因此无需注册任何内容;Web 客户端则不允许,会在授权同意时失败。
发布。 返回"受众群体"页面,点击发布应用。
第 7 步是最容易出问题的地方,值得核实而不是想当然。 当应用的发布状态为"测试中"时,Google 签发的刷新令牌会在授权同意后七天过期 - 所以一切正常,然后一周后同步停止,且没有任何线索指向此刻。受众群体页面可能显示"已正式发布",但令牌服务器却不这么认为。有两个可靠的判断依据:品牌页面上的验证状态行,以及 google-health-mcp doctor,后者会在存储的令牌记录到短期过期时大声报错。
3. 授权
将下载的客户端 JSON 文件原封不动地放到服务器查找的位置:
mkdir -p ~/.config/google-health-mcp
cp ~/Downloads/client_secret_*.json ~/.config/google-health-mcp/google_client.json
google-health-mcp auth您的浏览器会警告 Google 尚未验证此应用。这是正常的,而且这个应用是您自己的:这些健康范围被归类为受限范围,只有超过 100 个用户时才需要验证。点击高级,然后点击前往 google-health-mcp(不安全),并授予这些范围。
该流程会监听 localhost:8081 端口以接收回调,因此该端口必须可用。它会将令牌保存到 ~/.config/google-health-mcp/google_tokens.json,权限为 0600。访问令牌有效期为 1 小时,并会自动刷新。刷新令牌不会轮换,因此在一台有浏览器的机器上生成的令牌可以复制到无头机器上使用。
如果您在发布应用之前已授权,请在此后重新运行 google-health-mcp auth:发布不会延长已签发令牌的有效期,该令牌仍会在七天后过期。
4. 注册到您的 MCP 客户端
claude mcp add -s user google-health -- google-health-mcp使用 uvx 运行:claude mcp add -s user google-health -- uvx google-health-mcp。
5. 检查
google-health-mcp doctor建议在第 3 步(授权)之前和之后都运行一次:它会报告 8081 端口是否可用,以及当前主机能否打开浏览器,这正是 auth 在开始之前可能失败的两种方式。
离线且只读:它会报告哪些路径解析到了哪里、凭据文件格式是否正确、令牌是否为短期有效,以及缓存是否保持最新。
6. 首次同步(可选)
查询工具会在每天首次使用时自动同步,因此您可以跳过此步骤。要预填充缓存,或拉取更早的历史记录:
google-health-mcp sync --days 30
google-health-mcp sync --since 2023-10-01 # backfillCLI 用法
google-health-mcp Start the MCP server (stdio transport)
google-health-mcp -V, --version Print the installed package version
google-health-mcp auth Interactive OAuth setup
google-health-mcp doctor Check the setup and report what needs fixing
google-health-mcp sync Sync data to the local cache
--days N Days of history for a first sync (default: 30)
--types TYPE,... Data types to sync (default: all). One or more of:
heart_rate, activity, exercises, sleep, weight, spo2,
hrv, azm, breathing_rate, skin_temperature,
core_temperature, cardio_fitness, food_log, ecg, irn
--since YYYY-MM-DD Fetch from this date, ignoring the incremental cursor
--until YYYY-MM-DD Inclusive end date for a --since window; together they
re-fetch exactly that window, to repair a gap in the
middle of the cache
google-health-mcp import Import exported JSON data files
--data-dir PATH Directory containing the JSON filesMCP 工具参考
查询工具会在每天每种数据类型的首次查询时同步,然后读取缓存。
除 health_get_devices 和 health_get_lifetime_stats(这两个工具不接受任何参数)外,所有查询工具都接受:
start_date-YYYY-MM-DD、YYYY-MM或30d(相对日期)。默认值:最近 30 天。end_date-YYYY-MM-DD。默认值:今天。live- 如果为 true,则在读取缓存之前从 API 重新获取此时间窗口。刷新失败时会报告错误,而不是静默地从缓存中返回。
health_get_exercises 还接受 exercise_type,即对锻炼名称进行不区分大小写的子字符串匹配。health_get_ecg 还接受 include_waveform:一条轨迹包含数千个电压值,因此默认响应只包含分类、平均心率、时长和样本数。
health_sync
data_types-all,或上面 CLI 用法 中列出的名称的逗号分隔子集(irn表示心律不齐通知)。默认值:all。days- 首次同步的历史天数(默认值:30)。后续同步为增量同步。since/until- 无论缓存中有什么,都获取精确的时间窗口。
health_trends
data_type- 任何具有每日序列的缓存类型;ECG 读数和心律警报是事件类型,没有趋势。默认值:activity。period-weekly、monthly、quarterly。默认值:monthly。start_date/end_date- 默认值:最近 12 个月。compare- 两个周期,例如last_30d vs previous_30d、2026-03 vs 2026-02、2026-Q1 vs 2025-Q4。设置后,将忽略period、start_date和end_date。
OAuth 范围
在"数据访问"页面上勾选这些只读范围。所有范围都在 https://www.googleapis.com/auth/googlehealth. 下:
范围 | 访问的数据 |
| 步数、距离、楼层数、卡路里、锻炼、活跃区间分钟数 |
| 心率、HRV、SpO2、呼吸频率、体重、体脂、体温、最大摄氧量 |
| 睡眠记录和睡眠阶段 |
| 食物和水分记录 |
| 心电图 |
| 心律不齐通知 |
| 已配对设备 |
location.readonly 和 profile.readonly 是控制台提供的两个范围,本包有意不请求,因为这里没有任何功能会读取它们 - 第一个是锻炼期间记录的 GPS 轨迹。
请以控制台中的列表为准,而不是已发布的范围页面 - 有些只读范围既不出现在 Google 的文档中,也不出现在 API 自身的发现文档中,而发现文档则完全省略了 nutrition.readonly。要请求更少的范围,请在"数据访问"页面上少勾选,并在授权前编辑 config.py 中的 GOOGLE_SCOPES,这需要源码检出而不是 pip 或 uvx 安装。授权不会在刷新时获得新范围,因此之后要扩大列表,需要重新运行 auth。
配置
Variable | Default | Description |
|
| 存放 OAuth 客户端和令牌的目录 |
|
| SQLite 缓存 |
| 未设置 | 如果为真值( |
离线 / 仅缓存模式
默认情况下,服务器会按需同步,因此无需 cron 任务。设置 GOOGLE_HEALTH_MCP_OFFLINE=1 即可改为纯读取器运行:
无需任何凭据——服务器绝不会打开令牌文件。
不发起任何网络调用。自动同步已关闭,
live=True、health_get_devices和health_sync会返回一条明确的“离线模式”消息,而不会访问 API。查询工具从缓存中提供数据,并标记为
"offline_mode": true。
典型用途:
多台机器、一个缓存 - 一台主机通过 cron 或 systemd 针对共享数据库运行
google-health-mcp sync;其他机器设置GOOGLE_HEALTH_MCP_OFFLINE=1,将GOOGLE_HEALTH_MCP_DB_PATH指向同一文件,并且只读取。CI 与隐私 – 在无网络访问、无凭据的条件下运行查询。
速率限制
Google 会对每个用户设置请求配额,详见 developers.google.com/health/rate-limits。普通同步远不会触及该限制:一天的数据更新只需几个请求,而实测将所有数据类型回填三年大约需要 250 个请求。如果某次同步被中断,该数据类型会被记录为部分同步,下一次运行会从光标处继续,而不会重新开始。
默认从缓存中查询,因此完全不消耗配额。
数据安全
你的健康数据只留在你自己的机器上:此服务器没有后端,不会向任何地方发送任何数据,并且只使用你自己的凭据与 Google 的 API 通信。
仓库附带一个 pre-commit 钩子,它会拒绝提交数据库文件、config/ 目录下的任何文件以及大文件;CONTRIBUTING.md 说明了如何安装它。
导入现有数据
如果你已有 JSON 格式的健康数据,无论是来自导出还是你自己的脚本:
google-health-mcp import --data-dir /path/to/json/files/预期文件名:heart_rate.json、activity.json、exercises.json、sleep.json、weight.json、spo2.json、hrv.json。每种文件所需的结构请参阅 src/google_health_mcp/importer.py。导入涵盖这七种类型;其他所有数据均通过 sync 获取。
贡献
有关开发环境设置、测试工作流和 pre-commit 钩子,请参阅 CONTRIBUTING.md。变更记录在 CHANGELOG.md 中跟踪。
许可证
Available Tools
27 toolshealth_get_activityA
Get daily activity summaries (steps, calories, active minutes, distance).
Returns data from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
Note: live=True fetches one API call per day - avoid large ranges to stay within the 150 requests/hour rate limit.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per day with steps, calories, active minutes, distance. active_minutes = very_active + fairly_active (excludes lightly active).
Inputs: live, end_date, start_date.
health_get_activity_eventsA
Get activity events over a date range: sedentary periods, altitude gains, swim lengths.
Each event's start and end (UTC), start_utc_offset for the local time, and the values Google sends with it, as sent: gainMillimeters for an altitude gain, strokeCount for a swim length, integers often as strings. Google counts altitude among its true zeros, so an interval with no gain field is a gain of none. Swim lengths are detected passively by the watch and need not belong to a swim workout. Sedentary periods are read from Google's merge of every source rather than from each source's own list.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "7d". Default: 7 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache. include_records: If true, return each event's point exactly as Google sent it instead of its interval and values. Altitude and swim points carry their data source; Google's merged sedentary stream carries none.
Returns sedentary_periods, altitude_gains and swim_lengths, each a list of events with the local date it started on, and count, the events in all.
Inputs: live, end_date, start_date, include_records.
health_get_azmA
Get daily Active Zone Minutes (AZM), the headline cardio metric.
AZM counts minutes spent in heart rate zones at or above Fat Burn intensity.
total_minutes is the plain sum of the three zone columns as reported, not a
weighted one. Returns from local cache by default, auto-syncing if stale.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per day with total_minutes plus per-zone breakdown (fat_burn_minutes, cardio_minutes, peak_minutes). Distinct from active_minutes in health_get_activity, which counts wall-clock minutes regardless of intensity - and which has no source in this API, so it is present only for days that arrived by import.
Inputs: live, end_date, start_date.
health_get_breathing_rateA
Get nightly breathing rate (avg breaths per minute during sleep).
Sourced during sleep tracking. Useful as an illness/recovery signal: sustained increases of 2-3 bpm above personal baseline can indicate incipient infection or strain. Returns from cache by default, auto-syncing if stale.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache. include_sleep_summaries: If true, also return Google's breathing-rate summaries by sleep stage: rate, signal-to-noise and standard deviation for the full sleep and for deep, light and REM sleep. A night can carry several, each at its own sample time.
Returns one entry per night with breaths_per_min and data_source (the device and platform Google says recorded it), and count, the nights. With the flag also sleep_summaries, each with the local date of its sample, sample_time (UTC), utc_offset and data_source, and summary_count. Typical adult range: 12-20 bpm at rest.
Inputs: live, end_date, start_date, include_sleep_summaries.
health_get_cardio_fitnessA
Get Cardio Fitness Score (VO2 Max estimate).
Estimated from resting HR, HR during walks and runs, and demographics. Updates roughly weekly. Returns from cache by default, auto-syncing if stale.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
A reading usually carries a range or a single value; one re-synced across the switchover between providers can hold both. They are different measurements - do not average them together or fill one from the other. vo2_max_low and vo2_max_high are a reported band (e.g. 39-43); vo2_max is a single figure. All in mL/kg/min, higher being better cardiorespiratory fitness. Beside a single figure Google may report cardio_fitness_level (POOR to EXCELLENT), estimated (1 or 0), vo2_max_covariance and data_source (the device and platform it says recorded it).
Inputs: live, end_date, start_date.
health_get_core_temperatureA
Get manually-logged core (body) temperature readings (degrees Celsius).
These are absolute body temperatures the user enters by hand - a thermometer reading logged in an app - and are the right source for fever / body-temperature questions. They are NOT the device-derived nightly skin-temperature variation from health_get_skin_temperature. A single day can hold several readings (each timestamped), useful for tracking a fever over time.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per logged reading with datetime (YYYY-MM-DDThh:mm:ss), temp_celsius, measurement_location (where it was taken, e.g. "MOUTH" or "EAR", as logged), reading_id and data_source. A reading changed in the app replaces its earlier value when its date is next synced.
Inputs: live, end_date, start_date.
health_get_devicesA
List paired devices with battery level and last sync time.
Live-only (no caching) - reflects current device state. Useful for monitoring tracker health, knowing which device produced data, and spotting sync gaps.
Returns one entry per paired device with id, type, device_version, battery (e.g. "High"), battery_level (0-100), last_sync_time, mac, and features list.
Inputs: no named parameters.
health_get_ecgA
Get electrocardiogram (ECG) readings taken on the watch.
Each reading is a single-lead trace the user started by hand, with a rhythm classification - NORMAL_SINUS_RHYTHM, ATRIAL_FIBRILLATION, or one of several inconclusive results (low or high heart rate, poor reading, unclassified). Use it for questions about heart rhythm or AFib checks; for resting rate over time use health_get_heart_rate instead.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache. include_waveform: If true, include the raw voltage samples. These are thousands of integers per reading - ask for them only to analyse the trace itself. Multiply by scaling_factor for millivolts, and read them at sampling_hz samples per second.
Returns one entry per reading with classification, avg_bpm, duration_sec, sampling_hz, scaling_factor and waveform_samples (null where no trace was stored, or where the stored one cannot be read).
Inputs: live, end_date, start_date, include_waveform.
health_get_exercise_routeA
Get the GPS route of one exercise, as the TCX file Google exports.
Only exercises recorded with GPS have a route, and a sync fetches routes for the workouts in its own window. The TCX text carries every trackpoint (time, position, altitude, distance, heart rate) and can run to hundreds of kilobytes, so it is returned only when asked for.
Args:
log_id: The exercise's log_id, as health_get_exercises returns it.
include_tcx: If true, include the TCX text itself.
Returns the exercise's log_id, date and provider, and the TCX text when asked for.
Inputs: log_id (required), include_tcx.
health_get_exercisesA
Get exercise log entries (individual tracked activities).
Returns exercise sessions from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. exercise_type: Filter by activity name (case-insensitive substring match), e.g. "cycling", "walk", "run". Default: all types. A value matching no workout name the cache holds is refused, naming those, rather than answered as a period with no workouts. live: If true, re-fetch this window from the API before reading the cache. include_detail: If true, include every exercise event (start, pause, stop), split and split summary. Without it each entry carries only how many there are (detail_counts), null where none is stored: an imported workout, one Google sent none for, one synced before these were fetched, or a stored value that cannot be read.
Returns exercise entries with name, duration, calories, avg heart rate, distance, and source (for a synced workout the recording device's name, and data_source.recordingMethod says whether it was logged by hand; for an imported one whatever the import carried), and for a synced workout also start and end times with their UTC offsets, active_seconds, notes, Google's metrics_summary whole (pace, speed, elevation, heart-rate zone durations, mobility), exercise_metadata (hasGps, pool length) and data_source. Note: HR data from cycling may be unreliable (optical sensor vs handlebar grip).
Inputs: live, end_date, start_date, exercise_type, +1 more.
health_get_food_logA
Get daily food and water totals, and each entry on request.
Returns calories consumed and water intake (in mL) per day. Only populated where the user logs food or water by hand in a connected app. Returns from cache by default, syncing once a day from a few days before the last sync. An entry logged since today's first sync, or for an older date, needs live=True over a window covering it.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier; 7 with include_entries. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache. include_entries: If true, also return each food and drink logged, with Google's fields for it: for food, foodDisplayName, mealType, serving, energy, energyFromFat, totalCarbohydrate, totalFat, nutrients and food (Google's reference to the food record); for a drink, amountConsumed. Integers may arrive as strings. The first sync of entries covers 30 days, so a day before that can have a total and no entries until health_sync is run with since.
Returns food_log, one row per logged day with calories_in and water_ml, and count, the number of rows. Days with no logging are omitted. With include_entries, also food_entries and water_entries. Each entry carries date, the local date it was logged for, and data_source. It also carries start_time and end_time in UTC, and start_utc_offset for the local time; on entries logged in the app, end_time falls seconds after start_time. entry_count is how many entries both lists hold.
Inputs: live, end_date, start_date, include_entries.
health_get_heart_rateA
Get daily resting heart rate and heart rate zones.
Returns resting HR and zone breakdown (Out of Range, Fat Burn, Cardio, Peak) from the local cache by default, auto-syncing if stale.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per day with resting_hr, zones array, calculation_method (Google's WITH_SLEEP or ONLY_WITH_AWAKE_DATA) and data_source (the device and platform Google says recorded it). Zone data: name, minutes, caloriesOut, max/min HR for each zone. Zones are present only on days that arrived by import; a sync does not write them. Google's own zone boundaries are in health_get_heart_rate_zones.
Inputs: live, end_date, start_date.
health_get_heart_rate_zonesA
Get Google's daily heart-rate zone boundaries.
Each day's four zones (LIGHT, MODERATE, VIGOROUS, PEAK) with the minimum and maximum beats per minute of each, as Google reports them. Boundaries only: time spent in each zone is not part of this. health_get_heart_rate carries an import's zones, with minutes, on days that arrived that way.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per day with zone_boundaries (the list as Google sent it, the bounds as strings).
Inputs: live, end_date, start_date.
health_get_heightA
Get height readings, in millimetres as Google reports them.
Height is usually logged once, often years back, so the default window is ten years. Returns data from the local cache by default.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "Nd". Default: ten years back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch height from the API before reading the cache.
Returns one entry per reading with datetime, date, height_mm and provider.
Inputs: live, end_date, start_date.
health_get_hrvA
Get nightly HRV (heart rate variability) data.
Returns data from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
HRV data is sparse: only nights with on-wrist sleep tracking produce readings.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per night with daily_rmssd and deep_rmssd (ms), entropy, non_rem_hr (non-REM heart rate, bpm) and data_source (the device and platform Google says recorded it). RMSSD = root mean square of successive RR interval differences. Higher values generally indicate better recovery and parasympathetic activity.
Inputs: live, end_date, start_date.
health_get_irregular_rhythmA
Get irregular heart rhythm notifications raised by the watch.
These are background checks the watch runs while the user is still - an alert means it saw a rhythm consistent with atrial fibrillation over one or more windows, not a diagnosis. Most accounts never have one. For a deliberate reading with a trace behind it, use health_get_ecg.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per notification with start_time, end_time and alert_windows (the periods that triggered it).
Inputs: live, end_date, start_date.
health_get_lifetime_statsA
Get all-time activity totals and personal best records.
Totals for steps, floors, distance and calories over every day held in the cache, plus the best single day for steps, floors and distance with the date each record was set.
The answer is bounded by what has been synced, so it is returned with a
coverage block giving the first and last dates and the number of days
counted - read it before quoting a total as all-time. There is no
tracker-versus-total split and no "active score"; neither has a source.
Inputs: no named parameters.
health_get_profileA
Get the account's profile, settings and irregular-rhythm enrolment.
Each is the record Google returns, kept whole: the profile carries age, membership start and stride lengths, the settings carry units, time zone and locale, and the enrolment says whether irregular-rhythm notifications are on. Returns data from the local cache by default.
Args: live: If true, re-fetch the records from the API before reading the cache.
Returns profile, settings and irn_profile, and when each was fetched
(UTC). A record is null when it has never been fetched, which includes one
whose permission the grant lacks.
Inputs: live.
health_get_skin_temperatureA
Get nightly skin temperature variation (degrees Celsius from personal baseline).
This is the device-derived RELATIVE deviation recorded during sleep, NOT an absolute body temperature - for fever / body-temperature readings use health_get_core_temperature instead. A baseline takes about three nights to establish before values appear. Useful as an illness/cycle/recovery signal.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per night with nightly_relative (degrees C, can be negative), the absolutes behind it (nightly_absolute, baseline), nightly_stddev_30d (the 30-day standard deviation of the relative value), log_type (e.g. "dermal") and data_source (the device and platform Google says recorded it).
Inputs: live, end_date, start_date.
health_get_sleepA
Get nightly sleep data (duration, stages, efficiency).
Returns sleep data from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
Sleep data is sparse: only nights with watch-tracked sleep are present. Travel, off-wrist nights, or manual logs may be missing.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per night with total_minutes, efficiency, start/end times, and stage breakdown (deep, light, REM, wake minutes).
Inputs: live, end_date, start_date.
health_get_sleep_sessionsA
Get each sleep session as Google recorded it, rather than the nightly total.
A night can be several sessions (a wake-and-resume, a nap); health_get_sleep sums them per night, while this returns each one whole: its interval, type (CLASSIC or STAGES), Google's metadata (mainSleep, nap, processed, manuallyEdited, stagesStatus), its summary (minutesAsleep, minutesAwake, minutesInSleepPeriod, minutesToFallAsleep, minutesAfterWakeUp, and the per-stage minutes and counts), and the device that recorded it.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache. include_stages: If true, include every stage segment, short awakening and out-of-bed segment. Without it each session carries only how many there are, since a night runs to dozens.
Returns one entry per session with session_id, date (the local day it ended), start_time, end_time, provider, record (the session as Google sent it, less the segment arrays unless include_stages) and segment_counts (how many of each; absent where the stored record cannot be read).
Inputs: live, end_date, start_date, include_stages.
health_get_spo2A
Get nightly SpO2 (blood oxygen saturation) data.
Returns data from the local cache by default. Run health_sync first to populate it.
SpO2 data is sparse: only nights with on-wrist sleep tracking produce readings.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per night: avg SpO2 percentage and up to two pairs of bounds. avg_ci_low/avg_ci_high come from this API, which Google describes as the lower and upper bound of the confidence interval of oxygen saturation samples during sleep. min/max hold whatever an import carried; on the history checked, they matched avg_ci_low/avg_ci_high on every night carrying both. std_dev is Google's standard deviation of the daily SpO2 averages over the past 7-30 days, not of this night's samples, and data_source the device and platform Google says recorded it. Normal range: 95-100%. Below 90% may indicate sleep apnea.
Inputs: live, end_date, start_date.
health_get_weightA
Get weight log entries (weight, BMI, body fat percentage).
Returns data from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
Weight data is sparse: only days with weigh-in entries are present.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per day with weight_kg, bmi, fat_pct. Every individual weigh-in is in health_get_weight_readings.
Inputs: live, end_date, start_date.
health_get_weight_readingsA
Get every weigh-in and body-fat reading, as Google recorded each one.
health_get_weight keeps one row a day; this returns every reading: its value in Google's own unit (weightGrams, percentage), when it was taken, and the device or app that recorded it.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns weight_readings and body_fat_readings, each entry with reading_id, datetime (local), date, provider and record (the reading as Google sent it), and count, the number of readings of both kinds.
Inputs: live, end_date, start_date.
health_rebuildA
Fetch a date range again from Google and report every row that would change.
For when the cache may hold something Google no longer does, or holds it differently. These dates are fetched again, with a day either side, and a row Google sent before and no longer holds is removed. A removed row loses any imported value it carried, and the reply lists it with every value. Where Google still holds a row, an imported value beside Google's stays. History only an import wrote is never touched. A type whose fetch brings back nothing it can store keeps its rows, and says so in a note. A daily weight or body-fat figure synced before release 1.13.0 stays even after its readings are deleted. Without apply nothing is changed: the reply is a preview. Show the person what it lists before running it again with apply=True. A preview copies the cache into memory and makes the same requests to Google as applying does.
Args: since: First date to rebuild, "YYYY-MM-DD". Required. until: Last date, "YYYY-MM-DD". Default: today. data_types: "all", or comma-separated names as health_sync takes them. "account" has no dates and is never rebuilt. apply: If true, change the cache. Default: false, a preview.
Returns, per type, removed (each row Google no longer holds, with its values), changed (each row whose values differ, before and after), added and unchanged (counts), and the range the fetch covered. A type whose fetch fails has nothing removed.
Inputs: since (required), apply, until, data_types.
health_syncA
Sync health data to the local cache.
Fetches data from the Google Health API and stores it in SQLite for fast offline queries. Run this before using other health_get_* tools.
Syncs incrementally: only fetches data newer than the most recent entry in each table. First sync fetches the specified number of days.
Args: data_types: What to sync. Options: "all", "heart_rate", "heart_rate_zones", "activity", "exercises", "sleep", "weight", "spo2", "hrv", "azm", "breathing_rate", "skin_temperature", "core_temperature", "cardio_fitness", "food_log", "ecg", "irn", "account", "height", "exercise_routes", "sleep_sessions", "weight_readings", "body_fat_readings", "sedentary_periods", "altitude_gains", "swim_lengths", "respiratory_rate_sleep", "food_entries", "water_entries". Comma-separated for multiple, e.g. "sleep,hrv". Default: "all". days: Days of history for first sync (default: 30). Ignored on subsequent syncs (uses last synced date). since: Optional "YYYY-MM-DD" backfill date. When set, fetches from this date regardless of what is already cached - use to pull history older than the current cache. Overrides incremental resume and days. until: Optional "YYYY-MM-DD" inclusive end date; requires since. Together they re-fetch and upsert exactly the since..until window - use to repair a gap in the middle of the cache without re-pulling everything from the gap to today.
Returns summary of records synced per data type; for the day-at-a-time types (sedentary_periods, altitude_gains, swim_lengths, respiratory_rate_sleep, food_entries, water_entries) the count is of days. Not for querying data - use health_get_heart_rate, health_get_activity, health_get_sleep, etc. instead.
Inputs: days, since, until, data_types.
health_trendsA
Analyse trends in cached health data.
Computes averages and totals over time from the local cache, auto-syncing if stale.
Args: data_type: What to analyse. Options: "heart_rate", "activity", "exercises", "sleep", "weight", "spo2", "hrv", "azm", "breathing_rate", "skin_temperature", "core_temperature", "cardio_fitness", "food_log". Default: "activity". period: Aggregation period. Options: "weekly", "monthly", "quarterly". Default: "monthly". start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "365d". Default: 365 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. compare: Compare two periods. Format: "last_30d vs previous_30d", "2026-03 vs 2026-02", "2026-Q1 vs 2025-Q4". When set, period/start_date/end_date are ignored.
Returns aggregated averages per period. For activity: steps, distance, active minutes. For exercises: sessions, duration, calories. For sleep: duration, efficiency, stage breakdown. For heart_rate: resting HR min/avg/max. For weight: weight, fat%, BMI. For hrv: daily and deep RMSSD.
For cardio_fitness, avg_vo2_max_low/high average a reported band while avg_vo2_max averages a single value: two definitions, each with the count of readings behind it, never one series.
For spo2, min_spo2/max_spo2 are the lowest and highest bound among imported nights (counted by nights_observed_extremes), and avg_nightly_ci_low/avg_nightly_ci_high the mean of the nightly bounds this API reports (counted by nights_confidence_interval).
These fields and their counts appear in the period form only.
compare= reports spo2 as avg_spo2 alone, and carries both cardio_fitness
definitions.
Not for raw data - use health_get_* tools instead.
Inputs: period, compare, end_date, data_type, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools map to one distinct Google data type, and the descriptions explicitly draw boundaries where overlap exists (weight vs weight_readings, sleep vs sleep_sessions, heart_rate vs heart_rate_zones, activity vs azm, core vs skin temperature). A few pairs remain easy to confuse on name alone—health_get_activity vs health_get_activity_events, health_get_weight vs health_get_weight_readings—requiring the agent to read prose before selecting.
Nearly all tools follow the health_get_<noun> pattern with snake_case, which is predictable and readable. The four non-get tools (health_sync, health_rebuild, health_trends) deviate in verb but are clearly operational rather than retrieval, so the break is meaningful rather than sloppy.
27 tools is heavy for a single server, and several are narrow variants of a sibling (sleep_sessions, weight_readings, heart_rate_zones, exercise_route) that could have been flags on their parent tools. It stays justifiable because each tool corresponds to a genuinely distinct Google Health data type, but the surface is hard to scan.
The read surface is unusually thorough—every major metric, plus sync, rebuild/repair, trends, lifetime stats, device state, and profile. Gaps are minor: no intraday/raw-resolution queries (e.g. hourly steps, raw HR samples) and no way to log or edit data, though the underlying API is read-only so the latter is largely out of scope.
Maintenance
Related MCP Connectors
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Multi-tenant hosted MCP server for Oura Ring — 21 read-only tools, OAuth per user.
Hosted Apple Health MCP for Claude and ChatGPT, works outside the US. iPhone app, no local server.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseBqualityBmaintenanceA local-first MCP server that enables AI agents to read user-authorized Google Health API v4 data from Fitbit, Pixel Watch, and partners via OAuth, with tokens never leaving the machine.26587 npm86MIT
- AlicenseAqualityDmaintenanceMCP server to read daily activity, sleep, heart rate, and body metrics from Google Health API, allowing AI assistants like Claude to access your health data. Optionally syncs health metrics to an Obsidian vault.5MIT
- AlicenseNot gradedqualityDmaintenanceSelf-hosted MCP server that aggregates personal health data from Google Health, Oura, and Withings into a single, provider-attributed interface with configurable source of truth preferences.MIT
- AlicenseAqualityDmaintenanceAn MCP server that locally authenticates with Google Health API v4 and provides read-only access to Fitbit, Pixel Watch, and other health data for AI agents.29112 npm20MIT