mi-health-mcp
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 的许可证保持一致。
This server cannot be installed
Maintenance
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
- AlicenseCqualityBmaintenanceEnables reading and syncing Xiaomi Mi Fitness health data (steps, heart rate, sleep, workouts) from the Chinese cloud region to a local SQLite database via MCP tools.103MIT
- 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
- FlicenseNot gradedqualityCmaintenanceMCP server that enables LLMs to query Apple Health data such as steps, heart rate, sleep, and workouts via natural language, with secure cloud access through OAuth.
- AlicenseNot gradedqualityCmaintenanceMCP server for read-only access to Xiaomi Mi Fitness shared family health data, enabling queries for family members, health summaries, and historical metrics via ChatGPT.GPL 3.0
Related MCP Connectors
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Connect your Oura Ring account securely in minutes. Enable authorized access to your sleep, activi…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/wusaki0723/mi-health-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server