Renpho Health MCP

Renpho Health MCP

Enables AI agents to query and analyze Renpho smart scale data (weight, body fat, etc.) by syncing it from the Renpho app and exposing it through MCP tools for conversational exploration.

Category
访问服务器

README

Renpho Health MCP

License: MIT Python 3.11+ Interface: CLI + MCP

Own your Renpho smart-scale data — pull it out of the Renpho app into a raw time series log on your machine, and explore it conversationally from an AI agent.

Renpho scales only expose their readings through the Renpho mobile app — no export, no official API. This project logs in with your Renpho account, pulls every reading (weight, body fat %, muscle, water, BMI, and the rest), and keeps them as an append-only log you control. It also ships an MCP server so Claude Code (or any MCP-capable agent) can answer questions about your history — "what's my weight trend this year?", "lowest body fat ever?" — by querying that log.

Demo

Exploring the data from Claude Code via the MCP server:

renpho-health MCP demo

Watch the full video for higher quality.

How it works

  1. You provide your Renpho account credentials in a local .env.
  2. A sync authenticates with Renpho and pulls your full reading history — the API has no date filter, so every sync fetches everything.
  3. Readings are deduplicated by timestamp and appended to a raw JSONL log (the source of truth); a spreadsheet-friendly CSV is regenerated alongside it.
  4. You explore the log directly (it's plain files) or via the MCP server, which exposes query/trend tools to an AI agent. The server does the math and returns data; the agent reasons over it.

Nothing leaves your machine except the calls to Renpho's own servers. There is no LLM inside this project — the "intelligence" is whatever agent you connect to the MCP server.

Quick start

pip install -e ".[dev]"          # install
cp .env.example .env             # then add your Renpho email + password
renpho-sync                      # pull your history into data/renpho_log.jsonl

Then register the MCP server (see Usage) to explore it from an AI agent.

Usage

Sync your data

Run a sync whenever you want to capture new weigh-ins:

renpho-sync                      # one-shot, no server (also: python -m renpho_health.cli)

It's safe to run repeatedly — readings are deduplicated by timestamp, so re-runs never create duplicates:

{ "pulled": 68, "new": 2, "skipped": 66, "total": 68 }

Two files are written (paths configurable — see Configuration):

  • data/renpho_log.jsonl — the raw, append-only source of truth, one reading per line with every field the scale returned.
  • data/renpho_log.csv — a spreadsheet-friendly view, regenerated from the JSONL on every sync.

There's also an HTTP trigger if you prefer a running service — POST /sync (plus GET /health):

uvicorn renpho_health.main:app --reload
curl -X POST http://127.0.0.1:8000/sync

Explore your data with an AI agent (MCP)

The MCP server lets an AI agent query your readings. It reads the last-synced log offline; the refresh tool pulls new readings on demand.

Register it in Claude Code (requires the claude CLI — npm install -g @anthropic-ai/claude-code). This registers it at user scope so it's available in every session, with absolute paths baked in so it works from any folder:

claude mcp add -s user renpho \
  -e RENPHO_LOG_PATH=/absolute/path/to/data/renpho_log.jsonl \
  -e RENPHO_CSV_PATH=/absolute/path/to/data/renpho_log.csv \
  -- /absolute/path/to/.venv/Scripts/renpho-mcp

Use absolute paths (the launcher is renpho-mcp.exe on Windows). Equivalently, the launch command can be python -m renpho_health.mcp_server using the venv's Python.

Start a new session, confirm with /mcp (or claude mcp list), then ask e.g. "using renpho, what's my current weight and how far am I down this year?" The server exposes these tools plus a renpho://readings resource:

Tool Answers
list_metrics What metrics exist, their units, and the date range covered
latest Your most recent reading, all metrics
history Readings over an ISO date range, or one metric's series
stats min/max/mean/first/last/change for a metric over a range
trend Direction and per-week rate of change
refresh Pull new readings from Renpho into the local log

Notes:

  • Dates are ISO 8601 (YYYY-MM-DD) only, so there's no DD-MM/MM-DD ambiguity — the agent resolves "last 3 months" to a real date before calling.
  • Units are reported per metric from a curated map (values are stored canonically, e.g. weight in kg); metrics whose unit isn't certain report null rather than guess.
  • The read-only tools work from anywhere; refresh additionally needs RENPHO_EMAIL/RENPHO_PASSWORD — either run from the project folder (so .env loads) or add them as -e vars when registering. See docs/adr/0004-mcp-server.md.

Configuration

Copy .env.example to .env and fill in your Renpho account:

Variable Required Default Purpose
RENPHO_EMAIL for sync/refresh Your Renpho account email
RENPHO_PASSWORD for sync/refresh Your Renpho account password
RENPHO_LOG_PATH no data/renpho_log.jsonl Raw JSONL log path
RENPHO_CSV_PATH no data/renpho_log.csv Derived CSV path

Your credentials and the data/ directory (personal health data) are gitignored and never leave your machine. Renpho has no official API; this talks to Renpho's app backend using a reverse-engineered protocol (see docs/adr/0002-own-renpho-client.md).

Architecture

A pull pipeline feeds a local log that two front ends read from: an HTTP endpoint / CLI for syncing, and an MCP server for querying. All the analytics live in a pure, testable module; the MCP server and HTTP app are thin wrappers over it.

src/renpho_health/
  renpho/        # in-repo Renpho API client (AES-128-ECB envelope)
  store.py       # append-only JSONL log + derived CSV, dedup by timeStamp
  sync.py        # pull -> dedup -> log pipeline (run_sync)
  cli.py         # `renpho-sync` command
  main.py        # FastAPI app: POST /sync, GET /health
  queries.py     # pure analytics over the log (stats, trend, history)
  mcp_server.py  # MCP server: tools + renpho://readings resource
tests/           # pytest suite (no network — fakes the Renpho client)
docs/            # specs, ADRs, devlog

Roadmap

  • Sync the log into a destination of your choosing — a Google Doc or a Markdown file in a Google Drive vault (spec).
  • An automatic scheduler so syncs run without manual triggering.

Changelog & development notes

See CHANGELOG.md for release history, docs/DEVLOG.md for development history, docs/adr/ for design decisions, and docs/specs/ for feature specs.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选