SuperAPI AI Directory

google-health-mcp

Google Health API with a local SQLite cache, offline mode and trend analysis for heart rate, activity, sleep, weight, SpO2, HRV, ECG and irregular rhythms.

Open website

About this tool

google-health-mcp is an MCP server for accessing the Google Health API, covering data types such as heart rate, activity, sleep, SpO2, HRV, ECG, and irregular rhythm notifications, with a local SQLite cache and trend analysis capabilities. It is designed for Claude Code and other MCP clients. Data is synced to a database on the user's own machine, so queries are fast, it can run offline, and it does not consume API quota.

In terms of main capabilities, the server provides a local SQLite cache (sync once and query instantly), incremental sync (fetch only new content each time, and continue from where it left off), offline mode (read the cache without credentials or network), trend analysis (aggregate by week, month, or quarter, and compare two periods), ECG support (store full readings, including waveforms, and return them only when needed), and a doctor command (offline, read-only diagnosis of the installation configuration, without consuming quota).

Installation and usage requirements: Python 3.13+ is required (tested on 3.13 and 3.14, covering Linux, macOS, and Windows, and run in CI); a Google account with health data is required, as well as a Google Cloud project for authorization, with no billing account needed. It can be installed and then run, or run without installation using uvx, for example by replacing a google-health-mcp ... command with uvx google-health-mcp ....

The configuration process requires the user to create a Google Cloud project and register their own OAuth client: create a project, enable the Google Health API, complete the Get started flow for Google Auth Platform, add their own Google account under Test users, add the read-only scopes under Data Access, create an OAuth client of type Desktop app and download its JSON, and finally publish the app. The documentation specifically warns that if the app's publishing status is Testing, the refresh tokens issued by Google will expire seven days after consent, which may cause sync to stop after a week; after publishing the app, auth must be run again, because publishing does not extend the validity of already granted tokens. The client JSON must be placed on the server exactly as-isThe location to look up. The authorization flow listens on localhost:8081 to receive the callback, and tokens are saved to ~/.config/google-health-mcp/google_tokens.json (permissions 0600 on POSIX).

In terms of usage, the Query tool syncs the first time a given data type is queried each day, then reads from the cache; the tool supports parameters such as start_date (YYYY-MM-DD, YYYY-MM, or relative formats like 30d), end_date, and live, and some tools also support switches such as include_detail, include_waveform, include_stages, and include_tcx to control the amount of data returned. The CLI provides a sync command for pre-filling the cache or pulling earlier history, supporting the data_types, days, and since/until parameters. doctor provides offline read-only diagnostics, --json outputs a stable identifier check field, and the exit code is 1 only when there are fail-level checks.

Offline/cache-only mode is enabled by setting GOOGLE_HEALTH_MCP_OFFLINE=1: no credentials are required, no network calls are made, automatic sync is disabled, live=True, health_get_devices, and health_sync return an explicit offline mode notice, and query tools return cached data and mark it with "offline_mode": true. This mode is suitable for multiple machines sharing the same cache (one host syncs with cron or systemd, and other machines are read-only), as well as for CI and privacy scenarios (querying with no network and no credentials).

Regarding quota and privacy, Google has a request quota per user, and normal syncing is far below the limit: a day's updates require only a few requests, and a measured three-year backfill of all data types took about 250 requests. If syncing is interrupted, that data type is recorded as partially synced, and the next run continues from the cursor. Querying from the cache consumes no quota by default. Health data stays on the user's machine; this server has no backend and does not send data anywhere, communicating with Google's API only using its own credentials.

In addition, the repository provides a pre-commit hook that rejects committing database files, anything under config/, and large files. For users who already have health data in JSON format, it can be imported via the import feature; the expectedfile names include seven types: heart_rate.json, activity.json, exercises.json, sleep.json, weight.json, spo2.json, hrv.json, and so on; see src/google_health_mcp/importer.py for the specific shapes; other types are obtained via sync. When the authorization lacks the permissions required for the current version to read, every successful tool response includes an explanation, doctor reports it under the check missing-scopes, and sync also prints it; these data types are skipped rather than failing, and sync still exits with 0. The project is licensed under GPL-3.0-or-later.