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-mcpShow my latest sleep, heart rate, and steps"
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
Project Introduction
mi-health-mcp exposes Xiaomi Sports Health family member data, including sleep, heart rate, and steps, to LLM clients such as RikkaHub via the MCP protocol. The service runs on Cloudflare Workers, requiring no self-hosted server, and can be used within Cloudflare's free tier. This project is a rewrite of the interface reverse-engineering work from Misty02600/mi-fitness-python into a Cloudflare Worker + MCP service. Thanks to the upstream project.
Related MCP server: boyuan-health-bridge
One-Click Deploy
The deployment flow requires binding Cloudflare KV. If the button flow prompts you to create or select a KV namespace, follow the guidance and make sure the binding is named MI_HEALTH_KV.
Manual Deployment When the Button Doesn't Work
Requires Node.js 20 or higher, and a Cloudflare account.
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_KVFill the namespace ID output by the command into wrangler.toml, replacing your-kv-namespace-id. Then set the access token and deploy:
npx wrangler secret put AUTH_TOKEN
npx wrangler deployUse a long random string you generate yourself for the AUTH_TOKEN value. Do not write it into source code, wrangler.toml, or Git.
Post-Deployment Configuration
Create a KV namespace:
npx wrangler kv namespace create MI_HEALTH_KVFill the namespace ID output by the command into
[[kv_namespaces]]inwrangler.toml, replacingyour-kv-namespace-id, then redeploy. When using one-click deployment, you can also create and bind KV by following the guidance in the button flow.Interactively set the MCP authentication token. Generate a long random string yourself for the token:
npx wrangler secret put AUTH_TOKENRedeploy when configuration changes:
npx wrangler deploy
The KV binding name must remain MI_HEALTH_KV.
Client Configuration
In RikkaHub, open "Settings > MCP > New Connection > Streamable HTTP" and fill in:
URL:
https://<your-domain>/mcpCustom Header:
Authorization: Bearer <your token>
The <your token> must exactly match the AUTH_TOKEN set during deployment.
Usage Flow
The client first calls
health_login_startto obtainloginUrl.Use any QR code tool to render
loginUrlinto a QR code.Scan the QR code with the Xiaomi Sports Health App and confirm the login.
The client polls
health_login_polluntil it returnssuccess.After successful login, use
health_latest,health_sleep,health_heart, orhealth_stepsto query data.
The Worker does not generate QR code images. When querying, it dynamically reads the family member list and uses the first entry; user IDs are not hardcoded in the code.
Usage Boundaries
For logging into your own Xiaomi account and querying family member data you are authorized to access. Do not use it for any purpose that infringes on others' privacy or violates Xiaomi's user agreement.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0), consistent with the license of the upstream Misty02600/mi-fitness-python.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Multi-tenant hosted MCP server for Oura Ring — 21 read-only tools, OAuth per user.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
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
- AlicenseCqualityCmaintenanceEnables 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.1012MIT
- AlicenseNot gradedqualityBmaintenanceMCP 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
- 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
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to query Xiaomi Mi Fitness authorized family members' sleep, heart rate, and step data via MCP after QR-code login, deployable on Cloudflare Workers.GPL 3.0