# mifit

> mifit is an MCP server for health and science. Read your own Mi Fitness sleep, heart rate, steps and workouts from an AI assistant. It can run locally on your machine or as a hosted remote server.

- **Kind:** MCP server
- **Platforms:** CLI, self-hosted, API
- **Repository:** https://github.com/jenwein/mifit
- **MCP Registry name:** io.github.Jenwein/mifit
- **Categories:** [health and science](https://ai-powered.com/categories/health-and-science)
- **Listing updated:** 2026-11-15

## About

Xiaomi offers no public API for individuals, so this project signs in to your own Mi Fitness account by QR code and reads the data the app has already synced to the Xiaomi cloud. The same code ships as a Python library, a command-line tool and an MCP server.

The README lists the data domains it reads: steps, raw and daily heart rate, calories, sleep with stage timelines, workouts with per-second detail for outdoor runs and rides, blood oxygen, stress, activity, weight and the profile. Values were compared with the app on one real account in the China region, and body composition and the sleep score are only available as raw rows.

The server runs locally over stdio and only reads health data. GPS routes are off unless you start it with a flag, and a session file in your home folder holds a token that the README warns reaches your whole Xiaomi account, so it should be treated like a password. It is unofficial and not affiliated with Xiaomi.

## Features

- **Broad health coverage:** Reads steps, heart rate, calories, sleep, workouts, SpO2, stress, activity and weight.
- **QR-code login:** Signs in by scanning a QR code; your password never passes through the tool.
- **GPS off by default:** Workout routes are returned only when started with an allow-GPS option.
- **Raw data access:** A raw command returns uninterpreted rows for keys it does not model.
- **Library and CLI too:** The same reader is usable from Python or the command line.
- **Claude Desktop bundle:** A one-click .mcpb extension is published with each release.

## Good for

- Ask how you slept last week
- Compare resting heart rate across a month
- Export workout history as JSON
- Review daily stress bands
- Pull weight and BMI entries into a script

## Install

### Claude Code (Terminal)

```sh
claude mcp add mifit -- uvx mifit
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mifit": {
      "command": "uvx",
      "args": [
        "mifit"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mifit": {
      "command": "uvx",
      "args": [
        "mifit"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mifit": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mifit"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mifit": {
      "command": "uvx",
      "args": [
        "mifit"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mifit": {
      "command": "uvx",
      "args": [
        "mifit"
      ]
    }
  }
}
```

## Tools

- `get_status`: Shows today's date, time zone, login state and GPS setting.
- `get_steps`: Reads steps and distance per day.
- `get_calories`: Reads daily calories: resting, active, intake and total.
- `login_start`: Starts a login and returns a QR code to scan.

## FAQ

### Is it official?

No. The README says it is unofficial and not affiliated with or supported by Xiaomi.

### Where does my login stay?

In a session file under ~/.mifit on your computer; results of tool calls still go to your assistant's model provider.

### Does it change my data?

No, it only reads health data; the login tools save a new session locally.

### Does it share GPS tracks?

Only if started with --allow-gps and the assistant asks for a route.

### How do I add mifit to Claude Code?

Run this command in your terminal: claude mcp add mifit -- uvx mifit

### What are the best alternatives to mifit?

The closest alternatives to mifit are Mi Fitness Data Bridge, Metrics Nest, Health Access MCP, HealthAPI and Memory.fit.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Mi Fitness Data Bridge](https://ai-powered.com/mcp/mi-fitness-data-bridge): Mi Fitness Data Bridge is an open-source MCP server for health and science.
- [Metrics Nest](https://ai-powered.com/mcp/metrics-nest): Metrics Nest is an MCP server for health and science.
- [Health Access MCP](https://ai-powered.com/mcp/health-access-mcp): Health Access MCP is an open-source MCP server for health and science.
- [HealthAPI](https://ai-powered.com/mcp/healthapi): HealthAPI is an MCP server for health and science.
- [Memory.fit](https://ai-powered.com/mcp/memory-fit): Memory.fit is an MCP server for knowledge and memory.
- [Quantified Self MCP](https://ai-powered.com/mcp/quantified-self-mcp): Quantified Self MCP is an MCP server for health and science.
- [Apple Health AI Bridge](https://ai-powered.com/mcp/apple-health-ai-bridge): Apple Health AI Bridge is an open-source MCP server for health and science.
- [A Good Sign: Apple Health MCP](https://ai-powered.com/mcp/a-good-sign-apple-health-mcp): A Good Sign: Apple Health MCP is a paid MCP server for health and science.

---
Source: https://ai-powered.com/mcp/mifit
