# wcli, the Withings CLI: your body metrics, on the record for your agent wcli, short for Withings CLI, is an agent-first command line tool and MCP server for the Withings Health Data API. The command is called `wcli` because it is quick to type; the project and its GitHub repository keep the name `withings`. A Withings scale, blood pressure monitor, sleep mat, or watch already keeps a record of your body over time. wcli hands that record to an AI agent (Claude, Codex, or any MCP client) as JSON it can parse, never prose it has to guess at. - Version: v0.3.1 - License: Apache-2.0 - Command: `wcli` - Platforms: macOS, Linux, Windows - Website: https://withingscli.com - Source: https://github.com/withingscli/withings Unofficial project. wcli is an independent, open-source CLI for the Withings Health Data API. It is not affiliated with, endorsed by, or sponsored by Withings. "Withings" is a trademark of its owner and is used here only to describe interoperability with the Withings API. This is not a medical device and does not give medical advice. Status: v0.3.1 is verified against Withings' published OpenAPI document and a strict local fake server. On 2 December 2026 the login and every decoded read command were also run against one live Withings account with a BodyFit scale; that account has no watch, sleep, blood pressure, ECG or stethoscope data, so those reads returned empty lists. The partner-only commands have not been run against a partner account. Note for agents: run `wcli schema --summary` on the installed binary and treat the schema as the source of truth for command and flag names. ## Install Homebrew (primary). `wcli` is a cask in the `withingscli/homebrew-withings` tap. It installs the prebuilt binary on macOS (Apple Silicon and Intel) and on Linux (x86_64 and arm64): ```sh brew install withingscli/withings/wcli ``` Other ways: - Download a release archive for macOS, Linux, or Windows from https://github.com/withingscli/withings/releases (amd64 on all three, arm64 on macOS and Linux). The checksum file is signed with cosign. - With Go: `go install github.com/withingscli/withings/cmd/wcli@latest` Check it with `wcli version`, which prints the version, commit, and build date as JSON. ## Get started 1. Install the binary (above). 2. Create a Withings developer app. Sign in at https://developer.withings.com/ with your normal Withings account and create an application of the Public API integration kind. As its Callback URL enter exactly `http://localhost:8989/callback`. Withings gives you a client ID and a client secret. It is free and you do it once. A localhost callback keeps the app in Withings' restricted mode, limited to 10 users, which is fine for reading your own data. 3. Log in with `wcli auth login`. The command asks for the client ID and secret, opens the Withings consent page in your browser, captures the redirect on a local listener, and stores the resulting tokens in your keyring. 4. Check, then read. `wcli doctor` runs a JSON checklist (config, keyring, network, clock, token), each failing check with its own hint. It always exits 0; read its `ok` field. Then ask for data: ```sh wcli doctor --pretty wcli weight --latest --pretty ``` You bring your own Withings developer app, so your data goes from Withings to your machine and nowhere else. There is no hosted service in the middle and no account with this project. Nothing here needs an account to try: `wcli schema --summary`, `--dry-run`, and `wcli doctor` all work before you log in. The command was called `withings` before v0.2.0 and there is no alias: if you installed the old cask, run `brew uninstall withings` first, and point scripts and MCP client configs at `wcli`. ## Data: the whole Withings API, as commands Seventeen decoded commands cover every personal reading. They add a name beside every code Withings documents (workout category, sleep state, device model, AFib result, attribution) and keep the number, give times as RFC 3339, put the unit in the record, and turn objects keyed by epoch seconds into lists sorted by time. Every Withings service action is also a raw command, `wcli `, the fallback that prints Withings' response body unchanged with the vendor's parameter names as flags (`--startdateymd`, `--data-fields`, and so on). Each data area below leads with its decoded command and names the raw command it reads. Scale: weight and body composition (raw: `wcli measure getmeas`) - `wcli weighins`: one record per step on the scale. The measure groups a weigh-in arrives as are merged, readings are keyed by name with value and unit, and segment readings are nested by limb (`right_arm`, `left_arm`, `right_leg`, `left_leg`, `torso`). - `wcli weight`: weight history in kilograms, one record per value. - `wcli body`: body composition, one record per value (weight, fat ratio, fat mass, fat-free mass, muscle mass, bone mass, hydration, and more). It asks for all 16 readings Withings lists for the BodyFit scale, and segment readings carry a `position_name` such as `left_arm`. - `wcli measures`: any measure types, chosen with `--types` (keys such as `weight,fat_ratio,spo2,temperature`, or numeric ids). Default: all types. Blood pressure and vitals (raw: `wcli measure getmeas`, `wcli heart list`, `wcli heart get`, `wcli stetho list`, `wcli stetho get`) - `wcli bp`: systolic and diastolic blood pressure and pulse. SpO2 and temperature come through `wcli measures --types`. - `wcli ecg`: ECG recordings with the atrial fibrillation result named (`afib_name`), heart rate, and blood pressure where the device records it. - `wcli ecg-signal --signalid `: one ECG waveform with its sampling rate, duration, wear position, and device named. - `wcli stethoscope`: stethoscope recordings, each with its time and signal id. - `wcli stethoscope-signal --signalid `: the audio samples of one recording, their encoding and rate, and the chest position named. Sleep (raw: `wcli sleep getsummary`, `wcli sleep get`) - `wcli nights`: one record per night: durations in seconds, score, heart and breathing rates, and `night_events` as a list in time order. - `wcli sleep-stages`: the stages of a night in order, each with a `state_name` (`awake`, `light`, `deep`, `rem`, ...) and its heart rate, breathing, and movement samples as timestamped lists. At most 24 hours per call. Activity and workouts (raw: `wcli measure getactivity`, `wcli measure getintradayactivity`, `wcli measure getworkouts`) - `wcli activity`: one record per day: steps, distance, elevation, calories, active time, heart rate zones. - `wcli intraday`: samples (steps, heart rate, SpO2, HRV, and more) as a list sorted by time. At most 24 hours per call. - `wcli workouts`: workouts with the activity named (`category_name`), start, end, duration, and every metric. Account (raw: `wcli user getdevice`, `wcli user getgoals`) - `wcli devices`: devices with model, type, battery, and last sync. - `wcli goals`: daily steps, sleep duration, and target weight. - `wcli whoami`: user id, scopes, and demo flag from the stored credentials. No network call. Flags. `measures`, `weight`, `body`, `bp`, and `weighins` take `--start`, `--end`, `--last-update`, `--latest`, `--category`, `--offset`, `--units`, and `--all` (plus `--types` on `measures` and `weighins`); their default window is the last 30 days. `activity`, `workouts`, and `nights` take `--start`, `--end`, `--last-update`, `--offset`, `--units`, and `--all`, and default to the last 7 days. `intraday` and `sleep-stages` take `--start`, `--end`, and `--all` (`intraday` also `--units`). `ecg` and `stethoscope` take `--start`, `--end`, `--offset`, and `--all`. `wcli schema ` has the full list for each. Units. `--units imperial` on `measures`, `weight`, `body`, `bp`, `weighins`, and `goals` converts kg to lb, m to in, and °C to °F, and keeps the metric value in `metric`. On `activity`, `intraday`, `workouts`, and `nights` it adds an imperial key beside each distance and temperature and keeps the metric one. Ambiguous weigh-ins. When a scale could not tell which user it measured, the record carries `"ambiguous": true` and `"attrib_name": "device_ambiguous"`, and the page carries a `warnings` entry that lists the `grpid`s and names the command that confirms or rejects one (`wcli measure confirmuser --grpid --is-confirmed=true|false`, which writes to Withings and is a partner-plan operation). Do not report such a reading as the user's until it is confirmed. Device coverage. A test in the CLI repository fails unless every reading in Withings' per-device table (27 devices) is reachable through a decoded command and comes back named. Raw only: - `wcli notify subscribe | list | get | update | revoke`: Notify. Notification (webhook) subscriptions for new data. Local commands: - `wcli auth login | status | refresh | logout`: Manage credentials. - `wcli doctor`: Onboarding diagnostics as JSON. - `wcli schema`: Emit the JSON manifest of all commands, flags, and exit codes. - `wcli mcp serve`: Run the MCP server on stdio. - `wcli version`: Version, commit, and build date as JSON. In all there are 63 raw commands across 16 services. 22 work with any self-serve developer app. 41 are partner-only, for companies with a Withings contract; they carry `"audience": "partner"` in the schema, and anyone else gets a `forbidden` error (exit code 8). Reading data changes nothing. Commands that change something at Withings carry `"mutating": true` in the schema. For an ordinary app those are `notify subscribe`, `notify update`, `notify revoke`, `oauth2 revoke`, and `oauth2 requesttoken`. Example (example data, not a real reading; the response is abridged, the real one also carries `type`, `grpid`, `deviceid`, `category`, `attrib`, `attrib_name`, `ambiguous`, `offset`, `timezone`, `updatetime`, `window`, and `units`): ```sh $ wcli weight --latest --pretty { "measures": [ { "time": "2026-11-30T13:00:00+01:00", "key": "weight", "value": 72.3, "unit": "kg", "model": "Body+", "raw": { "value": 72300, "exponent": -3 } } ], "count": 1, "more": false } ``` Withings sends each measure as value times 10 to the power of unit. The decoded commands do that arithmetic (72300 with exponent -3 is 72.3 kg) and keep the original in `raw`. The raw command `wcli measure getmeas` returns the untouched integers. More examples of the command shape: ```sh wcli weighins --latest wcli body --units imperial wcli bp --latest wcli measures --types weight,fat_ratio --start 2026-11-01 --end 2026-11-30 wcli ecg wcli nights --start 2026-11-01 wcli sleep-stages wcli activity --start 2026-11-01 wcli workouts --all ``` ## The agent contract A language model is the primary user, so the interface is a contract instead of a display. Eight things hold across the tool. 1. stdout is JSON, always. Exactly one of: a single JSON document, an NDJSON stream ending in a summary line, or an error envelope. Never a table, a spinner, or a partial line. Pass `--pretty` when a person is reading. 2. One manifest instead of `--help`. `wcli schema` prints every command, flag, enum, OAuth scope, output shape, and exit code as JSON, reflected off the command tree of the binary that is running. `wcli schema --summary` is a compact index and `wcli schema weight` scopes it to one command. Load the summary once at the start of a session. 3. A typed error envelope. Every failure has the same shape on stdout, and `kind` always agrees with the process exit code. 4. Streams that say when they are done. `--all` follows pagination and streams one record per line, then exactly one summary line. 5. Secrets stay out of the context window. OAuth tokens and your client secret live in the operating system keyring (macOS Keychain, Windows Credential Manager, Secret Service on Linux), or in an encrypted file where no keyring is reachable. The 3-hour access token is refreshed for you, and the managed commands never print a token. For a script, the `WITHINGS_TOKEN` environment variable supplies an access token directly; it is used as-is and never refreshed. 6. stderr is sanitized. Progress and a readable copy of any error go to stderr, stripped of ANSI escapes, bidi and zero-width characters. An agent never needs to parse it to know whether a call worked. 7. A dry run for every raw command. `--dry-run` validates the flags, prints the exact request with secrets redacted, and sends nothing. It needs no credentials. The decoded commands are read-only and have no `--dry-run`. 8. The awkward parts of the API, handled once. Withings answers every call with HTTP 200 and a status number in the body, encodes measures as value times 10 to the power of unit, wants epoch seconds on some endpoints and `YYYY-MM-DD` on others, keys intraday and sleep series by epoch seconds, and returns almost nothing for activity and sleep unless you name the fields. The CLI maps the status to the error envelope, decodes the measures, accepts `YYYY-MM-DD`, RFC 3339, or unix seconds on any date flag, returns those series as lists sorted by time, and asks for every documented field by default. The endpoints limited to 24 hours per call refuse a longer window instead of silently dropping data; `--all` walks it in 24-hour chunks. ### Error envelope Real output of `wcli weight` before logging in (exit code 2): ```json {"error":{"kind":"auth","code":2,"reason":"no_credentials","message":"no Withings credentials are configured","hint":"run 'wcli auth login', or set WITHINGS_TOKEN to an access token"}} ``` Branch on `.error.kind` or the exit code (they always agree), and read `.error.hint` for the next step. When Withings itself refused the call, `status` carries its status number. - 0 ok: success, continue. - 1 internal: internal error (a bug). Report it as is, do not retry blindly. - 2 auth: missing, invalid, or expired credentials. Run `wcli auth login`, do not loop. - 3 usage: bad flag, value, or date, caught locally or reported by Withings. Fix the call using `wcli schema`. - 4 config: config directory or keyring problem. Run `wcli doctor`. - 5 api: Withings failed or refused the request for another reason. Inspect `.error.reason` and `.error.status`. - 6 network: network failure or timeout reaching Withings. Retry with backoff. - 7 ratelimit: rate limited (120 requests a minute per app on the free plan). Wait 60 seconds, then retry with backoff. - 8 forbidden: not entitled, because of a missing OAuth scope, API plan, or partner contract. Do not retry. Re-authorize with the needed scopes, or tell the user. ### NDJSON `--all` contract Example data, records shortened: ```sh $ wcli bp --all {"key":"systolic_bp","value":118,"unit":"mmHg",...} {"key":"diastolic_bp","value":76,"unit":"mmHg",...} {"key":"heart_pulse","value":61,"unit":"bpm",...} {"command":"bp","count":3,"ok":true,"requests":2,"type":"summary"} ``` The stream always ends with exactly one summary line. If a later page fails, the summary still arrives, with `"ok":false` and an embedded error envelope, and the exit code is the error's. Check `ok` before trusting `count`. A failure before the first page prints the ordinary error envelope instead. `--all` exists on every command whose `stdout` in the schema is `json|ndjson(--all)`. ### `--dry-run` Real output: ```sh $ wcli notify subscribe --appli 1 --callbackurl https://example.com/hook --dry-run --pretty { "dry_run": true, "sent": false, "endpoint": "notify subscribe", "mutating": true, "auth": "bearer", "method": "POST", "url": "https://wbsapi.withings.net/notify", "headers": { "Authorization": "Bearer ", "Content-Type": "application/x-www-form-urlencoded", "User-Agent": "withings-cli/0.3.1" }, "params": { "action": "subscribe", "appli": "1", "callbackurl": "https://example.com/hook" } } ``` Run it before any mutating command and show the user the request. ## MCP server `wcli mcp serve` speaks the Model Context Protocol over stdio, using the credentials stored by `wcli auth login`. The decoded commands and the API endpoints become tools, driven by the same registry as the CLI and the schema manifest, so the three cannot drift apart. A failed tool call returns the same error envelope. Claude Code: ```sh claude mcp add withings -- wcli mcp serve ``` Codex: ```sh codex mcp add withings -- wcli mcp serve ``` Any other MCP client: ```json { "mcpServers": { "withings": { "command": "wcli", "args": ["mcp", "serve"] } } } ``` Tool gating. A session starts read-only: - `wcli mcp serve`: public, read-only tools only (the decoded commands, the public read endpoints, login status, and version). - `wcli mcp serve --allow-write`: adds the mutating tools, such as notification subscriptions. Each one takes `dry_run`. - `wcli mcp serve --partner`: adds the partner-only endpoints, which need a Withings partner contract. Tools that would return OAuth tokens are never exposed, whatever the flags. Tool arguments are the CLI flags in snake_case. There is no `--all` over MCP: each call returns one page, and you page with `offset`. ## Compared with 23 public Withings MCP servers We read the source of 23 public Withings MCP servers and scored each against two lists: the 16 readings Withings documents for the BodyFit scale, and the 12 personal health reads of the API. Two decoded all 16 readings, one covered all 12 reads, and none did both. wcli was built to do both. | Project | BodyFit readings decoded and named | Personal health reads | Runs as | Licence | |---|---|---|---|---| | wcli | 16 of 16 | 12 of 12 | Go binary: CLI and MCP server, local | Apache-2.0 | | [stefanocaronia/withings-mcp](https://github.com/stefanocaronia/withings-mcp) | 16 of 16 | 4 of 12 | Python, local | MIT | | [thomascoverstone/withings-mcp](https://github.com/thomascoverstone/withings-mcp) | 16 of 16 | 3 of 12 | Python local, or Cloudflare Worker | MIT | | [akutishevsky/withings-mcp](https://github.com/akutishevsky/withings-mcp) | 13 of 16 | 12 of 12 | Hosted, or self-host | MIT | | [mrstevefay/withings-mcp](https://github.com/mrstevefay/withings-mcp) | 13 of 16 | 9 of 12 | Python, local | No licence | | [jamesdelevoryas/withings-mcp](https://github.com/jamesdelevoryas/withings-mcp) | 13 of 16 | 6 of 12 | TypeScript, self-host | No licence | | [emilniclashofseth/personal-health-data-mcp](https://github.com/emilniclashofseth/personal-health-data-mcp) | 13 of 16 | 4 of 12 | JavaScript, local | MIT, archived | | [davidmosiah/withings-mcp](https://github.com/davidmosiah/withings-mcp) | 11 of 16 | 6 of 12 | npm, local | MIT | | [owenobyrne/mcp-withings](https://github.com/owenobyrne/mcp-withings) | 10 of 16 | 1 of 12 | AWS Lambda | No licence | | [partymola/withings-mcp](https://github.com/partymola/withings-mcp) | 9 of 16 | 6 of 12 | PyPI, local SQLite cache | GPL-3.0 | | [jomargon/wellspring-mcp](https://github.com/jomargon/wellspring-mcp) | 9 of 16 | 6 of 12 | Cloudflare Worker | Apache-2.0 | | [YpsilonTM/withings-mcp](https://github.com/YpsilonTM/withings-mcp) | 8 of 16 | 10 of 12 | Python, local | MIT | | [madebydia/withings-mcp](https://github.com/madebydia/withings-mcp) | 8 of 16 | 1 of 12 | Python, Docker | MIT | | [bigshanu/withings-mcp](https://github.com/bigshanu/withings-mcp) | 7 of 16 | 7 of 12 | Python | No licence | | [IcaroBichir/mcp_withings](https://github.com/IcaroBichir/mcp_withings) | 6 of 16 | 4 of 12 | Python, local | MIT (declared) | | [brianokelly1/withings-mcp](https://github.com/brianokelly1/withings-mcp) | 6 of 16 | 1 of 12 | Python, local | No licence | | [gchallen/withings-mcp](https://github.com/gchallen/withings-mcp) | 6 of 16 | 1 of 12 | TypeScript, local | ISC (declared) | | [jlricon/withings-mcp](https://github.com/jlricon/withings-mcp) | 5 of 16 | 1 of 12 | Vercel | No licence | | [jlxq0/withings-mcp](https://github.com/jlxq0/withings-mcp) | 3 of 16 | 1 of 12 | Rust, self-host | MIT | | [borgels/mcp-server-withings](https://github.com/borgels/mcp-server-withings) | 0 of 16 | 10 of 12 | TypeScript | FSL-1.1, source available | | [Npab19/withings-mcp](https://github.com/Npab19/withings-mcp) | 0 of 16 | 10 of 12 | Python, Docker | MIT | | [mattia-bugossi/withings-mcp-server](https://github.com/mattia-bugossi/withings-mcp-server) | 0 of 16 | 7 of 12 | AWS Lambda | MIT (declared) | | [Schimmilab/withings-mcp-server](https://github.com/Schimmilab/withings-mcp-server) | 0 of 16 | 7 of 12 | Python, Docker | MIT | | [insalata-fresca/withings-mcp](https://github.com/insalata-fresca/withings-mcp) | 0 of 16 | 1 of 12 | C#, container | MIT | Scored on 1 December 2026 by reading each project's source at its latest commit; none was run against a Withings account, and a project may have changed since, so check its repository. A reading counts when the server returns it decoded and named, with each limb of a segment reading named; readings returned raw, unnamed or under a wrong name do not count. The 16 readings are the ones Withings' device table lists for BodyFit, and the 12 reads are body measures, daily activity, intraday activity, workouts, sleep summary, sleep detail, ECG list, ECG signal, stethoscope list, stethoscope signal, devices and goals. wcli's row is our own scoring of our own tool, by the same rules, and wcli was written after the audit with that list in hand. On 2 December 2026 it was run against one live account with a BodyFit: 13 of the 16 readings arrived, decoded and named. Heart rate, vascular age and pulse wave velocity were not returned for that scale; Withings marks pulse wave velocity as EU only. ## Authentication wcli uses the OAuth2 authorization-code flow with your own Withings developer app. `wcli auth login` runs the browser consent step and stores tokens in the OS keyring; `wcli auth status` reports what is stored without printing a token; `wcli auth refresh` refreshes the access token now; `wcli auth logout` revokes the grant at Withings and removes the stored credentials. Access tokens last 3 hours and are refreshed automatically. Headless and remote machines: `wcli auth login --print-url` prints the authorize URL as JSON (it needs `WITHINGS_CLIENT_ID`). Have the user open it and approve, then run `wcli auth login --code ''` (it needs `WITHINGS_CLIENT_SECRET`). The code in the redirect is valid for 30 seconds. Demo user: Withings has no public test environment. The equivalent is its demo user, an account with dummy data: `wcli auth login --demo`. You still need a developer app, but no devices. Token override: set `WITHINGS_TOKEN` to an access token to use it in place of the stored credentials. It is never refreshed. ## Links - Website: https://withingscli.com - Source and README: https://github.com/withingscli/withings - Operating manual for agents: https://github.com/withingscli/withings/blob/main/AGENTS.md - Releases: https://github.com/withingscli/withings/releases - Homebrew tap: https://github.com/withingscli/homebrew-withings - Withings developer portal: https://developer.withings.com/ - Withings API reference: https://developer.withings.com/api-reference - Author: https://akeemjenkins.com (Akeem Jenkins, who designed and built wcli) wcli is unofficial. It is not affiliated with, endorsed by, or sponsored by Withings. "Withings" is a trademark of its owner.