# Mi Fitness Data Bridge

> Mi Fitness Data Bridge is an open-source MCP server for health and science. Local tool to export your own Mi Fitness health data to SQLite, JSON, CSV and MCP. It is available on CLI, self-hosted, Linux, macOS and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, Linux, macOS, Windows
- **Repository:** https://github.com/shkyyy18/mi-fitness-data-bridge
- **MCP Registry name:** io.github.shkyyy18/mi-fitness-data-bridge
- **Categories:** [health and science](https://ai-powered.com/categories/health-and-science)
- **Listing updated:** 2026-11-18

## About

The README describes a local connector that pulls records from the Mi Fitness (Xiaomi) cloud into a SQLite database on your own machine. Once cached, the data can be exported as JSON or CSV files, or queried through a local stdio MCP server that an AI client can launch. Supported data types include daily activity, sleep, workouts, body measurements, heart rate and, where the device provides them, SpO2, stress and abnormal heartbeat events.

The project is explicitly unofficial and experimental. It relies on non-public Xiaomi endpoints, so logins, device support and certain data types can stop working when the upstream service changes. Access requires the user's own account ID and passToken, which the setup command stores in the OS keyring when available.

It suits people who want a personal backup of their fitness records or a local dataset for their own analysis scripts. The README states it is not a medical tool and does not offer coaching, dashboards or hosted accounts.

## Features

- **Local SQLite cache:** Synced and normalised records are stored in a database on the user's machine.
- **JSON and CSV export:** Records can be exported by dataset and date range, with CSV written as UTF-8 with BOM for Excel.
- **Local stdio MCP server:** Exposes query and sync tools to a local MCP client over standard input and output.
- **Interactive credential setup:** The setup command hides passToken input and stores credentials in the OS keyring when available.
- **Synthetic demo:** A bundled script runs the export pipeline on synthetic records without any network access.

## Good for

- Keep a personal offline backup of Mi Fitness activity, sleep and workout records
- Load fitness history into a spreadsheet or personal analysis script via CSV or JSON
- Let a local AI assistant query recent sleep or heart rate data through MCP
- Test the export pipeline with synthetic data before connecting a real account

## Tools

- `get_connection_status`: Checks connection status.
- `sync_data`: Starts a data sync.
- `get_sync_status`: Reports sync task status.
- `cancel_sync`: Cancels a running MCP sync.
- `query_sync_history`: Lists past sync tasks.
- `get_profile`: Returns profile information.
- `query_daily_activity`: Queries daily activity records.
- `query_metric_series`: Queries metric time series.
- `get_data_coverage`: Reports which date ranges have data.
- `query_body_measurements`: Queries body measurement records.
- `query_sleep`: Queries sleep records.
- `query_workouts`: Queries workout records.
- `query_workout_series`: Queries workout time series.
- `workout_detail_series`: Queries per-second workout detail series.
- `query_heart_rate`: Queries heart rate records.
- `query_spo2`: Queries SpO2 records.
- `query_stress`: Queries stress records.
- `query_abnormal_heart_beat`: Queries abnormal heartbeat events.

## FAQ

### Is this an official Xiaomi product?

No. The README says it is unofficial and experimental, with no affiliation or endorsement from Xiaomi.

### Which data types can it sync?

Daily activity, heart rate, body measurements, sleep, workouts, SpO2, stress and abnormal heartbeat events, depending on device, account region and upstream support.

### Does the MCP server connect to Xiaomi on startup?

No. According to the README it connects only when a status check or sync operation is requested.

### Can the exported files be shared safely?

The README warns that exports are sensitive personal data and may include the plaintext user_id, so they should be stored and shared carefully.

### Is Mi Fitness Data Bridge free?

Yes. Mi Fitness Data Bridge is open source, so you can use and self-host it for free.

### What are the best alternatives to Mi Fitness Data Bridge?

The closest alternatives to Mi Fitness Data Bridge are mifit, Apple Health AI Bridge, Quantified Self MCP, Health Access MCP and durely insights MCP for Garmin.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.

## Alternatives

- [mifit](https://ai-powered.com/mcp/mifit): mifit 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.
- [Quantified Self MCP](https://ai-powered.com/mcp/quantified-self-mcp): Quantified Self MCP 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.
- [durely insights MCP for Garmin](https://ai-powered.com/mcp/durely-insights-mcp-for-garmin): durely insights MCP for Garmin is an open-source MCP server for health and science.
- [Health MCP](https://ai-powered.com/mcp/health-mcp-2): Health MCP is an open-source MCP server for health and science.
- [Health MCP](https://ai-powered.com/mcp/health-mcp): Health MCP is an MCP server for health and science.
- [Mouve](https://ai-powered.com/mcp/mouve): Mouve is a freemium MCP server for health and science.

---
Source: https://ai-powered.com/mcp/mi-fitness-data-bridge
