Skip to main content
Glama

Hermejia

License: MIT Python 3.10+ MCP

๐ŸŒ 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 smart home MCP server

๐Ÿš€ 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 it

After 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.py

The 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.py

Tokens 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: 30

Kimi 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_homes

List all Mi Home homes

list_devices

List devices (optionally filtered by home)

list_device_capabilities

Show supported properties and actions

get_device_properties

Get all property values

get_device_property

Get a single property value

set_device_property

Set a property value

run_device_action

Run a device action

control_device

High-level control: on, off, toggle, property=value

list_scenes

List automations/scenes

run_scene

Run a scene by ID

๐Ÿงช Testing

source venv/bin/activate
python test_mijia.py

For 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 scripts/auto_qr.py, which refreshes the QR code automatically

ModuleNotFoundError: mijiaAPI

Make sure the MCP command points to venv/bin/python, not system Python

Agent does not see tools

Restart the agent process; MCP tools are loaded at startup

Token expired

Re-run scripts/auth_login.py

๐Ÿ“„ License

MIT โ€” Copyright (c) 2026 scsagentclub.
Core MCP server files are derived from oujiafan/mcp-mijia, also under MIT.

๐Ÿ™ Acknowledgments

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    An MCP server based on the Mastra framework for controlling Xiaomi Mi Home smart devices. It enables device discovery, property management, action execution, and scene control through the Mi Home cloud service.
    Last updated
  • A
    license
    A
    quality
    B
    maintenance
    mijia-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.
    Last updated
    12
    52
    MIT
  • F
    license
    -
    quality
    F
    maintenance
    MCP server for controlling Xiaomi/Mi Home smart devices via natural language, supporting device listing, property read/write, action calls, and camera snapshots.
    Last updated
    9
  • A
    license
    -
    quality
    C
    maintenance
    An 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.
    Last updated
    70
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโ€ฆ

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HuishanLi1997/Hermejia'

If you have feedback or need assistance with the MCP directory API, please join our Discord server