google-health-mcp-server

google-health-mcp-server

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.

Category
Visit Server

README

🩺 google-health-mcp-server

Hand your whole-body health data to your AI β€” steps, distance, heart rate, and more from Apple Watch, Fitbit, or Pixel Watch, unified through Google Health.

MCP Google Health API v4 License: MIT

An MCP server for the Google Health API v4 β€” read your daily activity, sleep, heart rate, and body metrics from any source connected to Google Health (Apple Watch import, Fitbit Air, Pixel Watch, ...) in Claude or any MCP client, and optionally sync them into an Obsidian vault.

Self-hosted and local-first: it uses your own Google Cloud OAuth app, tokens are stored on your machine at mode 0600, and no health data leaves your control.

Beta notice. The Google Health API v4 is new (public beta; legacy Fitbit Web API turns down September 2026). Field shapes may still shift. This server normalizes daily values best-effort and always returns the raw rollup points alongside, so nothing is lost if a field mapping in src/constants.ts needs a tweak against live data.

Tools

Tool What it does
get_daily_summary Per-day table of steps, distance, active calories, active minutes, resting HR, sleep over a date range (or trailing days). Start here.
list_data_points Raw, un-rolled-up points for one dataType β€” intraday HR, sleep stages, or any type not in the summary.
list_paired_devices Devices paired to the account β€” confirm a new device (e.g. Fitbit Air) has connected.
connection_status Health-check: token works? which scopes granted? which metrics actually return data over the last 7 days? Run this first after setup.
sync_health_to_obsidian Daily markdown notes under {vault}/Lifestyle/Health/ + a rolling 7/30-day dashboard.

One-time setup

1. Google Cloud project + API

  1. Create or pick a project at https://console.cloud.google.com/.
  2. Enable the Google Health API: https://console.cloud.google.com/apis/library/health.googleapis.com

2. OAuth consent screen

  1. Go to APIs & Services β†’ OAuth consent screen. User type External.
  2. Fill in the app name and your email.
  3. Under Audience β†’ Test users, add your own Google account.
  4. On the Data access page, add these scopes (search "Google Health"):
    • …/auth/googlehealth.profile.readonly
    • …/auth/googlehealth.settings.readonly
    • …/auth/googlehealth.activity_and_fitness.readonly
    • …/auth/googlehealth.health_metrics_and_measurements.readonly
    • …/auth/googlehealth.sleep.readonly
    • …/auth/googlehealth.nutrition.readonly

⚠️ 7-day token caveat (and why you should stay in Testing). While the consent screen is in Testing status, Google issues refresh tokens that expire after 7 days. You might expect to fix this by publishing to Production β€” but the Google Health scopes are Google's Restricted tier, and Restricted scopes in Production require a full security verification (CASA assessment). There is no "click through the unverified warning" bypass for Restricted scopes (that bypass only exists for Sensitive scopes). Verification is impractical for a single-user personal tool, so the recommended setup is: keep the app in Testing, add yourself as a Test user, and accept the 7-day expiry. Re-authorize lazily β€” only when you actually use the data and a call reports the token has lapsed β€” by re-running npm run oauth (a ~10s browser approve). Don't bother re-authing in weeks you don't touch the data.

3. OAuth credentials

  1. APIs & Services β†’ Credentials β†’ Create credentials β†’ OAuth client ID.
  2. Application type: Web application.
  3. Under Authorized redirect URIs, add exactly:
    http://localhost:47813/callback
    
    (Must match GOOGLE_HEALTH_OAUTH_PORT. Change both together if 47813 is taken.)
  4. Copy the Client ID and Client secret.

4. Configure + authorize

npm install
cp .env.example .env          # then paste your client ID + secret into .env
npm run oauth                 # opens a browser; approve access. Tokens saved to
                              # ~/.config/google-health-mcp/tokens.json (mode 0600)
npm run build

Verify it works:

node dist/index.js            # should print "Google Health MCP server running on stdio"

…or call connection_status once registered in your MCP client.

Register in Claude

Add to ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude:

{
  "mcpServers": {
    "google-health": {
      "command": "node",
      "args": ["/Users/<you>/projects/google-health-mcp-server/dist/index.js"],
      "env": {
        "GOOGLE_HEALTH_TOKENS_PATH": "/Users/<you>/.config/google-health-mcp/tokens.json",
        "OBSIDIAN_VAULT_PATH": "/Users/<you>/Documents/Obsidian Vault"
      }
    }
  }
}

The runtime reads the client ID/secret back from the tokens file, so they don't need to be in the MCP env block β€” only the token path and (optionally) the vault path.

Obsidian sync (optional)

Interactive queries via the MCP tools are always live and pull on demand. The Obsidian notes + dashboard only need a periodic refresh, so set OBSIDIAN_VAULT_PATH and either call sync_health_to_obsidian from Claude or run the CLI:

npm run sync                  # incremental sync since last run

For an automated monthly refresh, a launchd template is in launchd/. Copy it to ~/Library/LaunchAgents/, replace __USERNAME__, and launchctl bootstrap gui/$(id -u) <plist>. It runs on the 1st of each month and is best-effort: if the 7-day token has lapsed it logs a "re-auth needed" note and exits cleanly (no crash-loop), and you re-auth lazily next time you use the data. A daily cron isn't worth it given the token expiry β€” monthly + on-demand is the pragmatic cadence.

Develop

npm run build       # tsc --noCheck β†’ dist/
npm run typecheck   # strict type check (excludes tests)
npm test            # vitest β€” pure logic (civil-date math, value extraction)
npm run dev         # build + run the server on stdio

See CLAUDE.md for architecture notes and known pitfalls.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured