Hermejia
Controls Xiaomi Mi Home smart devices, enabling listing homes/rooms/devices/scenes, reading and setting device properties, and running actions or scenes via natural language.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Hermejiaturn on the bedroom lamp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Hermejia
๐ English ยท ไธญๆ ยท ๆฅๆฌ่ช
Hermes + Mijia = Hermejia
A one-click MCP server that lets any AI agent control Xiaomi Mi Home (Mijia) smart devices through natural language.
โจ What is this?
Hermejia wraps the mijiaAPI library into a Model Context Protocol (MCP) server. After a one-time QR-code login, your AI agent can:
List homes, rooms, devices, and scenes
Read device properties (temperature, brightness, power, etc.)
Set properties and run actions
Turn devices on/off/toggle or run entire scenes
Related MCP server: xiaomi-device-control
๐ Quick Start
# 1. Clone
git clone https://github.com/HuishanLi1997/HuishanLi1997.git
cd Hermejia
# 2. One-click setup (creates venv, installs deps, runs QR auth)
bash scripts/setup.sh
# 3. Add the generated MCP config to your agent and restart itAfter setup, open mcp_config.json (or the config printed by setup.sh) and add it to your agent.
๐ Requirements
Linux / macOS / WSL (Windows is untested but may work)
Python 3.10+
Mi Home app on your phone for QR-code login
๐ง Manual Installation
git clone https://github.com/HuishanLi1997/HuishanLi1997.git
cd Hermejia
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt๐ Authentication
Xiaomi requires QR-code login for new devices. Run the helper and scan the generated QR code with the Mi Home app:
source venv/bin/activate
python scripts/auth_login.pyThe token is saved to ~/.config/mijia-api/auth.json by default. To use a custom path:
export MIJIA_AUTH_PATH=/path/to/your/auth.json
python scripts/auth_login.pyTokens last about 30 days; re-run auth_login.py to refresh.
๐ค Agent Configuration
Generic stdio MCP
{
"mcpServers": {
"hermejia": {
"type": "stdio",
"command": "/full/path/to/Hermejia/venv/bin/python",
"args": ["-m", "mijia"],
"env": {
"PYTHONPATH": "/full/path/to/Hermejia"
}
}
}
}Hermes Agent
Add to ~/.hermes/config.yaml:
mcp_servers:
hermejia:
command: "/full/path/to/Hermejia/venv/bin/python"
args: ["-m", "mijia"]
workdir: "/full/path/to/Hermejia"
env:
PYTHONPATH: "/full/path/to/Hermejia"
timeout: 30Kimi CLI / Other stdio MCP clients
Use the mcp_config.json generated in the project root and point your client to it.
Claude Desktop / Cursor
Copy the mcpServers block from mcp_config.json into your client config and adjust paths.
See docs/CONFIG.md for detailed per-client examples.
๐ ๏ธ Available Tools
Tool | Description |
| List all Mi Home homes |
| List devices (optionally filtered by home) |
| Show supported properties and actions |
| Get all property values |
| Get a single property value |
| Set a property value |
| Run a device action |
| High-level control: |
| List automations/scenes |
| Run a scene by ID |
๐งช Testing
source venv/bin/activate
python test_mijia.pyFor interactive testing:
python test_mijia.py -i๐ Project Structure
Hermejia/
โโโ mijia.py # MCP server (core tools)
โโโ mcp_pipe.py # WebSocket stdio bridge for Xiaozhi-like clients
โโโ test_mijia.py # Test / interactive CLI
โโโ scripts/
โ โโโ setup.sh # One-click setup
โ โโโ auth_login.py # QR-code auth + long-poll login
โ โโโ auto_qr.py # Auto-refresh QR code while waiting
โ โโโ gen_qrcode.py # Generate QR image only
โโโ docs/
โ โโโ CONFIG.md # Per-agent configuration guide
โโโ requirements.txt
โโโ mcp_config.json
โโโ LICENSE
โโโ README.mdโ ๏ธ Troubleshooting
Issue | Solution |
QR code expires before scanning | Use |
| Make sure the MCP |
Agent does not see tools | Restart the agent process; MCP tools are loaded at startup |
Token expired | Re-run |
๐ License
MIT โ Copyright (c) 2026 scsagentclub.
Core MCP server files are derived from oujiafan/mcp-mijia, also under MIT.
๐ Acknowledgments
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Nifty's MCP server โ exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseAqualityDmaintenancemijia-control A production-ready MCP server that enables AI agents (Claude Code, Claude Desktop, Cursor, Hermes, etc.) to directly control Xiaomi/Mijia smart home devices through natural language. What it does Turns conversations into physical actions โ "turn on the desk lamp to 50%" becomes actual device control in real-time.1277MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for controlling Xiaomi/Mi Home smart devices via natural language, supporting device listing, property read/write, action calls, and camera snapshots.12-
- AlicenseNot gradedqualityAmaintenanceAn MCP server that enables natural language creation and management of Xiaomi Mi Home automation rules, integrating with AI coding assistants to query devices and manipulate automation graphs.106MIT
- AlicenseAqualityAmaintenanceAn MCP server that provides read-only snapshots and change detection for Xiaomi smart home devices, enabling AI clients to get structured home status with a single call.14GPL 3.0