Skip to main content
Glama
partymola
by partymola

withings-mcp

CI License: GPL v3 Python 3.13+

用于 Withings Health API 的 MCP 服务器,具备 OAuth、本地 SQLite 缓存和趋势分析功能。

此服务器与其他 Withings MCP 服务器的区别:

  • 本地 SQLite 缓存,用于快速离线查询和历史趋势分析

  • 增量同步 - 仅获取自上次同步以来的新数据

  • 支持所有 200 多种 Withings 测量类型(身体成分、睡眠、活动、锻炼、心电图)

  • 自动 OAuth 令牌刷新(访问令牌:3 小时,刷新令牌:1 年)

  • mcp 外零依赖(使用标准库进行 HTTP 通信)

  • Python 3.13+

工具

工具

描述

withings_sync

将数据从 Withings API 同步到本地缓存

withings_get_body

身体成分(体重、体脂率、肌肉量、骨量、血压、血氧饱和度)

withings_get_sleep

睡眠摘要或详细的阶段时间序列

withings_get_activity

每日步数、距离、卡路里、活动时间

withings_get_workouts

包含类型、持续时间、心率的锻炼会话

withings_get_heart

心电图记录和房颤检测

withings_get_devices

带有电池状态的已连接设备

withings_trends

周期平均值、周/月/季度趋势、对比分析

Related MCP server: Withings MCP Server

先决条件

  • Python 3.13+

  • uv(推荐)或 pip

  • Withings 开发者账户和已注册的应用程序

安装

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. 记录您的 Client ID 和 Client Secret

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_CONFIG_DIR

./config/

凭据和令牌的目录

WITHINGS_MCP_DB_PATH

./withings.db

SQLite 数据库路径

示例提示词

  • “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”

开发

# Install with dev dependencies
uv pip install -e . && uv pip install pytest

# Run tests (74 tests, all use in-memory SQLite with fictional data)
.venv/bin/python -m pytest tests/ -v

安全性

  • 只读:没有任何工具会修改 Withings 服务器上的数据

  • 本地存储:健康数据保留在您的本地 SQLite 数据库中

  • 令牌存储:OAuth 令牌存储在 config/ 中(已加入 gitignore,文件权限为 0600)

  • 错误消息:绝不包含健康数据值 - 仅包含状态码

  • 预提交钩子 (Pre-commit hook):拒绝将数据库文件和凭据提交到代码库

贡献

请参阅 CONTRIBUTING.md 了解开发设置、测试工作流程和预提交钩子。变更记录在 CHANGELOG.md 中。

许可证

GPL-3.0-or-later

Install Server
A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
31dResponse time
3wRelease cycle
6Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    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
  • A
    license
    A
    quality
    B
    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
    -
    quality
    C
    maintenance
    Read-only Model Context Protocol server for Withings weight and body-composition history, providing normalized measurements, weight history, and latest measurements via OAuth 2.0.
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for Withings health data — sleep, activity, heart, and body metrics.

  • Connect your Oura Ring account securely in minutes. Enable authorized access to your sleep, activi…

  • Glucose readings from your LibreLink Up sensor: graph, logbook, stats and summaries (read-only). Sec

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/partymola/withings-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server