Do1e/mijia-api

使用代码、CLI、MCP 直接控制米家设备。

What it solves

It provides a way to programmatically control Xiaomi Mijia smart home devices using code, a command-line interface (CLI), or the Model Context Protocol (MCP), bypassing the need for the official app for basic device management.

How it works

The project implements an API wrapper that allows users to authenticate via QR code login and interact with Mijia devices. It can be used as a Python library, a standalone CLI tool, and an MCP server, enabling AI agents or other software to control home automation hardware.

Who it’s for

Developers and smart home enthusiasts who want to automate their Xiaomi ecosystem devices through custom scripts, CLI commands, or AI-powered agents.

Highlights

  • Multi-interface access: Supports Python API, CLI, and MCP for flexible integration.
  • Agent-ready: Includes built-in support for MCP and Agent Skills to make it easier for LLM-based agents to control physical devices.
  • Simple authentication: Uses a QR code login process to handle device authorization.
  • Device-specific control: Allows controlling device properties (like brightness or power state) by device name.

Related

  • Project
  • Project
  • Project
  • Project
  • Project