SuperAPI AI Directory

withings-mcp

Withings Health API with a local SQLite cache and trend analysis for body composition, sleep, activity, workouts and ECG.

Open website

About this tool

withings-mcp is an MCP server for the Withings Health API that obtains health data from Withings via OAuth authorization and uses a local SQLite cache to support fast offline queries and historical trend analysis. The tool supports incremental sync, pulling only new data since the last sync to reduce duplicate requests.

It covers 17 body composition metrics, as well as sleep, daily activity, workouts, and ECG/AFib (atrial fibrillation) data. OAuth access tokens are valid for 3 hours, refresh tokens are valid for 1 year, and the tool automatically refreshes tokens. The runtime requires Python 3.13 or later, and has been tested in CI on Linux, macOS, and Windows for versions 3.13 and 3.14. There are no dependencies other than mcp, and HTTP requests are implemented through the standard library.

In terms of usage, it can be run without installation via uvx withings-mcp, or installed using uv/pip. First, at https://developer.withings.com/dashboard register a Withings app and set the callback URL to http://localhost:8585,获取 Client ID and Client Secret. During authentication, open the browser to complete Withings authorization, and the token will be saved in the local config/ directory. Then you can register in Claude Code and say "Sync my Withings data" to run withings_sync to populate the local cache; subsequent syncs will only fetch new data. You can also sync directly from the command line without an MCP client. If syncing is abnormal, you can run withings-mcp doctor to see the actual paths and credentials in use and what needs to be fixed.

The cache-backed query tools automatically sync when data is stale and accept a live=True parameter to bypass the cache and fetch directly from the Withings API. withings_get_heart and withings_get_devices are always live queries. withings_get_sleep(detail=True) returns sleep stages per minute (live, up to 7 days per request).

Example prompts include: "Sync my Withings data", "Show my weight for the last 3 months", "How has my sleep changed this year?", "Compare my body composition this month vs last month", "What workouts did I do in March?", "What Withings devices do I have connected?", "Show my sleep trends quarterly".

In terms of security and privacy: all tools are read-only and do not modify data on Withings servers; health data is stored in a local SQLite database; OAuth tokens are stored in the config/ directory (already gitignored, created with 0600 permissions on POSIX, and Windows ignores that mode and relies on ACLs to manage access); error messages do not include health data values, only status codes; an optional pre-commit hook (scripts/check-no-data.sh) prevents database files and credentials from being committed, installationmethod is described in CONTRIBUTING.md. For development setup, test workflows, and pre-commit hooks, see CONTRIBUTING.md; for the changelog, see CHANGELOG.md. The license is GPL-3.0-or-later.