mi-health-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mi-health-mcpHow was my sleep last night?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mi-health-mcp
项目简介
mi-health-mcp 把小米运动健康的亲友数据,包括睡眠、心率和步数,通过 MCP 协议暴露给 RikkaHub 等 LLM 客户端。服务运行在 Cloudflare Workers 上,无需自建服务器,可在 Cloudflare 免费额度内使用。本项目基于 Misty02600/mi-fitness-python 的接口逆向成果改写为 Cloudflare Worker + MCP 服务,感谢上游。
Related MCP server: Health Vault
一键部署
部署流程要求绑定 Cloudflare KV。如果按钮流程提示创建或选择 KV namespace,请按引导完成,并确保绑定名为 MI_HEALTH_KV。
按钮不灵时的手动部署
需要 Node.js 20 或更高版本,以及一个 Cloudflare 账号。
git clone https://github.com/wusaki0723/mi-health-mcp.git
cd mi-health-mcp
npm install
npx wrangler login
npx wrangler kv namespace create MI_HEALTH_KV将命令输出的 namespace ID 填入 wrangler.toml,替换 your-kv-namespace-id。然后设置访问令牌并部署:
npx wrangler secret put AUTH_TOKEN
npx wrangler deployAUTH_TOKEN 的值请使用自己生成的长随机串,不要写进源码、wrangler.toml 或 Git。
部署后配置
创建 KV namespace:
npx wrangler kv namespace create MI_HEALTH_KV将命令输出的 namespace ID 填入
wrangler.toml的[[kv_namespaces]],替换your-kv-namespace-id,然后重新部署。通过一键部署时,也可以在按钮流程中按引导创建并绑定 KV。交互式设置 MCP 鉴权令牌。令牌请自行生成一个长随机串:
npx wrangler secret put AUTH_TOKEN配置有变化时重新部署:
npx wrangler deploy
KV binding 名必须保持为 MI_HEALTH_KV。
客户端配置
在 RikkaHub 中打开「设置 > MCP > 新建连接 > Streamable HTTP」,填写:
URL:
https://<你的域名>/mcp自定义 Header:
Authorization: Bearer <你的 token>
其中 <你的 token> 必须与部署时设置的 AUTH_TOKEN 完全一致。
使用流程
客户端先调用
health_login_start,取得loginUrl。使用任意二维码工具把
loginUrl渲染成二维码。用小米运动健康 App 扫码并确认登录。
客户端轮调
health_login_poll,直到返回success。登录成功后,使用
health_latest、health_sleep、health_heart或health_steps查询数据。
Worker 不生成二维码图片。查询时会动态读取亲友列表并使用第一项,不在代码中写死用户 ID。
使用边界
仅供登录你自己的小米账号、查询你已获授权的亲友数据。请勿用于任何侵犯他人隐私或违反小米用户协议的用途。
许可证
本项目采用 GNU General Public License v3.0(GPL-3.0),与上游 Misty02600/mi-fitness-python 的许可证保持一致。
Related MCP Connectors
Multi-tenant hosted MCP server for Oura Ring — 21 read-only tools, OAuth per user.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Cloudflare Workers MCP server: ai-model-router
Pace is a remote MCP server that exposes wearable and fitness data to Claude via the Model Context Protocol. It connects to Garmin, Oura, Whoop, Polar, Fitbit and 20+ devices and provides 15 tools for querying sleep, activity, recovery, and training data. Hosted on Google Cloud Run, OAuth 2.1 authentication, Streamable HTTP transport. Instructions: First you need to create an account at: https://pacetraining.co and connect your wearables. After that you can connect the remote Server via Custom Connector in Claude and OAuth 2.1 Flow startet.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA personal MCP server on Cloudflare Workers that connects Claude to Google Health API v4, enabling reading of health data like activity, sleep, heart rate, SpO₂, HRV, and nutrition.MIT
- AlicenseNot gradedqualityCmaintenanceSelf-hosted MCP server that syncs Xiaomi fitness data to SQLite and provides authenticated tools to query health metrics (steps, sleep, HR, etc.) for AI assistants like Grok.GPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to query Xiaomi Mi Fitness family member sleep, heart rate, and step data via MCP, with QR-code login authentication.7GPL 3.0
- AlicenseNot gradedqualityCmaintenanceExposes Xiaomi Mi Health's friend/family sleep, heart rate, and step data to LLM clients via the MCP protocol, deployed on Cloudflare Workers.GPL 3.0