mijia-mcp
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., "@mijia-mcpturn on the light bar at 60% brightness, 4000K"
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.
米家控制台 for DeepSeek Harness(dsh-mijia-console)
在 DeepSeek Harness 中直接控制米家设备:MCP 接入 + 执行层设备白名单守卫 + 可视化控制台页面。无需 Home Assistant / Docker / 虚拟机——经 Do1e/mijia-api 直连米家云端。



功能
文字/语音控制:米家 MCP server(stdio)接入 Harness,14 个工具注册为
mcp__mijia__*执行层白名单守卫:仅三台白名单设备可读写(did 精确匹配);禁用场景/音箱/未识别工具;禁止 toggle,强制显式开/关
可视化控制台页面(v1.1.0):侧边栏入口 → 主面板三张设备卡片;再次打开先显示内存缓存,再分设备更新,统计不阻塞开关状态
灯带(小米智能插座 4):开关、实时功率、今日/本月用电、最近 7 天明细(无调光控件——它是插座)
显示器挂灯 2:开关、亮度(1–100%)与色温(2700–6500K)滑块,拖动预览、松手提交
空调伴侣 2:开关、目标温度(16–30℃)、模式/风速/摆风、实时功率、日/月用电;区分接口接收、目标属性回读与当前功率参考
真实数据:全部来自米家云端接口;缺失显示
--;连接徽标来自真实请求结果;凭据只在后端(~/.config/mijia-api/auth.json),路由经宿主连接层鉴权最近操作:区分发送中、已发送、目标属性回读一致、结果待确认和失败;回读一致须实际匹配目标值,空调伴侣回读不代表空调本体已执行。语音/聊天操作经
tools/result观察并使对应设备状态失效轻量按需:默认在页面可见时每轮完成后间隔 10s 刷新,可在设置关闭;状态缓存 10s,用电统计缓存 5 分钟;隐藏/关闭页面取消前端读请求并停止自动查询。已发出的控制不会因离开页面重发或撤销,Host 允许一次有时限的后台回读;MCP 进程随插件启停
Related MCP server: mcp-xiaomi-server
仓库结构
bundles/
mijia-mcp/ # 米家 MCP 连接(stdio)+ 执行层白名单守卫 + 系统提示词规则
mijia-console/ # 可视化控制台页面(Host 路由 + Client 面板)
docs/
HANDOVER.md # 验收交接文档:安装/启停/能力矩阵/实测记录/未验证项
CONSOLE-1.1.0.md # 控制台 v1.1.0 更新说明与验收清单
images/ # 运行截图(v1.1.0 实拍)
tests/ # node --test 单元与 React 渲染测试(26 项)安装
前置:macOS/Linux,uv,DeepSeek Harness 桌面版。
# 1. 独立 Python 环境 + mijiaAPI(含 mcp 依赖)
uv venv ~/.local/share/mijia-api/venv --python 3.12
uv pip install --python ~/.local/share/mijia-api/venv/bin/python "mijiaAPI[mcp]"
# 2. 扫码登录(凭据存于 ~/.config/mijia-api/auth.json,勿外泄)
~/.local/share/mijia-api/venv/bin/mijiaAPI login在 Harness 插件管理中分别安装
bundles/mijia-mcp与bundles/mijia-console两个本地目录。
⚠️
bundles/*/cordis.patch.yml中的设备 did、米家名称与绝对路径是作者自己环境的实际值——安装前请改成你的设备(先在聊天里让助手list_devices拿到你的 did/名称)与本机路径。
更新与验证
v1.1.0 修复重复打开白屏等待、局部超时清空数据、控制后长时间遮罩及 NaN 用电显示。更新与验收步骤见 docs/CONSOLE-1.1.0.md。
开发验证(Node.js 22+,仅开发测试需要 npm 依赖):
npm ci
npm run check
npm test启停
插件管理禁用/启用
include:mijia-api即停止/拉起 MCP 进程(凭据从磁盘恢复,无需重扫;token 失效时用mcp__mijia__login会话内重登)禁用
include:mijia-console仅关闭控制台页面,不影响文字/语音控制
依赖与许可
本仓库代码(两个 bundle):MIT
运行时依赖 mijiaAPI(GPL-3.0,独立 Python 进程经 MCP stdio 调用,本仓库不包含其代码);请遵守其许可与免责条款,仅供学习交流
设备产品图为小米官方产品渲染图,版权归小米;仅作设备识别用途
实测状态
灯带与空调伴侣的开/关闭环均经真实设备验证(功率实证)。控制台 v1.1.0 已经真实环境验收(见上方实拍截图):三张卡片渲染真实数据、页面开关灯带(回读一致,点亮功率 26W)、挂灯开/关(回读一致)、最近 7 天用电明细、操作日志的来源与状态标注(发送中/已发送/回读一致)。其余细节与未验证项(挂灯亮度/色温写、空调模式/温度/风速写、深浅色与窄窗口目检)见 docs/HANDOVER.md。用电统计口径:插座为 kWh(日/月交叉验证一致);空调伴侣原始值按 Wh 解读(官方未确认)。
This server cannot be deployed
Maintenance
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
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.1274MIT
- 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
- AlicenseNot gradedqualityCmaintenanceA productized MCP server for Xiaomi Mi Home (米家) that provides natural-language-oriented device discovery and control across homes, rooms, devices, and scenes, while hiding low-level protocol details like did/siid/piid. It supports QR login, structured tooling for status, brightness, temperature, scenes, and speaker announcements, plus standard MCP resources.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables control of Mijia (Xiaomi) smart home devices through MCP, including querying homes, devices, scenes, and specs, setting properties, running actions and scenes, and issuing speaker commands.GPL 3.0