Mijia Control logo

Mijia Control

by handsomejustin

Controls Xiaomi/Mijia devices through MCP, with REST, CLI, web, automation, energy, BLE, and HomeKit support.

Install Mijia Control

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for handsomejustin/mijia-control, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

handsomejustin/mijia-control MCP server connects MCP-compatible agents to a local MijiaPilot service, which communicates with Xiaomi/Mijia devices through its REST API. It exposes tools for device discovery, property reads and writes, actions, scenes, homes, and BLE sensor data. Use it when an agent needs to inspect or control devices managed by a running MijiaPilot installation.

Use cases

  • List Xiaomi/Mijia devices and inspect their status
  • Change device properties through an AI agent
  • Run predefined home scenes
  • Query current and historical BLE sensor readings
  • Connect an MCP client to a local smart-home service

Key features

  • Device discovery and detail inspection
  • Property reads and writes
  • Device action execution
  • Scene and home management
  • BLE sensor readings
  • Authenticated local REST integration

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

9/9 checks healthy over the last 80d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars77Stargazers on the source repository.
Last commit5mo agoMost recent push to the default branch.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How Mijia Control works

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.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mijia Control

handsomejustin/mijia-control is an MCP server that connects compatible AI agents to the MijiaPilot REST service and Xiaomi/Mijia smart-home devices. Its main tools list devices, inspect details, read or set properties, run actions and scenes, inspect homes, and retrieve current or historical readings from BLE sensors.

Install it with `pip install -e ".[mcp]"` from a cloned repository. Start the MijiaPilot web service with `python run.py`, then configure the MCP process with the service URL and a JWT token before launching `python -m mcp_server` from your MCP client.

Set `MIJIA_API_URL` to the MijiaPilot API base URL and `MIJIA_TOKEN` to a valid JWT access token.

Yes, Claude Code is explicitly documented as a supported MCP agent. Register the server with `claude mcp add mijia -- python -m mcp_server`, while ensuring the MijiaPilot web service is running and the MCP process can access `MIJIA_API_URL` and `MIJIA_TOKEN`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMijia Control AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/handsomejustin-mijia-control?style=directory)](https://allmcps.com/mcp/handsomejustin-mijia-control)
HTML Embed
<a href="https://allmcps.com/mcp/handsomejustin-mijia-control"><img src="https://allmcps.com/api/badge/handsomejustin-mijia-control?style=directory" alt="Mijia Control on AllMCPs" /></a>