withings-mcp
MCP server for the Withings Health API that syncs and queries personal health data using a local SQLite cache and live API access.
Sync body, sleep, activity, and workout data incrementally into a local cache.
Query body composition metrics such as weight, fat percentage, muscle, bone, blood pressure, SpO2, and more.
Retrieve nightly sleep summaries or detailed minute-by-minute sleep phases.
View daily activity totals and individual workout sessions with type/date filters.
Access ECG/AFib recordings and connected device battery/firmware information live.
Analyze weekly, monthly, or quarterly trends and compare periods.
Fetch cache-backed data live from Withings when needed, with automatic OAuth token refresh.
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., "@withings-mcp show my weight trends for the last 3 months"
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.
withings-mcp
MCP server for the Withings Health API with OAuth, local SQLite cache, and trend analysis.
What makes this different from other Withings MCP servers:
Local SQLite cache for fast offline queries and historical trend analysis
Incremental sync - only fetches new data since last sync
Broad Withings coverage: 17 body-composition metrics plus sleep, daily activity, workouts, and ECG/AFib
Automatic OAuth token refresh (access tokens: 3h, refresh tokens: 1 year)
Zero dependencies beyond
mcp(HTTP via stdlib)Python 3.13+ (tested on 3.13, 3.14 and 3.15, on Linux, macOS and Windows, in CI)
Tools
Tool | Description | Data source |
| Sync data from Withings API to local cache | Live API -> SQLite |
| Body composition (weight, fat%, muscle, bone, BP, SpO2) | Local cache (auto-syncs if stale) |
| Sleep summaries, or detailed phase time-series with | Cache (summary) / live (detail) |
| Daily steps, distance, calories, active time | Local cache (auto-syncs if stale) |
| Workout sessions with type, duration, HR | Local cache (auto-syncs if stale) |
| ECG recordings and AFib detection | Live API (always) |
| Connected devices with battery status | Live API (always) |
| Period averages, weekly/monthly/quarterly trends, comparisons | Local cache (auto-syncs if stale) |
The cache-backed query tools auto-sync when their data is stale, and accept live=True to bypass the cache and fetch straight from the Withings API. withings_get_heart and withings_get_devices are always live. withings_get_sleep(detail=True) returns minute-by-minute sleep phases (live, up to 7 days per request).
Related MCP server: Withings MCP Server
Prerequisites
Python 3.13+ (tested on 3.13, 3.14 and 3.15, on Linux, macOS and Windows, in CI)
uv (recommended) or pip
A Withings developer account and registered application
Installation
pip install withings-mcpOr run it without installing with uvx withings-mcp. For development from a clone:
git clone https://github.com/partymola/withings-mcp.git
cd withings-mcp
uv venv --python 3.13 .venv
uv pip install -e .Setup
1. Register a Withings app
Create a new application
Set the callback URL to
http://localhost:8585Note your Client ID and Client Secret
2. Authenticate
.venv/bin/withings-mcp authThis opens your browser for Withings authorization. After approving, tokens are saved locally in config/.
3. Register with Claude Code
claude mcp add -s user withings -- /path/to/withings-mcp/.venv/bin/withings-mcp4. First sync
In Claude Code, say: "Sync my Withings data"
This runs withings_sync to populate the local cache. Subsequent syncs only fetch new data.
If anything does not work - no data where you expect it, a sync that stops happening - run withings-mcp doctor. It reports the paths and credentials actually in use and what needs fixing, without making an API call.
You can also sync from the command line without an MCP client:
.venv/bin/withings-mcp sync # all data types, last 30 days
.venv/bin/withings-mcp sync --types body,sleep # a subset
.venv/bin/withings-mcp sync --days 90 # deeper history on first syncCLI
withings-mcp Start the MCP server (stdio transport)
withings-mcp auth Interactive OAuth setup (opens the browser)
withings-mcp sync Sync data to the local cache (--types, --days)
withings-mcp doctor Check the setup and report what needs fixing
withings-mcp --version Print the installed package versionConfiguration
Environment Variable | Default | Description |
|
| Directory for credentials and tokens |
|
| SQLite database path |
Example Prompts
"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"
Development
# Install with dev dependencies
uv pip install -e . && uv pip install pytest
# Run tests (all use in-memory SQLite with fictional data)
.venv/bin/python -m pytest tests/ -v # .venv\Scripts\python on WindowsSecurity
Read-only: No tools modify data on Withings servers
Local storage: Health data stays in your local SQLite database
Token storage: OAuth tokens stored in
config/(gitignored; created 0600 on POSIX - Windows ignores the mode and governs access by ACLs)Error messages: Never contain health data values - only status codes
Pre-commit hook: An optional hook (
scripts/check-no-data.sh) blocks database files, files underconfig/and large files from commits. It does not read file contents. Install it with the one-liner in CONTRIBUTING.md
Contributing
See CONTRIBUTING.md for development setup, the test workflow, and the pre-commit hook. Changes are tracked in CHANGELOG.md.
License
GPL-3.0-or-later
Available Tools
8 toolswithings_get_activityA
Get daily activity summaries (steps, distance, calories, active time).
Returns one entry per day from the local cache by default. Run withings_sync first to populate the cache.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. live: If true, fetch from Withings API instead of cache.
Returns daily activity data sorted by date, with steps, distance in km, calories, and active minutes by intensity level. Not for workout sessions -- use withings_get_workouts instead.
Inputs: live, end_date, start_date.
withings_get_bodyA
Get body composition measurements (weight, fat, muscle, etc.).
Returns measurements from the local cache by default. Use live=True to fetch directly from Withings API. Run withings_sync first to populate the cache.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d" for relative days. Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. metrics: Comma-separated metric filter, e.g. "weight_kg,fat_pct". Default: all available metrics. Names match exactly and are case-sensitive; one that is not on this list is refused, naming them. Options: weight_kg, height_m, lean_mass_kg, fat_pct, fat_mass_kg, muscle_mass_kg, hydration_kg, bone_mass_kg, heart_rate, systolic_bp, diastolic_bp, spo2_pct, temperature_c, body_temperature_c, pulse_wave_velocity, visceral_fat_index, basal_metabolic_rate.
live: If true, fetch from Withings API instead of cache.Returns measurements sorted by date, one entry per measurement group. Not for sleep or activity data -- use withings_get_sleep or withings_get_activity instead.
Inputs: live, metrics, end_date, start_date.
withings_get_devicesA
Get connected Withings devices with battery and firmware info.
Always fetched live from the Withings API.
Returns device type, model name, battery level (high/medium/low), and last session date for each connected device.
Inputs: no named parameters.
withings_get_heartA
Get ECG recordings and atrial fibrillation detection results.
Always fetched live from the Withings API (not cached due to large signal data). Requires a Withings device with ECG capability (ScanWatch, BPM Core).
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: 30 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today.
Returns ECG recording list with timestamps, AFib classification (negative/positive/inconclusive), and heart rate. Does not include raw signal waveforms. For resting heart rate trends, use withings_get_body or withings_get_sleep instead.
Inputs: end_date, start_date.
withings_get_sleepA
Get sleep data (summaries or detailed phases).
Summary mode (default): nightly totals with duration, sleep score, HR, respiratory rate, and snoring. From local cache unless live=True.
Detail mode (detail=True): minute-by-minute sleep phases (awake, light, deep, REM) with HR and respiratory rate. Always fetched live. Maximum 7 days per request (Withings API limit).
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "7d". Default: 7 days (detail) or 30 days (summary) back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. detail: If true, return minute-by-minute sleep phases instead of nightly summaries. Always live, max 7 days. live: If true, fetch summaries from API instead of cache. Ignored when detail=True (always live).
Returns nightly sleep data sorted by date. Not for body composition -- use withings_get_body instead.
Inputs: live, detail, end_date, start_date.
withings_get_workoutsA
Get workout sessions (type, duration, HR, calories).
Returns individual workout sessions from the local cache by default. Run withings_sync first to populate the cache.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "90d". Default: 90 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. category: Filter by workout type, case-insensitive partial match. A value matching none of the categories below is refused, naming the ones your cache holds. Options: badminton, baseball, basketball, bmx, bodyboard, boxing, calisthenics, climbing, cycling, dancing, elliptical, fencing, football, golf, handball, hiking, hockey, horse_riding, ice_hockey, ice_skating, indoor_cycling, indoor_running, indoor_walk, kitesurfing, martial_arts, multi_sport, other, pilates, rowing, rugby, run, skating, skiing, snowboarding, soccer, squash, surfing, swimming, table_tennis, tennis, volleyball, walk, waterpolo, weightlifting, windsurfing, wrestling, yoga, zumba.
live: If true, fetch from Withings API instead of cache.Returns workout sessions sorted by date with type, duration, calories, distance, and heart rate data. Not for daily step/activity totals -- use withings_get_activity.
Inputs: live, category, end_date, start_date.
withings_syncA
Sync Withings health data to the local cache.
Fetches data from the Withings API and stores it in SQLite for fast offline queries. Run this before using other withings_get_* tools.
Syncs incrementally: only fetches data newer than the last sync. First sync fetches the specified number of days of history.
Args: data_types: What to sync. Options: "all", "body", "sleep", "activity", "workouts". Comma-separated for multiple, e.g. "body,sleep". Default: "all". days: Days of history for first sync (default: 30). Ignored on subsequent syncs (uses last sync timestamp).
Returns summary of records synced per data type. Not for querying data - use withings_get_body, withings_get_sleep, withings_get_activity, or withings_get_workouts instead.
Inputs: days, data_types.
withings_trendsA
Analyse trends in cached health data.
Computes averages, min/max, and changes over time from the local cache. Auto-syncs if the cache is stale (no sync today).
Args: data_type: What to analyse. Options: "body", "sleep", "activity". period: Aggregation period. Options: "weekly", "monthly", "quarterly". Default: "monthly". start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "365d" for relative days. Default: 365 days back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. compare: Compare two periods. Format: "last_30d vs previous_30d", "2026-03 vs 2026-02", "2026-Q1 vs 2025-Q4". When set, period/start_date/end_date are ignored.
Returns aggregated averages with change indicators. For body data: weight, fat%, muscle trends. For sleep: duration, score, HR trends. For activity: steps, distance, calorie trends. Not for raw data -- use withings_get_body/sleep/activity instead.
Inputs: period, compare, end_date, data_type, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a clearly distinct data domain or action: sync, devices, body, sleep, activity, workouts, heart/ECG, and trends. Descriptions explicitly cross-reference each other and clarify boundaries such as activity vs workouts, body vs heart, and trends vs raw data.
All tools share the withings_ prefix and mostly follow a verb_noun pattern (get_body, get_sleep, get_activity). However, withings_sync and withings_trends deviate from the get_* pattern, which is a minor inconsistency.
Eight tools is well-scoped for a health data server, covering each major data type with dedicated query tools plus sync and trends. No tool appears redundant or unnecessary.
The surface covers the core Withings health domains: devices, sync, body composition, sleep, activity, workouts, ECG, and trend analysis. Minor gaps exist around user profile/goals or device settings, but these are not essential for the apparent read-focused purpose.
Maintenance
Related MCP Connectors
Read-only Apple Health data synced from your iPhone: sleep, heart rate, HRV, workouts and trends.
Read wearables and lab health data — sleep, activity, workouts, timeseries, lab tests and orders.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Read sleep, readiness, activity, stress, heart rate and workouts from the Oura Ring.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables retrieval of health data from Withings smart scales including weight measurements and comprehensive body composition metrics like fat mass, muscle mass, and hydration levels. Supports multiple users, unit preferences, and OAuth authentication for secure access to personal health data.2ISC
- AlicenseAqualityCmaintenanceEnables access to Withings Health API data including body measurements, activity tracking, sleep analysis, workouts, and heart rate monitoring through OAuth2 authentication.81MIT
- AlicenseAqualityCmaintenanceEnables AI clients to query Withings health data such as weight, body composition, heart rate, temperature, SpO2, activity, sleep, workouts, and ECG recordings.17MIT
- AlicenseAqualityFmaintenanceEnables read-only access to your own Withings health data through a personal developer app, exposing body measurements, blood pressure, daily activity, sleep summaries, and linked devices for natural-language queries.8MIT