Skip to main content
Glama
wusaki0723
by wusaki0723

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: Health Vault

One-Click Deploy

Deploy to Cloudflare

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_KV

Fill 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 deploy

Use 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

  1. Create a KV namespace:

    npx wrangler kv namespace create MI_HEALTH_KV
  2. Fill the namespace ID output by the command into [[kv_namespaces]] in wrangler.toml, replacing your-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.

  3. Interactively set the MCP authentication token. Generate a long random string yourself for the token:

    npx wrangler secret put AUTH_TOKEN
  4. Redeploy 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>/mcp

  • Custom Header: Authorization: Bearer <your token>

The <your token> must exactly match the AUTH_TOKEN set during deployment.

Usage Flow

  1. The client first calls health_login_start to obtain loginUrl.

  2. Use any QR code tool to render loginUrl into a QR code.

  3. Scan the QR code with the Xiaomi Sports Health App and confirm the login.

  4. The client polls health_login_poll until it returns success.

  5. After successful login, use health_latest, health_sleep, health_heart, or health_steps to 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.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    C
    quality
    B
    maintenance
    Enables 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.
    10
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Self-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

View all related MCP servers

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…

View all MCP Connectors

Latest Blog Posts

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