Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI → MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE ↗ (opens in a new tab)
  • llms.txt ↗ (opens in a new tab)
  • Catalog JSON ↗ (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub ↗ (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. 🏠 Home Automation
  3. Mijia Control
Mijia Control logo
Health: ActiveRecent health check succeeded.Last checked 9/9/2026, 1:33:47 PM

Mijia Control

User RatingsBe the first to rate and review this MCP server!
View Repository64 GitHub StarsTotal stargazers on GitHub for the source repository (64 stars).Visit Website
xiaomimijiahome-automationhomekitenergy-monitoring

MCP server for controlling Xiaomi/Mijia devices with web, REST, CLI, automation, energy monitoring, and HomeKit support.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.

One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.

Manual Client & Custom JSON ConfigExpand JSON ▾
No confirmed setup config for this listing yet. We only publish a config block 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. Follow the project’s own setup instructions for the current steps.
Install Directory Badge Claim listing Alternatives🏠 More in Home Automation

Overview

MijiaPilot connects AI agents and other clients to Xiaomi/Mijia smart home devices through an embedded MCP server. It also provides a Flask web interface, REST API, CLI, SocketIO updates, automation rules, and energy dashboards. Use it when you need centralized control of supported Mijia devices and related home-management features.

Use cases

•Control Xiaomi lights, air conditioners, heaters, robots, cameras, and other supported devices
•Execute Mijia scenes from an AI agent or CLI
•Create scheduled automations using cron, intervals, or sunrise and sunset triggers
•Monitor device energy usage by day or hour
•Bridge supported Mijia devices to Apple Home and Siri

Key features

•Embedded MCP server for AI agent device control
•Flask web dashboard for devices, homes, scenes, automations, and energy data
•REST API with JWT authentication and Swagger documentation
•CLI for login, device listing, attribute reads and writes, and scene execution
•SocketIO device-status updates
•HomeKit bridge and local BLE sensor support

Capabilities & Tool Schemas

Inspect callable tools, capabilities, and parameters exposed to AI agents by Mijia Control.

Extracted Tool Capabilities
Embedded MCP server for AI agent device control
Flask web dashboard for devices, homes, scenes, automations, and energy data
REST API with JWT authentication and Swagger documentation
CLI for login, device listing, attribute reads and writes, and scene execution
SocketIO device-status updates
HomeKit bridge and local BLE sensor support

Documentation Overview

MijiaPilot

中文 | English | 日本語 | 한국어 | Español

MCP Server GitHub license Python Version Flask GitHub stars GitHub issues GitHub last commit

米家 小米生态 × MCP x CLI × AI Agent × HomeKit 全桥接智能家居平台。

Changelog

v1.0.3 (2026-05-14)

  • fix: SQLALCHEMY_DATABASE_URI 增加 SQLite 默认值(sqlite:///mijia.db),未设置 DATABASE_URL 时不再崩溃
  • fix: Werkzeug 3.1+ 安全限制,run.py 添加 allow_unsafe_werkzeug=True 保障开发环境启动

升级注意:如果你之前使用 MySQL,不受影响。SQLite 仅在未配置 DATABASE_URL 时作为 fallback。 若从 MySQL 首次切换到 SQLite(或新建 SQLite 数据库),需要执行 flask db upgrade 创建表, 并通过 Web 界面或 /api/auth/register 注册用户,再绑定小米账号后方可使用设备控制功能。

v1.0.2 (2026-05-13)

  • fix: 修复 Jinja2 search 测试不存在导致的 500 错误

v1.0.1

  • feat: 专属设备控制页模板(灯光、取暖器、空调伴侣、传感器、开关、摄像头)
  • feat: 通用设备控制页使用共享组件和更好的 UI

v1.0.0

  • 初始发布

致谢:本项目底层使用了 Do1e/mijia-api(mijiaAPI v3.0+)提供的 Python SDK, 用于与小米云端进行设备通信、属性读写和场景执行。感谢原作者的开源贡献。

演示

Agent 演示界面

Agent 演示视频

功能特性

  • Web 管理界面 — 设备控制、家庭/场景管理、能耗统计、自动化规则、深色模式、移动端适配
  • RESTful API — JWT 认证,完整的 Swagger 文档(/api/docs/),支持第三方集成
  • CLI 工具 — mijia-control 命令行,支持登录、设备列表、属性读写、场景执行
  • 实时通信 — SocketIO 推送设备状态变更
  • 设备分组/收藏 — 自定义分组管理设备,快速收藏常用设备
  • 定时自动化规则 — 支持 cron、interval、日出/日落等触发方式
  • 能耗统计仪表板 — 按设备记录和展示能耗数据(日/小时粒度)
  • API Token 管理 — 为第三方应用创建和管理访问令牌
  • MCP Server — 内置 MCP 协议支持,Claude Code / Hermes Agent 等 AI Agent 可直接调用
  • HomeKit 桥接 — 通过 Apple 家庭 App 和 Siri 控制米家设备,支持灯光、插座、传感器、温控器等
  • BLE 蓝牙传感器 — PC 蓝牙直连小米 BLE 温湿度计,本地实时数据采集,支持自动化联动
  • 多用户 & 权限 — 用户注册登录、管理员后台、限流保护

技术栈

层级技术
Web 框架Flask 3.0+
ORM & 迁移SQLAlchemy + Flask-Migrate (Alembic)
数据库MySQL (pymysql)
认证Flask-Login (Session) + Flask-JWT-Extended (API)
CSRF 保护Flask-WTF
限流Flask-Limiter
实时通信Flask-SocketIO
API 文档Flasgger (Swagger UI)
序列化/校验Marshmallow
米家 SDKmijiaAPI >= 3.0
MCP 协议MCP Python SDK >= 1.6
HomeKitHAP-Python >= 5.0
BLE 扫描bleak >= 0.22
代码质量Ruff (lint + format)
测试pytest

项目结构

Code
├── app/
│   ├── __init__.py          # Flask 应用工厂
│   ├── extensions.py        # 扩展实例(db, jwt, csrf, socketio...)
│   ├── api/                 # REST API 蓝图 (JWT 认证)
│   ├── web/                 # Web UI 蓝图 (Session + CSRF 认证)
│   ├── services/            # 业务逻辑层
│   ├── models/              # SQLAlchemy 数据模型
│   ├── schemas/             # Marshmallow 序列化/校验
│   ├── utils/               # MijiaAPI 适配器、统一响应、装饰器
│   ├── cli/                 # Click CLI 命令
│   ├── homekit/             # HomeKit Bridge(Apple 家庭桥接)
│   └── ble/                 # BLE 蓝牙传感器守护进程(独立进程)
├── mcp_server/              # MCP Server(AI Agent 工具)
├── config/                  # Flask 配置(development/testing/production)
├── migrations/              # Alembic 数据库迁移脚本
├── tests/                   # pytest 测试
├── run.py                   # 开发服务器入口
├── docs/                    # 详细文档(HomeKit、API 等)
└── pyproject.toml           # 项目配置 & 依赖

快速开始

1. 环境准备

  • Python 3.10+
  • MySQL 5.7+

2. 安装

bash
# 克隆本项目
git clone https://github.com/handsomejustin/mijia-control.git
cd mijia-control

# 创建虚拟环境
python -m venv venv
source venv/bin/activate  # Linux/Mac
# venv\Scripts\activate   # Windows

# 安装依赖(mijiaAPI 会作为依赖自动安装)
pip install -e ".[dev]"

3. 配置

复制 .env.example 为 .env 并填写实际配置:

bash
cp .env.example .env
env
FLASK_APP=app:create_app
FLASK_ENV=development
SECRET_KEY=your-secret-key-here
DATABASE_URL=mysql+pymysql://user:password@127.0.0.1:3306/mijia
JWT_SECRET_KEY=your-jwt-secret-key-here
GO2RTC_URL=http://127.0.0.1:1984

4. 初始化数据库

bash
# 创建 MySQL 数据库
mysql -u root -p -e "CREATE DATABASE mijia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# 执行迁移
flask db upgrade

5. 启动

bash
python run.py

访问 http://127.0.0.1:5000 ,注册账号后即可使用。

API 概览

模块路径前缀说明
认证 (Session)/api/auth/注册、登录、登出、修改密码
认证 (JWT)/api/auth-jwt/JWT 登录、刷新令牌
小米账号绑定/api/xiaomi/二维码绑定、状态查询、解绑
设备管理/api/devices/设备列表、属性读写、动作执行、摄像头流
家庭管理/api/homes/家庭列表、详情
场景执行/api/scenes/场景列表、执行
设备分组/api/groups/分组 CRUD、收藏管理
自动化规则/api/automations/定时规则 CRUD、启用/禁用
能耗统计/api/energy/能耗记录、日/小时/最新查询
BLE 传感器/api/ble/BLE 设备注册、数据上报、历史查询
API Token/api/tokens/令牌管理(第三方集成)

完整 API 文档:启动后访问 /api/docs/。

MCP Server(AI Agent 集成)

内置 MCP Server,支持 Claude Code、Hermes Agent、OpenClaw 等任何兼容 MCP 协议的 AI Agent 直接控制米家设备。

安装

Terminal
pip install -e ".[mcp]"

配置

首先确保 Web 服务已启动(python run.py),然后获取 Token:

bash
# 方式一:CLI 登录(推荐,自动保存 Token)
mijia-control login

# 方式二:API 登录获取
curl -X POST http://127.0.0.1:5000/api/auth/jwt/login \
  -H "Content-Type: application/json" \
  -d '{"username": "你的用户名", "password": "你的密码"}'
# 返回的 access_token 即为 MIJIA_TOKEN

设置环境变量:

server.ts
# Linux / macOS
export MIJIA_API_URL=http://127.0.0.1:5000/api
export MIJIA_TOKEN=eyJhbGci...   # 上一步获取的 access_token

# Windows (PowerShell)
$env:MIJIA_API_URL = "http://127.0.0.1:5000/api"
$env:MIJIA_TOKEN = "eyJhbGci..."

# Windows (CMD)
set MIJIA_API_URL=http://127.0.0.1:5000/api
set MIJIA_TOKEN=eyJhbGci...

Claude Code 中使用

bash
# 注册 MCP 服务器
claude mcp add mijia -- python -m mcp_server

# 之后在对话中直接使用
# "帮我把客厅的灯关掉"
# "查看所有设备的在线状态"
# "执行回家场景"

可用工具

工具功能
list_devices列出所有设备
get_device查看设备详情与规格
get_property读取设备属性
set_property设置设备属性(控制设备)
run_action执行设备动作
list_scenes列出场景
run_scene执行场景
list_homes列出家庭
get_home查看家庭详情
list_ble_devices列出 BLE 传感器设备
get_ble_sensor获取 BLE 传感器最新数据
get_ble_readings查询 BLE 传感器历史读数

HomeKit Bridge(Apple 家庭 & Siri 控制)

通过 HAP-Python 实现 HomeKit 桥接,让 iPhone、Mac 用户在 Apple 家庭 App 和 Siri 中直接控制米家设备。

架构

Code
Apple 家庭 / Siri  →  HomeKit Bridge (HAP-Python)  →  Flask REST API  →  米家设备
                    独立进程,端口 51826                  python run.py

安装

Terminal
pip install -e ".[homekit]"

Windows 用户:需要安装 Bonjour Print Services 或使用 Docker 运行 Bridge。

配置

在 .env 中添加(或直接设置环境变量):

env
HOMEKIT_ENABLED=true
HOMEKIT_PORT=51826
HOMEKIT_PIN=123-45-678

确保 Web 服务已启动并获取 JWT Token(与 MCP Server 相同的 MIJIA_TOKEN)。

启动

bash
# 先启动 Web 服务
python run.py

# 再启动 HomeKit Bridge(另一个终端)
python -m app.homekit

配对

  1. 确保手机和电脑在同一局域网
  2. iPhone → 家庭 App → 添加设备 → 扫描终端显示的 QR 码,或手动输入 PIN
  3. 配对成功后,设备会以「米家智能家居」桥接器的形式出现

iPhone 家庭 App 效果

HomeKit 家庭 App - 设备列表 HomeKit 家庭 App - 设备控制

支持的设备类型

HomeKit 类型米家设备控制能力
Lightbulb灯泡、灯带开关、亮度、色温
Outlet插座、智能开关开关
Switch扫地机、净化器等开关
TemperatureSensor温湿度传感器温度、湿度读取
Thermostat空调伴侣、除湿机开关、目标温度
HeaterCooler取暖器开关、目标温度

设备映射自定义

当你的设备型号不在内置规则中时,Bridge 会自动从设备的 spec_data 推断类型。如果推断不准确,可以创建 homekit_mapping.yaml 自定义映射:

bash
cp homekit_mapping.yaml.example homekit_mapping.yaml
yaml
# homekit_mapping.yaml
devices:
  zhimi.airp.mb4a: switch           # 精确 model 匹配
  lumi.sensor_magnet.aq2: ignored   # 忽略不需要的设备

fallback: auto    # auto=智能推断 | switch=全部当开关 | ignore=忽略未知

可用类别:light、outlet、switch、temperature_sensor、thermostat、heater、camera、ignored

BLE 蓝牙传感器(本地蓝牙数据采集)

通过 PC 蓝牙直连小米 BLE 温湿度计等传感器,无需额外蓝牙网关硬件。支持数据展示、历史查询和自动化联动。

架构

Code
BLE 温度计  ─BLE 广播→  BLE Scanner (独立进程)  ─HTTP POST→  Flask API  →  DB
                         python -m app.ble                        python run.py

安装

Terminal
pip install -e ".[ble]"

需要 PC 具备蓝牙功能(Windows 10/11 内置支持,无需额外驱动)。

配置

在 .env 中添加:

env
BLE_ENABLED=true

确保已设置 MIJIA_TOKEN(与 MCP Server / HomeKit Bridge 相同)。

使用步骤

bash
# 1. 扫描附近 BLE 设备,发现 MAC 地址
mijia-control ble scan

# 2. 注册 BLE 设备(自动从云端获取解密密钥)
mijia-control ble register --did "blt.3.xxxxx" --mac "A4:C1:38:XX:XX:XX"

# 3. 启动 BLE 守护进程(需要先启动 Web 服务)
python run.py           # 终端 1
python -m app.ble       # 终端 2

# 4. 查看数据
mijia-control ble list
mijia-control ble readings "blt.3.xxxxx" --hours 24

支持的设备

设备型号数据
米家温湿度传感器迷你LYWSD03MMC温度、湿度、电量
米家温湿度传感器(圆形)LYWSDCGQ温度、湿度、电量
米家温湿度传感器(新品)MJWSD05MMC温度、湿度、电量

自动化联动

BLE 传感器数据可触发自动化规则,例如温度 > 30°C 自动开空调:

Read the full README →View source on GitHub →

Related MCP Servers

View all in Home Automation View all alternatives
  • CI Control Bridge logoCI Control Bridge

    Control monitor brightness, contrast, power and input via DDC/CI with MCP and MQTT support.

    🏠 Home Automation2 views
    Compare vs CI Control Bridge →
  • Nickol Knx MCP logoNickol Knx MCP

    Design-time KNX/ETS6 assistant: parses .knxproj (read-only, no bus access), validates DPT/naming/command-status pairing, and generates Home Assistant YAML + ETS XML/CSV exports.

    🏠 Home Automation3 views
    Compare vs Nickol Knx MCP →
  • Ac Infinity MCP logoAc Infinity MCP

    Monitor and automate AC Infinity grow controllers through natural conversation with Claude. 25 tools covering live sensor data, multi-day history, VPD/temperature/humidity automations, port control, advance scheduling, and grow stage templates.

    🏠 Home Automation2 views
    Compare vs Ac Infinity MCP →
  • Debmatic MCP logoDebmatic MCP

    Control a HomeMatic / debmatic CCU (eq-3 home automation) over its JSON-RPC and HM-Script APIs — switch and dim actuators, read sensors, system variables and service messages, run programs, and manage rooms, functions, channel links and device assignments. 25 tools over HTTP or stdio; runs locally against your own CCU.

    🏠 Home Automation1 views
    Compare vs Debmatic MCP →

Adoption & maintenance

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

GitHub stars
64
Stargazers on the source repository.
Last commit
3mo ago
Most recent push to the default branch.
Directory activity
2 views
Config copies, upvotes, and views on AllMCPs.

Reviews

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

Frequently Asked Questions about Mijia Control

The project describes support for Xiaomi/Mijia lights, air conditioners, heaters, robots, cameras, sensors, switches, and other supported devices.

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>

Technical Specs & Signals

Category🏠Home Automation
PricingFree
More technical detailsExpand ▾
AuthAPI key
Last updatedAug 10, 2026
Views2
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars64
GitHub Star CountTotal stargazers on GitHub representing community popularity (64 stars).
Last commit3mo ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on May 23, 2026
44Quality signal: Fair · 44/100How this signal is calculated ▾
Server availabilityNot measured

Not scored for repo-hosted servers — we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools19/30
Adoption & activity4/15
Community engagement0/10

A guidance signal from public completeness & health data — not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

★ FeaturedMoxie Docs MCP logo

Moxie Docs MCP

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

Explore Server →

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge — proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it — no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in 🏠 Home Automation →Alternatives to Mijia Control →Install in Claude DesktopInstall in CursorInstall in VS Code