mcp-server-withings
Securely link your own Withings account and read or manage your personal health data through MCP tools.
Connect a Withings account via OAuth, check connection/token status, and disconnect/remove stored tokens.
Search available Withings capabilities/tools.
Read body measurements such as weight, body composition, heart pulse, and SpO2 by date/type.
Read daily activity, including optional high-resolution intraday data.
Read sleep summaries or detailed sleep phases.
Read logged workouts with type, duration, calories, and heart rate.
Read heart/ECG recordings or fetch a specific ECG signal by ID.
Read linked Withings devices and personal goals.
When writes are explicitly enabled, manually log a body measurement such as weight.
Tools are per-user isolated and require verified gateway identity plus bearer authentication; no anonymous/shared access.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-withings what was my weight this week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
This is an independent, unofficial project. It is not developed, endorsed or supported by Withings.
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, at least 32 printable ASCII characters (e.g.openssl rand -hex 32). The server refuses to start without it whenWITHINGS_TRUST_FORWARDED_USER=true(otherwise anyone who can reach the port could claim anyX-MCP-User), when bound to a non-loopback address, or withMCP_ALLOW_ANY_ORIGIN=true. Keep/mcpreachable only from the gateway./withings/connect,/withings/callbackand/healthzneed no bearer.Enrollment:
withings_connectreturns 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/connectto this container alongside/withings/callback.
HTTP transport variables
Variable | Default | Meaning |
|
| Bind address. |
|
| Listen port (1-65535). |
| - | Bearer token required on |
|
| Serve |
|
| Largest accepted |
| localhost origins | Comma-separated exact |
|
| Allow any |
| see below | Comma-separated host names accepted in the |
|
| Failed |
|
| Window for the limit above. |
|
| Upstream request timeout (1-600000 ms). |
On a loopback bind, /mcp only accepts localhost, 127.0.0.1, [::1] or the bind address in the Host header (DNS-rebinding protection); set MCP_ALLOWED_HOSTS to change this. Invalid numbers or booleans in these variables stop the server at startup instead of being ignored.
Security model
Each user links their own Withings account via OAuth; tools only use the tokens stored for the identity in
X-MCP-User. That header is only trusted withWITHINGS_TRUST_FORWARDED_USER=true, and only behindMCP_HTTP_TOKEN.User authentication and authorization belong in an identity-aware gateway in front of this server: it signs the user in, sets
X-MCP-Userand holds the bearer token. This server does not authenticate end users itself.Tool access is not data access: whoever can call
/mcpwith the bearer and a givenX-MCP-Uservalue acts as that user against Withings.Upstream requests never follow redirects, so the client secret and access tokens are only sent to the configured Withings API origin.
The HTTP server does not terminate TLS. Put it behind a TLS-terminating proxy or keep it on a private network.
Run
npm install
npm run dev:http # /mcp + /withings/connect + /withings/callback on :3000
npm testDocker images: ghcr.io/borgels/mcp-server-withings.
License
The code is source-available under the Functional Source License, Version 1.1, ALv2 Future License (FSL-1.1-ALv2).
In plain words:
Allowed: reading the code, running it, changing it, using it inside your own organisation (also commercially), using it for non-commercial education and research, and contributing changes back.
Not allowed: making it, or something built from it, available to others as a commercial product or service that competes with it, for example a hosted service with the same functionality.
Becomes Apache-2.0: each version is also licensed under the Apache License 2.0 from two years after it is released.
Earlier versions: versions released before 0.3.0 were licensed under Apache-2.0 and remain so.
The terms in LICENSE are what apply; this summary does not replace them. See also NOTICE.
Available Tools
12 toolswithings_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 WithingsADestructive
Remove your stored Withings tokens from this server.
Inputs: no named parameters.
withings_get_activityDaily Activity (Withings)ARead-onlyIdempotent
Daily steps/calories/distance/active minutes for a date range.
Inputs: endDate (required), startDate (required), intraday.
withings_get_devicesDevices (Withings)CRead-onlyIdempotent
Your linked Withings devices.
Inputs: no named parameters.
withings_get_goalsGoals (Withings)CRead-onlyIdempotent
Your step/sleep/weight goals.
Inputs: no named parameters.
withings_get_heartHeart / ECG (Withings)ARead-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)ARead-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)ARead-onlyIdempotent
Per-night sleep summary, or high-frequency sleep phases with detailed=true.
Inputs: endDate (required), startDate (required), detailed.
withings_get_workoutsWorkouts (Withings)CRead-onlyIdempotent
Logged workouts with type, duration, calories, HR.
Inputs: endDate (required), startDate (required).
withings_search_capabilitiesSearch Withings CapabilitiesARead-onlyIdempotent
Find the right Withings tool. Use first.
Inputs: limit, query.
withings_statusWithings Connection StatusARead-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
Scored across 12 tools
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.
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.
12 tools is well-scoped for a health data integration server, covering data retrieval, manual logging, and account lifecycle without feeling bloated or sparse.
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
Related MCP Connectors
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Remote MCP server for training, nutrition, wellness, and performance data with OAuth 2.0.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Multi-tenant hosted MCP server for Oura Ring — 21 read-only tools, OAuth per user.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for the Oura Ring API v2, providing access to sleep, activity, readiness, heart rate, and workout data via OAuth.5126 npm1MIT
- AlicenseBqualityBmaintenanceLocal-first MCP server that connects AI agents to your Withings body, sleep, activity and heart data.23211 npm6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects Claude to Withings health data using OAuth 2.0. Provides 11 read-only tools to access body measurements, activity, sleep, heart rate, and device information from Withings devices.MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading Withings smart-scale data (weight, body composition, etc.) through MCP tools, with OAuth2 authentication and automatic token refresh.MIT