Skip to main content
Glama
mcp-server-withings

mcp-server-withings

by borgels

mcp-server-withings

MCP server for the Withings Health API with per-user OAuth2 — each user links their own Withings account and can only ever see their own health data.

How isolation works

Behind an authenticating gateway that forwards the signed-in user as X-MCP-User, every tool is bound to that user. The server keeps an AES-256-GCM encrypted, per-user token store; a user's identity resolves only to their own row. Without a verified identity the server fails closed (no anonymous/shared access). Each user enrolls once via withings_connect, which returns a single-use Withings authorization URL bound to them; after they approve in the browser, /withings/callback stores their (encrypted) tokens.

Related MCP server: Withings MCP

Tools

Auth/enrollment: withings_connect, withings_status, withings_disconnect. Read: withings_get_measures, withings_get_activity, withings_get_sleep, withings_get_workouts, withings_get_heart, withings_get_devices, withings_get_goals, withings_search_capabilities. Write (opt-in WITHINGS_ENABLE_WRITES=true): withings_add_measure.

Configuration

See .env.example. Register a Withings app at account.withings.com; the redirect URI must match WITHINGS_REDIRECT_URI exactly and be publicly reachable (route /withings/callback to this container). Set WITHINGS_ENCRYPTION_KEY (never commit) and WITHINGS_TRUST_FORWARDED_USER=true behind the gateway.

Security configuration

  • MCP_HTTP_TOKEN — shared bearer the gateway must send on /mcp (Authorization: Bearer <token>), compared in constant time. It is required when WITHINGS_TRUST_FORWARDED_USER=true: the server refuses to start without it, because otherwise anyone who can reach the port could claim any X-MCP-User. Keep /mcp reachable only from the gateway.

  • Enrollment: withings_connect now returns a link to /withings/connect, which shows the gateway identity the link is bound to and requires an explicit confirmation before redirecting to Withings. The callback is accepted only from the browser that confirmed (HttpOnly, SameSite=Lax cookie), and the state stays single-use with a 10-minute TTL. Route /withings/connect to this container alongside /withings/callback.

Run

npm install
npm run dev:http     # /mcp + /withings/connect + /withings/callback on :3000
npm test

Docker images: ghcr.io/borgels/mcp-server-withings.

Available Tools

12 tools
withings_add_measureLog Measure (Withings)A

Manually log a body measurement (e.g. weight in kg). Requires write access.

Inputs: type (required), value (required), date.

withings_connectConnect Withings accountA

Start linking YOUR Withings account. Returns an authorization URL — open it in your browser, sign into Withings, and approve. After that the data tools work. Needed once (and again only if you disconnect or the link expires).

Inputs: no named parameters.

withings_disconnectDisconnect WithingsA
Destructive

Remove your stored Withings tokens from this server.

Inputs: no named parameters.

withings_get_activityDaily Activity (Withings)A
Read-onlyIdempotent

Daily steps/calories/distance/active minutes for a date range.

Inputs: endDate (required), startDate (required), intraday.

withings_get_devicesDevices (Withings)C
Read-onlyIdempotent

Your linked Withings devices.

Inputs: no named parameters.

withings_get_goalsGoals (Withings)C
Read-onlyIdempotent

Your step/sleep/weight goals.

Inputs: no named parameters.

withings_get_heartHeart / ECG (Withings)A
Read-onlyIdempotent

List heart/ECG recordings for a date range, or fetch one ECG signal by signalId.

Inputs: endDate, signalId, startDate.

withings_get_measuresBody Measures (Withings)A
Read-onlyIdempotent

Body measurements by type + date range. Common meastypes: 1=weight,5=fat-free mass,6=fat ratio %,8=fat mass,9=diastolic,10=systolic,11=heart pulse,54=SpO2,76=muscle mass,77=hydration,88=bone mass. Defaults to weight+composition.

Inputs: endDate, meastypes, startDate, lastUpdate.

withings_get_sleepSleep (Withings)A
Read-onlyIdempotent

Per-night sleep summary, or high-frequency sleep phases with detailed=true.

Inputs: endDate (required), startDate (required), detailed.

withings_get_workoutsWorkouts (Withings)C
Read-onlyIdempotent

Logged workouts with type, duration, calories, HR.

Inputs: endDate (required), startDate (required).

withings_search_capabilitiesSearch Withings CapabilitiesA
Read-onlyIdempotent

Find the right Withings tool. Use first.

Inputs: limit, query.

withings_statusWithings Connection StatusA
Read-onlyIdempotent

Whether your Withings account is linked and token freshness.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools target distinct resource types (activity, sleep, workouts, heart, devices, goals, measures), and descriptions clearly separate them. Minor overlap exists between heart recordings and heart pulse in measures, and the meta-tool search_capabilities adds an explicit routing step, but overall boundaries are clear.

    Naming Consistency4/5

    All tools share the withings_ prefix and most follow a verb_noun pattern (get_*, add_*, search_*). However, withings_status is a bare noun and withings_connect/disconnect have no object, deviating slightly from the otherwise consistent pattern.

    Tool Count5/5

    12 tools is well-scoped for a health data integration server, covering data retrieval, manual logging, and account lifecycle without feeling bloated or sparse.

    Completeness4/5

    The surface covers major Withings data domains (activity, sleep, workouts, heart, body measures, devices, goals) plus auth status and linking. Missing write operations like updating goals or deleting measures are minor gaps, but the read-side coverage is comprehensive.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers