Skip to main content
Glama
Google Health MCP — Remote

Google Health MCP — Remote

Google Health MCP — Remote

Connect Claude (or any MCP client) to your Fitbit / Pixel Watch data from anywhere. A remote, multi-user Model Context Protocol server for the Google Health API v4, with built-in OAuth 2.0 sign-in, ready to deploy to Google Cloud Run — and tuned to run inside the free tier.

CI Release License: MIT

Fork of davidmosiah/google-health-mcp (google-health-mcp-unofficial), which runs locally over stdio. This fork adds a remote transport so the server can live on the internet and be used from Claude on the web, desktop and mobile. Unofficial — not affiliated with Google or Fitbit.


What you get

  • Paste one URL into Claude — https://<your-service>.run.app/mcp. Claude discovers the login itself, sends you to Google's consent screen, and you're connected.

  • Your data, your server — it runs in your Google Cloud project with your OAuth client. Nothing goes through a third party.

  • Stateless and free to idle — no database; tokens are encrypted blobs only the server can open. Scales to zero, so a personal setup typically costs £0/month.

  • Read-only by default — sleep, steps, distance, heart rate, HRV, Active Zone Minutes, workouts, weight, nutrition and more, plus daily/weekly summaries.

  • Locked down — only the Google accounts you allow (MCP_ALLOWED_EMAILS) can sign in.

Related MCP server: google-health-mcp-server

How it works

sequenceDiagram
    participant C as Claude (MCP client)
    participant S as This server (Cloud Run)
    participant G as Google sign-in
    participant H as Google Health API
    C->>S: POST /mcp (no token)
    S-->>C: 401 + where to log in
    C->>S: /register, /authorize
    S->>G: redirect to consent (your OAuth client)
    G-->>S: /oauth/callback with code
    S-->>C: code → /token → encrypted access + refresh tokens
    C->>S: POST /mcp (Bearer token)
    S->>H: request with *your* Google token
    H-->>S: health data
    S-->>C: tool result

The server is both the MCP resource server and an OAuth 2.1 authorization server (MCP authorization spec 2025-06-18: protected-resource metadata, authorization-server metadata, dynamic client registration, PKCE S256, refresh tokens). Login itself is delegated to Google. Client registrations, codes and tokens are sealed with AES-256-GCM, so there is no database and any instance can serve any request.

Deploy (about 15 minutes)

You need a Google account, a Google Cloud project with billing enabled (the free tier covers personal use), and Cloud Shell or the gcloud CLI.

  1. Google Cloud Console (same project you'll deploy to):

    • Enable the Google Health API.

    • Google Auth Platform → Get started: External, add yourself under Audience → Test users.

    • Clients → Create client → Web application. Leave both URI lists empty for now; copy the Client ID and secret.

  2. Deploy from Cloud Shell:

    git clone https://github.com/Shreyamkmr/google-health-mcp-remote.git
    cd google-health-mcp-remote
    export PROJECT_ID="your-project-id"
    export GOOGLE_HEALTH_CLIENT_ID="xxxx.apps.googleusercontent.com"
    export GOOGLE_HEALTH_CLIENT_SECRET="GOCSPX-xxxx"
    export MCP_ALLOWED_EMAILS="you@gmail.com"
    ./deploy-cloudrun.sh
  3. Add the printed …/oauth/callback URL to your OAuth client's Authorized redirect URIs.

  4. In Claude: Settings → Connectors → Add custom connector → paste the printed …/mcp URL → Connect.

Step-by-step guide, configuration reference, free-tier details and troubleshooting: DEPLOY-CLOUD-RUN.md.

Other clients:

  • Claude Code: claude mcp add --transport http google-health https://<service>/mcp

  • MCP Inspector: Streamable HTTP → URL → Quick OAuth Flow

Common gotchas

Symptom

Fix

Build fails with artifactregistry.repositories.uploadArtifacts denied

New projects don't grant build permissions by default. The script now grants roles/run.builder; on older copies run it by hand (see the deploy guide).

redirect_uri_mismatch at sign-in

The callback URL on your OAuth client must match exactly (https, no trailing slash).

"Google hasn't verified this app"

Expected for a personal app — click Continue.

Logged out every 7 days

Apps in Testing get 7-day refresh tokens. Fill in Branding (the server serves /, /privacy, /terms) and Publish the app, then reconnect once.

Free-trial billing account

Upgrade to a paid account before the trial ends, or Cloud Run is stopped. Always-free allowances still apply.

Tools (remote mode)

Area

Tools

Health data

google_health_list_data_points, google_health_reconcile_data_points, google_health_daily_rollup, google_health_rollup

Summaries

google_health_daily_summary, google_health_weekly_summary, google_health_wellness_context

Account

google_health_get_profile, google_health_get_settings, google_health_get_identity, google_health_revoke_access

Discovery

google_health_list_data_types, google_health_data_inventory, google_health_data_type_coverage, google_health_capabilities, google_health_quickstart, google_health_agent_manifest, google_health_demo

Tools that only make sense for one local user (manual auth URL/code exchange, token-file status, local disk audits, local wellness-profile file) are hidden in remote mode. Resources and prompts from the original project are still served.

Try asking: "How did I sleep last night?", "Summarise my last run and whether I've recovered", "How many Active Zone Minutes have I got this week?"

Security model

  • Google access/refresh tokens are only ever held encrypted inside tokens issued to your MCP client; the server stores nothing. Health data is not stored.

  • MCP_TOKEN_SECRET (in Secret Manager) encrypts everything. Rotate with new,old; drop old to sign everyone out.

  • MCP_ALLOWED_EMAILS is checked at sign-in, on every request and on every refresh.

  • Dynamic registration accepts https redirect URIs (and http only on localhost); PKCE is required; authorization codes are single-use and expire in 5 minutes.

  • google_health_revoke_access revokes the caller's Google grant.

  • Report vulnerabilities via SECURITY.md / a private GitHub advisory.

Running locally

All original modes still work:

npm ci && npm run build
node dist/index.js                 # stdio, single user (original behaviour)
node dist/index.js --http          # local HTTP, single user, no auth
npm run start:remote               # remote mode on :8080 (needs the env vars above + MCP_TOKEN_SECRET)

For local remote mode, add http://localhost:8080/oauth/callback to your OAuth client and set MCP_PUBLIC_URL=http://localhost:8080. The original single-user documentation is kept in docs/UPSTREAM-README.md.

Development

npm ci
npm run typecheck
npm run build
npm run smoke          # stdio tools/resources/prompts smoke test
npm run test:remote    # 25-check OAuth + MCP end-to-end test against a mock Google
npm run ci             # all of the above

Remote-mode code lives in src/remote/: oauth.ts (authorization server and bearer middleware), sealed.ts (AES-256-GCM token sealing), server.ts (Express app) and request-context.ts (per-request Google token).

Credits and licence

Built on google-health-mcp by David Mosiah, which provides the Google Health client, tools, summaries and privacy modes. Remote transport, OAuth layer and Cloud Run deployment by @Shreyamkmr.

MIT — see LICENSE. Not medical advice; Google Health data is wellness context only.

Available Tools

26 tools
google_health_agent_manifestGoogle Health Agent ManifestA
Read-onlyIdempotent

Machine-readable install, runtime and client guidance for AI agents. Does not call Google Health or expose secrets.

Inputs: client, response_format. Returns: links, oauth, client, hermes, +12 more

google_health_cache_statusGoogle Health Cache StatusB
Read-onlyIdempotent

Report disabled authenticated payload caching and retained configuration. Existing SQLite entries are preserved and not inspected.

Inputs: response_format. Returns: path, reason, enabled, entries, +6 more

google_health_capabilitiesGoogle Health MCP CapabilitiesB
Read-onlyIdempotent

Explain supported Google Health data, privacy boundaries, beta status and recommended agent workflow.

Inputs: response_format. Returns: links, status, creator, project, +11 more

google_health_connection_statusGoogle Health Connection StatusA
Read-onlyIdempotent

Check local Google Health config, token file, Node version, privacy mode, cache readiness and optional MCP client readiness without calling Google APIs or exposing secrets.

Inputs: client, response_format. Returns: ok, node, cache, oauth, +12 more

google_health_daily_rollupGoogle Health Daily RollupC
Read-onlyIdempotent

Aggregate a data type over civil days using Google Health dailyRollUp. Useful for steps, distance, calories, active minutes, weight and heart summaries.

Inputs: end_date, timezone, data_type, page_size, +7 more. Returns: data, endpoint, privacy_mode

google_health_daily_summaryGoogle Health Daily SummaryC
Read-onlyIdempotent

Build a practical daily summary from Google Health rollups and reconciled streams when available. Read-only, beta, non-medical.

Inputs: date, timezone, response_format. Returns: kind, generated_at

google_health_data_inventoryGoogle Health Data InventoryA
Read-onlyIdempotent

Inventory supported Google Health data types, auth scopes, privacy modes and recommended first calls without calling Google APIs.

Inputs: response_format. Returns: auth, kind, links, notes, +12 more

google_health_data_type_coverageGoogle Health Data Type CoverageA
Read-onlyIdempotent

Build a data-type coverage plan from the official Google Health API data-type table, or run explicit live read-only checks against a real OAuth account. Live mode returns only redacted status and point-count buckets, never raw health payloads.

Inputs: date, live, data_types, response_format, +1 more. Returns: kind, mode

google_health_demoGoogle Health DemoA
Read-onlyIdempotent

Returns realistic Pixel-Watch-style example payloads of google_health_daily_summary, google_health_wellness_context, and google_health_daily_rollup so agents see the contract before calling real Google Health APIs.

Inputs: response_format.

google_health_exchange_codeExchange Google Health OAuth CodeA

Exchange a Google OAuth authorization code for local tokens. Tokens are stored locally with 0600 permissions and are never returned. Gated: requires explicit user intent — agents must not call this autonomously.

Inputs: code (required), code_verifier (required), response_format. Returns: ok, note, scope, expires_at, +1 more

google_health_get_auth_urlGet Google Health OAuth URLA
Read-onlyIdempotent

Generate a Google OAuth authorization URL for Google Health API. Use this first when no local token exists.

Inputs: state, scopes, response_format. Returns: scopes, auth_url, next_step, redirect_uri, +1 more

google_health_get_identityGet Google Health IdentityA
Read-onlyIdempotent

Get the Google Health identity mapping for the authenticated user. Useful for Fitbit-to-Google migrations.

Inputs: privacy_mode, response_format, explicit_user_intent. Returns: data, endpoint, privacy_mode

google_health_get_profileGet Google Health ProfileA
Read-onlyIdempotent

Get authenticated user profile details from Google Health. Requires profile scope.

Inputs: privacy_mode, response_format, explicit_user_intent. Returns: data, endpoint, privacy_mode

google_health_get_settingsGet Google Health SettingsA
Read-onlyIdempotent

Get authenticated user settings such as units and timezone. Requires settings scope.

Inputs: privacy_mode, response_format, explicit_user_intent. Returns: data, endpoint, privacy_mode

google_health_list_data_pointsList Google Health Data PointsC
Read-onlyIdempotent

Query detailed data points for a Google Health data type. Use kebab-case endpoint data types, e.g. steps, sleep, heart-rate.

Inputs: filter, data_type, page_size, page_token, +3 more. Returns: data, endpoint, privacy_mode

google_health_list_data_typesList Google Health Data TypesA
Read-onlyIdempotent

List the canonical kebab-case data_type slugs accepted by the data point, reconcile and rollup tools, with each slug's unit, OAuth scope family, and which endpoint verbs (list/reconcile/rollup) support it. Call this before list_data_points, reconcile_data_points, daily_rollup or rollup to choose a valid data_type instead of guessing a slug. Static metadata; does not call Google APIs.

Inputs: response_format. Returns: kind, note, count, source, +3 more

google_health_onboardingDelx Wellness Onboarding FlowA
Read-onlyIdempotent

Return the 11-question onboarding flow plus the current profile state and missing fields. Read-only — does NOT persist anything. Pair with google_health_profile_update once the user answers. Cross-connector: the same profile is shared by every Delx Wellness MCP (whoop, garmin, oura, fitbit, strava, polar, withings, apple-health, samsung-health, google-health, nourish, cycle-coach, cgm, air).

Inputs: locale, response_format.

google_health_privacy_auditGoogle Health Privacy AuditB
Read-onlyIdempotent

Return local privacy, cache, token-path and env-presence posture without revealing secret values.

Inputs: response_format. Returns: notes, project, cache_path, token_path, +17 more

google_health_profile_getGet Delx Wellness ProfileA
Read-onlyIdempotent

Read the shared Delx Wellness profile from ~/.delx-wellness/profile.json. Returns preferred name, goals, devices, training/nutrition/exercise/agent preferences and safety flags. NEVER contains OAuth tokens or API secrets. Read-only.

Inputs: response_format.

google_health_profile_updateUpdate Delx Wellness ProfileA

Persist a partial patch to ~/.delx-wellness/profile.json. Requires explicit_user_intent=true (otherwise returns USER_ACTION_REQUIRED). Rejects secret-like fields (oauth, token, secret, password, cookie, refresh, api_key, session) at write time. Use to record preferred name, goals, devices, training context, nutrition context, exercise preferences, agent preferences, and safety flags.

Inputs: patch (required), response_format, explicit_user_intent.

google_health_quickstartGoogle Health QuickstartA
Read-onlyIdempotent

Personalized 3-step setup walkthrough for the human user. Adapts to current state (env vars set? token present? what's next?). Call this first when the user asks 'how do I connect Google Health?'

Inputs: response_format.

google_health_reconcile_data_pointsReconcile Google Health Data PointsB
Read-onlyIdempotent

Read a reconciled stream for one data type across sources. Supports all-sources, google-wearables and google-sources data source families.

Inputs: filter, data_type, page_size, page_token, +4 more. Returns: data, endpoint, privacy_mode

google_health_revoke_accessRevoke Google Health OAuth AccessA
Destructive

Revoke the current Google OAuth grant and delete the local token file. Use only when the user explicitly wants to disconnect Google Health. Gated: requires explicit user intent — agents must not call this autonomously.

Inputs: response_format, explicit_user_intent. Returns: ok, note, token_path, local_tokens_cleared

google_health_rollupGoogle Health Physical-Time RollupC
Read-onlyIdempotent

Aggregate a data type over physical time intervals using Google Health rollUp.

Inputs: end_time (required), start_time (required), data_type, page_size, +6 more. Returns: data, endpoint, privacy_mode

google_health_weekly_summaryGoogle Health Weekly ReviewB
Read-onlyIdempotent

Build a weekly Google Health scorecard with activity, sleep, heart context and missing-data awareness. Read-only, beta, non-medical.

Inputs: days, timezone, compare_days, response_format. Returns: kind, generated_at

google_health_wellness_contextGoogle Health Wellness ContextB
Read-onlyIdempotent

Normalize Google Health activity/sleep context into the shared wellness_context shape for recommendation engines.

Inputs: days, notes, soreness, timezone, +2 more. Returns: notes, source, soreness, generated_at, +2 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 26 tools

    Disambiguation2/5

    Several clusters are hard to separate: google_health_data_inventory, list_data_types, data_type_coverage, capabilities and agent_manifest all answer 'what data/scopes exist', and connection_status, cache_status, privacy_audit and data_type_coverage overlap on local/auth diagnostics. Worst is google_health_profile_get (local wellness profile) vs google_health_get_profile (remote Google account profile) — near-identical names with totally different sources, plus google_health_rollup vs google_health_daily_rollup vs reconcile_data_points vs daily_summary/weekly_summary. Descriptions do distinguish them, but only after close reading.

    Naming Consistency3/5

    All names use snake_case with a uniform google_health_ prefix, which helps scanning. However the verb/noun ordering is mixed: verb-first (get_profile, list_data_points, exchange_code) alongside noun-first (profile_get, profile_update, data_type_coverage, cache_status). The profile_get/get_profile pair makes the inconsistency actively misleading rather than merely stylistic.

    Tool Count2/5

    26 tools is over the comfortable range for what is fundamentally a read-only health data connector, and a large share is meta/diagnostic surface (inventory, capabilities, agent_manifest, quickstart, demo, coverage, cache_status, privacy_audit, connection_status) rather than health data operations. Several of these could be folded into one discovery or one status tool without losing capability.

    Completeness3/5

    Read coverage is strong — data point listing, reconcile, daily/monthly rollups, summaries, identity, profile, settings, plus full OAuth lifecycle including revoke. The clear gaps are write-side operations: no tool to create/update/delete Google Health data points (log exercise, weight, meals), no settings update, and no subscription/webhook management, so the surface is read-only plus local profile writes.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      A 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.
      26
      875 npm
      84
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP 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.
      5
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Hosted MCP server that syncs health data from Apple Health, Fitbit, Oura, and Google Health Connect, enabling Claude and ChatGPT to query workouts, sleep, nutrition, and recovery in plain English with interactive charts.
      85
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude and other MCP clients to query your Fitbit/Pixel Watch health data via the Google Health API, including sleep, heart rate, activity, workouts, and trends with read-only access.
      11 npm
      MIT