Withings Mcp

io.github.partymola由 GitHub 帳號 partymola 發布v0.11.0更新於 Nov 6, 2026

MCP server for the Withings Health API with OAuth, local SQLite cache, and trend analysis.

概覽

AI 產生的概覽

面向 Withings 健康 API 的本機 MCP 伺服器,將身體、睡眠、活動、運動與心臟資料同步到 SQLite 快取並進行趨勢分析。

可以做什麼
  • 將 Withings 資料同步到本機 SQLite 快取,支援增量同步或指定歷史天數
  • 從快取查詢身體組成、每日活動與運動紀錄,也可略過快取直接即時取得
  • 讀取睡眠摘要或逐分鐘睡眠階段明細,以及心電圖與心房顫動紀錄
  • 列出已連線裝置及其電量狀態
  • 計算期間平均值、週/月/季趨勢與期間比較
適用情境
適合讓助理回答關於自身 Withings 量測資料的問題,例如體重與身體組成、睡眠、步數、運動、心電圖,並進行期間比較或長期趨勢分析,也可離線使用快取資料。
執行需求
需要 Python 3.13+ 與 pip 或 uv,以本機 stdio 程序執行。需要 Withings 開發者帳號與已註冊應用程式(回呼網址為本機位址),並完成一次互動式 OAuth 授權,權杖儲存在本機。選用環境變數 WITHINGS_MCP_CONFIG_DIR 與 WITHINGS_MCP_DB_PATH 可指定憑證與資料庫位置。同步與即時查詢需要網路存取。
安裝前請注意
OAuth 權杖儲存在設定目錄中,應妥善保護該目錄並避免提交到版本控制。個人健康資料會寫入本機 SQLite 資料庫。工具對 Withings 端為唯讀,但同步與即時查詢會向 Withings API 送出請求。清單未宣告驗證或環境變數,設定依賴命令列授權流程。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Withings Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

withings-mcp

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

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

ToolDescriptionData source
withings_syncSync data from Withings API to local cacheLive API -> SQLite
withings_get_bodyBody composition (weight, fat%, muscle, bone, BP, SpO2)Local cache (auto-syncs if stale)
withings_get_sleepSleep summaries, or detailed phase time-series with detail=TrueCache (summary) / live (detail)
withings_get_activityDaily steps, distance, calories, active timeLocal cache (auto-syncs if stale)
withings_get_workoutsWorkout sessions with type, duration, HRLocal cache (auto-syncs if stale)
withings_get_heartECG recordings and AFib detectionLive API (always)
withings_get_devicesConnected devices with battery statusLive API (always)
withings_trendsPeriod averages, weekly/monthly/quarterly trends, comparisonsLocal 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).

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

bash
pip install withings-mcp

Or run it without installing with uvx withings-mcp. For development from a clone:

bash
git clone https://github.com/partymola/withings-mcp.gitcd withings-mcpuv venv --python 3.13 .venvuv pip install -e .

Setup

1. Register a Withings app

  1. Go to https://developer.withings.com/dashboard
  2. Create a new application
  3. Set the callback URL to http://localhost:8585
  4. Note your Client ID and Client Secret

2. Authenticate

bash
.venv/bin/withings-mcp auth

This opens your browser for Withings authorization. After approving, tokens are saved locally in config/.

3. Register with Claude Code

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

4. 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:

bash
.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 fixingwithings-mcp --version    Print the installed package version

Configuration

Environment VariableDefaultDescription
WITHINGS_MCP_CONFIG_DIR./config/Directory for credentials and tokens
WITHINGS_MCP_DB_PATH./withings.dbSQLite 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

bash
# Install with dev dependenciesuv 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

Security

  • 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 under config/ 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

來源:README.md,提交 55228d9

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

6
  1. v0.11.0最新Nov 6, 2026
  2. v0.10.2Nov 6, 2026
  3. v0.10.1Nov 5, 2026
  4. v0.10.0Nov 4, 2026
  5. v0.9.0Nov 3, 2026
  6. v0.8.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分