# handsomejustin/mijia-control [Health: Active]

**Category:** 🏠 Home Automation  
**Repository:** https://github.com/handsomejustin/mijia-control  
**GitHub Stars:** 77  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/handsomejustin-mijia-control

## Description
Control Xiaomi/Mijia smart home devices (lights, AC, heaters, robots, cameras) through MCP. Includes web dashboard, REST API, CLI, SocketIO, energy monitoring, and automation rules.

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What handsomejustin/mijia-control MCP server does

handsomejustin/mijia-control provides an MCP interface for Xiaomi/Mijia smart-home devices through the MijiaPilot application. Agents can discover devices, inspect device details and specifications, read properties, change properties, trigger device actions, and execute scenes. The server also exposes home and BLE sensor information through dedicated tools.

The project is intended for the Home Automation category and supports devices such as lights, switches, sensors, heaters, air-conditioning accessories, robot cleaners, and cameras where the underlying Mijia API and device capabilities support them. It also includes a web interface, REST API, command-line client, energy records, automation rules, device groups, and favorites, although those interfaces are separate from the MCP tool layer.

## How it works

The MCP process communicates with the MijiaPilot Flask service rather than connecting directly to Xiaomi devices. The web service must be running first, and the MCP process uses its authenticated API. MijiaPilot relies on the `mijiaAPI` Python SDK for Xiaomi cloud communication, property access, and scene execution.

The available MCP tools include:

- `list_devices` for discovering devices
- `get_device` for device details and specifications
- `get_property` and `set_property` for reading and changing attributes
- `run_action` for invoking device actions
- `list_scenes` and `run_scene` for scene management and execution
- `list_homes` and `get_home` for home information
- `list_ble_devices`, `get_ble_sensor`, and `get_ble_readings` for BLE sensor discovery and readings

The server uses the standard Python MCP SDK and is launched as a Python module, making it suitable for MCP clients that can start stdio servers.

## Setup and configuration

Install Python 3.10 or newer, clone the repository, create a virtual environment, and install the MCP extra with `pip install -e ".[mcp]"`. Install and start the main application with `python run.py`, then create an account and bind a Xiaomi account through the web interface or the documented API flow.

Set `MIJIA_API_URL` to the MijiaPilot API base URL, such as `http://127.0.0.1:5000/api`, and set `MIJIA_TOKEN` to a valid JWT access token. The token can be obtained through the CLI login command or the JWT login endpoint. A Claude Code registration uses `claude mcp add mijia -- python -m mcp_server`; other clients require their equivalent stdio-server configuration.

The broader application can use MySQL through `DATABASE_URL`. Recent versions use SQLite as a fallback when that variable is absent, but a new database still requires migrations and user registration before device control is available.

## Limitations and notes

The handsomejustin/mijia-control MCP server depends on a running MijiaPilot web service and a valid authenticated token. It does not document direct standalone device access from the MCP process. Actual controls depend on each device's exposed properties and actions.

BLE functionality requires a computer with Bluetooth access and runs through a separate scanner process. HomeKit support is an optional, separate bridge that requires its own installation and configuration; it is not an MCP client feature. The README explicitly names Claude Code, Hermes Agent, and OpenClaw as compatible MCP agents, while this listing only identifies clients that can launch a standard MCP stdio process.

_Full upstream README: https://allmcps.com/mcp/handsomejustin-mijia-control/readme_

