Skip to main content
Glama

withings-mcp

CI License: GPL v3 Python 3.13+ PyPI Glama MCP Server

Withings Health API용 MCP 서버로, OAuth, 로컬 SQLite, 추세 분석을 지원합니다.

다른 Withings MCP 서버와 차별화되는 점:

  • 빠른 오프라인 조회 및 과거 추세 분석을 위한 로컬 SQLite 캐시

  • 증분 동기화 - 마지막 동기화 이후의 새 데이터만 가져옵니다

  • 광범위한 Withings 지원: 17가지 체성분 지표와 수면, 일일 활동, 운동, 심전도(ECG)/심방세동(AFib)

  • 자동 OAuth 토큰 갱신 (액세스 토큰: 3시간, 리프레시 토큰: 1년)

  • mcp 외에 추가 의존성 없음 (HTTP는 표준 라이브러리 사용)

  • Python 3.13+

도구

도구

설명

데이터 소스

withings_sync

Withings API에서 로컬 캐시로 데이터 동기화

실시간 API -> SQLite

withings_get_body

체성분 (체중, 체지방률, 근육량, 골량, 혈압, SpO2)

로컬 캐시 (오래된 경우 자동 동기화)

withings_get_sleep

수면 요약, 또는 detail=True로 상세 단계 시계열

캐시 (요약) / 실시간 (상세)

withings_get_activity

일일 걸음 수, 거리, 칼로리, 활동 시간

로컬 캐시 (오래된 경우 자동 동기화)

withings_get_workouts

운동 세션 (유형, 시간, 심박수)

로컬 캐시 (오래된 경우 자동 동기화)

withings_get_heart

심전도(ECG) 기록 및 심방세동(AFib) 감지

실시간 API (항상)

withings_get_devices

배터리 상태를 포함한 연결된 기기

실시간 API (항상)

withings_trends

기간 평균, 주간/월간/분기별 추세, 비교

로컬 캐시 (오래된 경우 자동 동기화)

캐시 기반 조회 도구는 데이터가 오래된 경우 자동으로 동기화하며, live=True를 전달하면 캐시를 우회하고 Withings API에서 직접 가져옵니다. withings_get_heart와 withings_get_devices는 항상 실시간으로 동작합니다. withings_get_sleep(detail=True)는 분 단위 수면 단계를 반환합니다 (실시간, 요청당 최대 7일).

Related MCP server: Withings MCP Server

사전 요구 사항

  • Python 3.13+

  • uv (권장) 또는 pip

  • Withings 개발자 계정 및 등록된 애플리케이션

설치

pip install withings-mcp

또는 uvx withings-mcp로 설치 없이 실행할 수 있습니다. 클론에서 개발하는 경우:

git clone https://github.com/partymola/withings-mcp.git
cd withings-mcp
uv venv --python 3.13 .venv
uv pip install -e .

설정

1. Withings 앱 등록

  1. https://developer.withings.com/dashboard로 이동

  2. 새 애플리케이션 생성

  3. 콜백 URL을 http://localhost:8585로 설정

  4. 클라이언트 ID와 클라이언트 시크릿을 기록

2. 인증

.venv/bin/withings-mcp auth

브라우저에서 Withings 인증이 열립니다. 승인 후 토큰은 config/에 로컬로 저장됩니다.

3. Claude Code에 등록

claude mcp add -s user withings -- /path/to/withings-mcp/.venv/bin/withings-mcp

4. 첫 동기화

Claude Code에서 "Sync my Withings data"라고 말합니다.

withings_sync를 실행하여 로컬 캐시를 채웁니다. 이후 동기화는 새 데이터만 가져옵니다.

문제가 발생한 경우 - 예상한 위치에 데이터가 없거나, 동기화가 중단되는 경우 - withings-mcp doctor를 실행합니다. API 호출 없이 실제 사용 중인 경로와 자격 증명, 그리고 수정해야 할 사항을 보고합니다.

MCP 클라이언트 없이도 명령줄에서 동기화할 수 있습니다:

.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 sync

CLI

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 version

구성

환경 변수

기본값

설명

WITHINGS_MCP_CONFIG_DIR

./config/

자격 증명 및 토큰 저장 디렉터리

WITHINGS_MCP_DB_PATH

./withings.db

SQLite 데이터베이스 경로

예시 프롬프트

  • "내 Withings 데이터 동기화해 줘"

  • "지난 3개월간 체중 변화 보여 줘"

  • "올해 수면 패턴이 어떻게 변했어?"

  • "이번 달과 지난달 체성분 비교해 줘"

  • "3월에 어떤 운동을 했어?"

  • "연결된 Withings 기기 뭐가 있어?"

  • "분기별 수면 추세 보여 줘"

개발

# 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 Windows

보안

  • 읽기 전용: Withings 서버의 데이터를 수정하는 도구가 없습니다

  • 로컬 저장: 건강 데이터는 로컬 SQLite 데이터베이스에만 저장됩니다

  • 토큰 저장: OAuth 토큰은 config/에 저장됩니다 (gitignored; POSIX에서는 0600 권한으로 생성 - Windows는 권한을 무시하고 ACL로 관리)

  • 오류 메시지: 건강 데이터 값을 포함하지 않습니다 - 상태 코드만 포함

  • Pre-commit 훅: CONTRIBUTING.md의 한 줄 명령으로 설치하는 선택적 훅(scripts/check-no-data.sh)이 데이터베이스 파일과 자격 증명이 커밋되는 것을 차단합니다

기여

개발 환경 설정, 테스트 워크플로우, pre-commit 훅에 대한 자세한 내용은 CONTRIBUTING.md를 참조하세요. 변경 사항은 CHANGELOG.md에 기록됩니다.

라이선스

GPL-3.0-or-later

Available Tools

8 tools
withings_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.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 8 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      2
      ISC
    • A
      license
      A
      quality
      C
      maintenance
      Enables access to Withings Health API data including body measurements, activity tracking, sleep analysis, workouts, and heart rate monitoring through OAuth2 authentication.
      8
      1
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      Enables 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.
      8
      MIT