mcp-mijia
Allows controlling Xiaomi Mi Home smart devices, including listing devices, getting/setting properties, running actions, and executing scenes.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Mijia | 米家智能家居 MCP 服务
An MCP server for controlling Xiaomi Mi Home (Mijia) smart home devices, designed for use with Xiaozhi AI assistant.
用于控制小米米家智能家居设备的 MCP 服务器,专为小智 AI 助手设计。
Overview | 概述
This project provides an MCP (Model Context Protocol) server that enables AI assistants like Xiaozhi to control Xiaomi Mi Home smart devices through natural language commands. It supports listing devices, getting/setting properties, running actions, and executing scenes.
本项目提供一个 MCP 服务器,使小智等 AI 助手能够通过自然语言命令控制小米米家智能设备。支持列出设备、获取/设置属性、运行动作和执行场景。
Related MCP server: 米家 MCP Server
Features | 特性
🏠 List and manage multiple homes | 列出和管理多个家庭
📱 Discover and control all Mi Home devices | 发现和控制所有米家设备
💡 High-level device control (on/off/toggle) | 高级设备控制(开/关/切换)
⚙️ Get and set device properties | 获取和设置设备属性
🎬 Run device actions and scenes | 运行设备动作和场景
🔍 Query device capabilities | 查询设备能力
Available Tools | 可用工具
Tool | Description |
| List all homes in the Mi Home account |
| List all devices (optionally filter by home) |
| List available properties and actions for a device |
| Get all property values for a device |
| Get a specific property value |
| Set a property value on a device |
| Run an action on a device |
| High-level control: 'on', 'off', 'toggle', or 'property=value' |
| List all scenes/automations |
| Run a scene by its ID |
Quick Start | 快速开始
Install dependencies | 安装依赖:
pip install -r requirements.txtFirst run authentication | 首次运行认证:
python test_mijia.pyFollow the prompts to log in with your Mi Home account by QR code on the first run.
首次运行时按照提示用二维码登录您的米家账号。
Run with Xiaozhi | 配合小智运行:
export MCP_ENDPOINT=wss://api.xiaozhi.me/mcp/?token=xxx
python mcp_pipe.py mijia.pyOr run all configured servers | 或运行所有配置的服务:
export MCP_ENDPOINT=wss://api.xiaozhi.me/mcp/?token=xxx
python mcp_pipe.pyInteractive mode for testing (optional) | 交互模式测试(可选):
python test_mijia.py -iEnter commands interactively to test device control. | 交互式输入命令测试设备控制。
Commands:
List device capabilities
Get device properties
Get specific property
Set property
Control device (on/off/toggle)
Run device action
List scenes
Run scene
Configuration | 配置
Environment Variables | 环境变量
Variable | Description |
| Custom path for authentication file (optional) |
| WebSocket endpoint for Xiaozhi connection, such as wss://api.xiaozhi.me/mcp/?token=<YourToken> |
MCP Config | MCP 配置
The mcp_config.json defines the server configuration:
{
"mcpServers": {
"local-stdio-mijia": {
"type": "stdio",
"command": "python",
"args": ["-m", "mijia"]
}
}
}Project Structure | 项目结构
File | Description |
| MCP server with all smart home control tools |
| WebSocket communication pipe for Xiaozhi |
| Server configuration |
| Test script for verifying functionality |
Usage Examples | 使用示例
Once connected to Xiaozhi, you can use natural language commands like:
连接小智后,您可以使用自然语言命令,例如:
"Turn on the living room light" | "打开客厅灯"
"Set bedroom light brightness to 50%" | "把卧室灯亮度设为50%"
"What's the temperature of the air conditioner?" | "空调温度是多少?"
"Run the 'Good Night' scene" | "执行'晚安'场景"
"List all my devices" | "列出所有设备"
Requirements | 环境要求
Python 3.10+
python-dotenv>=1.2.1
websockets>=15.0.1
mcp>=1.20.0
pydantic>=2.12.3
mcp-proxy>=0.10.0
fastmcp>=2.13.0
mijiaAPI>=3.0.0
Contributing | 贡献指南
Contributions are welcome! Please feel free to submit a Pull Request.
欢迎贡献代码!请随时提交 Pull Request。
License | 许可证
This project is licensed under the MIT License - see the LICENSE file for details.
本项目采用 MIT 许可证 - 详情请查看 LICENSE 文件。
Acknowledgments | 致谢
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Control your Tesla from your AI assistant - climate, charging, access, and security.
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each device’s supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language control of Xiaomi smart home devices through MCP, focusing on homes, rooms, device names, and scenes without requiring protocol details.30 PyPI75MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that enables AI agents to control Xiaomi Mi Home smart devices through natural language, with support for listing devices, controlling properties, and running scenes.MIT
- AlicenseNot gradedqualityCmaintenanceEnables control of local Xiaomi smart home devices via MCP, allowing reading real-time status and setting properties through natural language, without relying on the Xiaomi cloud.MIT