小米运动健康数据本地 MCP Server + REST API + Web 仪表盘 | Local-first Mi Fitness data hub: MCP, REST API, web dashboard, QR login
View on GitHub ↗小米运动健康(Mi Fitness)数据的本地一站式解决方案:MCP Server + REST API + 可视化 Web 仪表盘。把你自己账号里的健康数据同步到本地 SQLite,供 AI 客户端、其他程序或浏览器直接查询分析。
Local-first Mi Fitness (Xiaomi health) data hub: sync your own health data to a local SQLite database, exposed via MCP, REST API, and a web dashboard.
- 🇨🇳 中国区云端适配(--region cn),同时支持 ru/de/sg/us 等国际区 - 📦 三种接入方式:MCP Server(AI 客户端)、REST API(任意程序)、Web 仪表盘(浏览器) - 💤 全量健康指标:每日活动、逐分钟心率、睡眠分期(深睡/浅睡/REM/小睡)、运动记录、身体成分、血氧(SpO₂)、压力、异常心跳 - 🔄 增量同步引擎:7 天分块拉取 + 断点续传游标 + UPSERT 幂等入库,重复同步不产生脏数据 - 🔑 API Key 体系:用小米凭据换取 mifsk Key(类大模型平台风格),支持多账号隔离、用量统计、按前缀吊销 - 📱 扫码登录:逆向小米官方扫码流程,手机 App 扫码即可授权,告别浏览器 F12 抓 Cookie - 🖥️ 现代化 Web 仪表盘(Flask):数据图表走势、实时响应检视、cURL 一键生成、深浅主题 - 🔒 本地优先:数据、凭据、配置全部留在本机(SQLite + 系统 keyring),不上传任何第三方服务
⚠️ 非小米官方项目。全部云端接口为逆向所得,仅用于读取和分析你自己的健康数据,请遵守小米用户协议。接口可能因小米改版而失效。
类型 内容 CLI --type API 端点 ------------ 每日活动 步数、距离、活动卡路里 dailyactivity /api/summary 心率 逐分钟采样 + 静息心率 heartrate /api/heart-rate 睡眠 时长、入睡/清醒、分段(深睡/浅睡/REM) sleep /api/sleep 运动 类型、时长、距离、卡路里、心率、配速 workouts /api/workouts 身体成分 体重、BMI、体脂、肌肉量等(需体脂秤) bodymeasurements /api/body-measurements 血氧 SpO₂ 采样 spo2 /api/spo2 压力 压力分数 + 等级 stress /api/stress 异常心跳 事件起止与时长 abnormalheartbeat /api/abnormal-heart-beat
要求 Python ≥ 3.11。Linux 无系统 keyring 时可 pip install keyrings.alt(可能明文存储凭据)。
浏览器打开 http://127.0.0.1:8322/ → 点击「扫码登录」→ 用小米账号 / 米家 App 扫码确认 → 自动换取并注入 API Key。
浏览器登录 account.xiaomi.com,从 Cookie 获取 userId 与 passToken:
MCP 工具(14 个):getconnectionstatus · syncdata · getsyncstatus · getprofile · getdailysummary · querymetricseries · queryheartrate · querybodymeasurements · querysleep · queryworkouts · queryspo2 · querystress
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/HUAYUE1024--mi-fitness-mcp-cn.html)
Universal MCP server: connect any OpenAPI/Swagger, GraphQL, gRPC or SOAP API to AI agents. Security-first, local, token-efficient. Any API. One server.
soma-intelligence/open-health-syncSelf-hosted, open-source API for wearable and health data, in Go. Syncs Apple Health, Health Connect, Oura, WHOOP, Withings, Strava, Fitbit, Dexcom and more into one model, served over REST, FHIR R4,
hirotomasato/yowesGenerate realistic teacher documents (ID cards, licenses, letters) for 13 countries via MCP.
rokbenko/quackd🦆🧠 Give your small robot a brain. Tell a Microduck, a Reachy Mini, a LeRobot arm or any ROS base what you want in plain language. An LLM (Claude, OpenAI, Gemini, Grok, or a local model via Ollama, vLL
lotchuazzz-crypto/papergraph-mcpTurn arXiv and LaTeX mathematical papers into theorem dependency graphs for AI agents through MCP.
1105216375-alt/resimindNeuro-symbolic agents with verified memory. MCP math tools, an algebra repair Skill, and an open challenge. Verify solutions, learn checked rules, and reuse.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.