npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-health-mcp

v0.3.0

Published

MCP server for the Google Health API: log meals and water, read sleep, activity and nutrition. Bring-your-own Google Cloud credentials.

Readme

Google Health MCP — log meals from photos via any AI agent

npm version npm downloads CI node license: MIT MCP

MCP server for the Google Health API: any AI agent with vision can log your meals (calories and macros) into Google Health, and read back your sleep, activity and nutrition to reason about them together.

Typical flow: you photograph your food and send it to your agent (Hermes Agent via Telegram, OpenClaw, Claude Desktop, Cursor...). The agent estimates the dishes and macros from the photo, calls log_meal, and a minute later the meal is in the Google Health app on your phone, next to your sleep and workouts.

And in the other direction — ask the agent "how was my last month?" and it pulls a day-by-day table (steps, calories in/out, macros, water, weight, resting heart rate, sleep, workouts) with a single get_health_overview call, then reasons about it: whether protein is behind your target, how late meals correlate with bad sleep, whether the weight trend matches the calorie deficit. Say "I weighed in at 82.4" and it lands in Google Health via log_weight.

Built for the new Google Health API (health.googleapis.com/v4) — the legacy Fitbit Web API shuts down in September 2026 and this server does not depend on it.

Why you need your own Google Cloud project (read this first)

This server has no "log in and go" button, and that is deliberate. Google classifies all health scopes as restricted:

  • An unverified app is capped at 100 users for the lifetime of the Cloud project. The counter never resets. A single shared app published to npm would burn those slots within a day and die for everyone.
  • Removing the cap requires Google's Trust & Safety review plus a yearly CASA security audit ($500–4500) and an in-app disclosure screen — impossible for a local stdio server, and pointless for an open-source tool that never sees your data.
  • Spreading users across several Cloud projects is forbidden by Google policy and risks a developer account ban.

So instead every user creates their own free Google Cloud project (~10 minutes, one time). Your data then flows directly between your machine and your Google account. The author of this package runs no servers and can see nothing.

Setup

Requirements: Node.js 20+, a Google account with Google Health (Fitbit) data.

npx -y google-health-mcp setup

The interactive wizard walks you through every step below, opens the right console pages, and finishes with a live test request. What it will ask you to do:

  1. Create a Google Cloud project — console.cloud.google.com/projectcreate, any name.
  2. Enable the Google Health API — APIs & Services → Library → search "Google Health API" → Enable.
  3. Configure the OAuth consent screen — Audience: External; fill the app name and two email fields; skip scopes and test users.
  4. Publish the app to In production. ⚠️ If you leave the consent screen in Testing status, Google expires your refresh tokens after 7 days and you will have to re-authorize weekly. The wizard checks the symptoms of this and doctor diagnoses it.
  5. Create an OAuth client — Credentials → Create Credentials → OAuth client ID → type Desktop app. Paste the client ID and secret into the wizard.
  6. Authorize in the browser. ⚠️ Google will show "Google hasn't verified this app". This is expected and correct: the "app" is your own Cloud project created two minutes ago; there is nobody else to verify it for. Click Advanced → Go to (your app name) (unsafe) and grant access.

Credentials are stored in ~/.config/google-health-mcp/ (config.json, tokens.json, permissions 0600). The client secret is never logged.

Other commands:

npx -y google-health-mcp auth      # re-authorize only
npx -y google-health-mcp doctor    # diagnostics: tokens, permissions, API test call, update check
npx -y google-health-mcp version   # print the installed version

One more thing: make nutrition visible in the app

In the Google Health app, nutrition metrics (Calories in, Protein, Hydration...) start under Not tracked. Open Nutrition and add the metrics you care about to tracked — otherwise logged food is stored but not shown on the dashboard.

Connect to your MCP client

The config is the same everywhere — stdio via npx:

{
  "mcpServers": {
    "google-health": {
      "command": "npx",
      "args": ["-y", "google-health-mcp@latest"]
    }
  }
}

@latest makes npx re-resolve the newest published version on every client start, so updates arrive automatically. Without it, npx serves a cached copy indefinitely.

Installed before 0.1.3? Your config likely has the bare google-health-mcp spec and is stuck on an old cached version. Change it to google-health-mcp@latest, run rm -rf ~/.npm/_npx once (download cache only — credentials in ~/.config/google-health-mcp/ are untouched), restart the client. Details in CHANGELOG.md.

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
  • Cursor: ~/.cursor/mcp.json.
  • Hermes Agent: add the same block to the mcp_servers section of your Hermes config.
  • OpenClaw: add to mcp.servers in your OpenClaw settings.

Credentials can also be injected via environment variables GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET instead of config.json; the timezone via GOOGLE_HEALTH_TIMEZONE (IANA name, defaults to the system timezone).

Tools

Write:

| Tool | Purpose | |---|---| | log_meal | Log a whole meal as separate items (so one mistake can be deleted alone). Returns entry names and meal totals | | log_food | Log a single food item | | log_food_from_db | Log a database food (from search_food) by portion; the entry is editable in place | | log_water | Log water intake in ml | | log_weight | Log body weight in kg, optionally with body fat % | | update_food_log | Edit an entry: database entries are patched in place, estimated (log_meal/log_food) entries are deleted and recreated under a new name (recreated: true) | | delete_food_log | Delete entries by name — the correction path for estimated entries, which are not editable; database entries can also be corrected with update_food_log |

Read:

| Tool | Purpose | |---|---| | get_food_log | Food diary and nutrient totals for a day | | search_food | Search the public food database (packaged/branded products; English queries only) | | get_daily_summary | Steps, calories burned, active minutes | | get_sleep / get_sleep_range | Sleep sessions with stages | | get_activity_range | Per-day activity for a period | | get_nutrition_range | Per-day calories, macros and water for a period | | get_weight_range | Daily average weight and body fat | | get_heart_rate_range | Daily resting heart rate and min/avg/max BPM | | get_workouts | Exercise sessions with duration, calories, distance, avg HR | | get_hrv | Daily heart rate variability | | get_health_overview | Day-by-day table of all of the above in one call — the entry point for analysis and recommendations | | get_profile | Timezone, measurement units |

The read set exists so the agent can answer questions like "how does my eating affect my sleep" — it can correlate, not just write. get_health_overview is designed for exactly that: one call returns up to 90 days of combined data.

Weight, body fat and heart rate need the health_metrics_and_measurements.readonly scope. It is now in the default set; if you authorized with an older version, re-run npx -y google-health-mcp@latest auth once to grant it.

The food database (search_food / log_food_from_db) is English-only (en_US) — queries and results stay in English regardless of the user's language. Nutrition for database entries is computed client-side from the database values, scaled to the chosen portion. Anonymous entries (log_meal, log_food) remain the default path for photo and estimate-based logging.

Accuracy disclaimer

Estimating nutrition from a photo is approximate: expect on the order of ±120 kcal for energy and ±8 g for protein per meal even with top vision models, and errors of tens of percent for individual micronutrients. This tool is fine for tracking trends. It is not suitable for clinical needs — diabetes management, renal diets, or anything where dosing depends on the numbers.

Privacy

Everything runs locally over stdio. Your OAuth tokens never leave your machine; data goes directly from your machine to Google's API. The author operates no infrastructure, collects no telemetry, and cannot see your data.

Development

npm install
npm test        # vitest
npm run lint    # biome
npm run build

License

MIT © 2026 Sergey Gorban