Skip to main content
Glama
jiayunlimailutorontoca

mijia-home-mcp

mijia-home-mcp

中文 | English

米家 MCP server。get_home_snapshot 一次调用批量拉全屋设备状态(65 台约 9s),按家/房间分组,枚举值转成可读文本。默认只读,控制工具要显式开启,锁和摄像头另有一层拦截。

基于 Do1e/mijia-api,共用其登录凭证(~/.config/mijia-api/auth.json,扫码一次约一个月)。

安装

先登录(终端出二维码,米家 App 扫):

uvx --from git+https://github.com/jiayunlimailutorontoca/mijia-home-mcp mijia-home-mcp login

加到 Claude Code:

claude mcp add mijia-home -- uvx --from git+https://github.com/jiayunlimailutorontoca/mijia-home-mcp mijia-home-mcp serve

问一句"家里现在什么情况"就能用了。

帮我安装 mijia-home 米家 MCP:
1. uvx --from git+https://github.com/jiayunlimailutorontoca/mijia-home-mcp mijia-home-mcp login
   二维码给我扫;已有有效的 ~/.config/mijia-api/auth.json 就跳过。这步需要我,停下来等。
2. claude mcp add mijia-home -- uvx --from git+https://github.com/jiayunlimailutorontoca/mijia-home-mcp mijia-home-mcp serve
3. 我有多个家庭的话先问我锁哪个,命令加 --env MIJIA_HOME_MCP_HOME_NAME=家庭名
4. 调 get_home_snapshot,报在线设备数
帮我安装 mijia-home 米家 MCP:
1. 登录同上,二维码给我扫
2. openclaw mcp add mijia-home --command uvx --arg "--from" --arg "git+https://github.com/jiayunlimailutorontoca/mijia-home-mcp" --arg "mijia-home-mcp" --arg "serve"
3. openclaw mcp probe mijia-home 应显示 14+ tools;会话里看不到就 npm i -g mcporter
4. 调 get_home_snapshot 验证

多家庭账号建议锁定默认家庭,否则每次全家庭拉取:

"env": { "MIJIA_HOME_MCP_HOME_NAME": "我的家" }

Related MCP server: xiaomi-device-control

通知

配置通道后多一个 send_notification 工具,一次推所有已配置的通道;不配则该工具不出现。

"env": {
  "MIJIA_HOME_MCP_SPEAKER": "auto",
  "MIJIA_HOME_MCP_MEOW": "MeoW昵称",
  "MIJIA_HOME_MCP_BARK": "Bark设备key",
  "MIJIA_HOME_MCP_NTFY": "ntfy主题",
  "MIJIA_HOME_MCP_FEISHU": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx",
  "MIJIA_HOME_MCP_DINGTALK": "https://oapi.dingtalk.com/robot/send?access_token=xxx"
}

各通道申请方式:

  • 钉钉:群设置 → 机器人 → 自定义。安全设置选关键词填米家,或加签(密钥配 _DINGTALK_SECRET)。仅内部群,限流 20 条/分

  • 飞书:群设置 → 群机器人 → 自定义机器人。签名密钥配 _FEISHU_SECRET

  • MeoW(鸿蒙):装 app 注册昵称,昵称即配置

  • Bark(iOS):app 里复制 device key;自建填 https://host/key

  • ntfy(安卓):订阅一个 topic,topic 即配置。公开 topic 谁都能订,名字取随机

控制

默认只读。开启:

mijia-home-mcp serve --enable-control --allow "客厅*" --deny "*camera*"

规则:

  • 锁/摄像头/燃气水阀/保险柜不吃通配符,必须 --allow 精确写设备名或 did,或 --allow-dangerous

  • run_speaker_command(小爱执行语音指令)能触达全屋设备,按危险设备同等门控;经 run_device_actionexecute-text-directive 走同一道闸,绕不过去。纯播报用 speaker_announce,普通门控

  • run_scene 不看白名单——场景内容是你在米家 App 定义的,不想让 AI 碰的别做成手动场景

  • 所有写操作(含被拒的)记 ~/.config/mijia-home-mcp/audit.log

工具

读:get_home_snapshot(home/room 过滤,30s 缓存)、get_home_changes(diff)、query_history(本地 30 天事件史)、get_battery_reportget_device_statisticslist_homes/list_devices/get_device_status/get_device_spec/list_scenes/list_consumablesauth_status/login/login_statussend_notification

控制:turn_on/turn_off(自动匹配开关属性)、set_device_propertyrun_device_actionrun_scenespeaker_announcerun_speaker_command

resources:mijia://devicesmijia://homesmijia://snapshot

耗材:list_consumables 返回云端算好的三态(充足/不足/耗尽),该换的进 needs_attention,同时出现在快照的 attention 里。

命令行

不接 MCP 也能用:

mijia-home-mcp doctor       # 自检 + 更新检查
mijia-home-mcp snapshot     # --home --room --full --json
mijia-home-mcp devices
mijia-home-mcp battery
mijia-home-mcp say "吃饭了"
mijia-home-mcp watch --speak --only "门锁*" --ignore left-time

watch 轮询变化,推送到已配置的通道,每小时查一次耗材,事件写本地历史。--ignore left-time 建议加上,洗碗机倒计时一分钟变一次。

局域网

mijia-home-mcp serve --transport http --host 0.0.0.0 --port 8423 --http-token 随机串
claude mcp add --transport http mijia-home http://<host>:8423/mcp --header "Authorization: Bearer 随机串"

不设 token 无鉴权,启动会警告。别暴露公网。token 建议走环境变量 MIJIA_HOME_MCP_HTTP_TOKEN,命令行参数在进程列表可见。

环境变量

变量

说明

MIJIA_HOME_MCP_AUTH

认证文件,默认 ~/.config/mijia-api/auth.json

MIJIA_HOME_MCP_HOME_NAME

默认家庭

MIJIA_HOME_MCP_ENABLE_CONTROL

1 开控制

MIJIA_HOME_MCP_ALLOW / _DENY

白/黑名单,逗号分隔

MIJIA_HOME_MCP_ALLOW_DANGEROUS

放行危险设备

MIJIA_HOME_MCP_STATE_DIR

状态目录,默认 ~/.config/mijia-home-mcp

MIJIA_HOME_MCP_SPEAKER / _MEOW / _BARK / _NTFY / _FEISHU(_SECRET) / _DINGTALK(_SECRET) / _WEBHOOK

通知通道

MIJIA_HOME_MCP_HTTP_TOKEN

http Bearer token

已知问题

  • 走小米云端(上游为逆向接口),秒级延迟,无推送,轮询别太密

  • 凭证约一个月过期,login 重扫

  • 红外类设备(空调伴侣的"空调")spec 页缺中文数据,解析失败会进 attention.spec_errors,不影响其他设备

  • readOnlyHint 注解只是提示,真正的门在服务端

开发

uv venv && uv pip install -e ".[dev]"
uv run pytest

测试离线,不需要米家账号。

License

GPL-3.0-or-later。上游 mijia-api 为 GPL-3.0 且声明仅供学习交流,本项目相同。

Available Tools

14 tools
auth_statusA
Read-only

查看当前米家登录状态与认证文件路径,排查认证问题时先调这个。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true. Description adds value by specifying it returns auth file path, which is additional behavioral context. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence in Chinese packs purpose and usage guidance efficiently. No wasted words, front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With annotations and output schema present, description covers the essential: what it does and when to use it. Could be improved by clarifying distinction from login_status.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters in schema (schema coverage 100%). Description does not need to add parameter info. Baseline score of 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states it views login status and authentication file path. It provides a specific usage hint for troubleshooting. However, it does not explicitly differentiate from sibling tool 'login_status', which may have overlapping purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to call this first when troubleshooting authentication issues ('排查认证问题时先调这个'). Provides clear context for use, but does not mention when not to use or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_battery_reportA
Read-only

全屋电量普查:批量读取所有带电池的设备,按电量升序返回。

回答"哪些设备该换电池了"用这个,比逐设备查询快得多。 low 字段列出电量 ≤20% 的设备。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo可选,家庭名称或ID;不传用服务端默认家庭。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint. The description adds that results are sorted ascending and includes a 'low' field for ≤20% battery, providing useful behavioral context beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: first defines action and output order, second gives use case and efficiency, third describes the 'low' field. No wasted words, good front-loading.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With high schema coverage and an output schema, the description is complete. It adds the 'low' field and sorting detail, which are not in the input schema. The tool is simple, so no gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter 'home', which is well-described in the schema. The tool description does not add any new parameter information, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it reads all battery devices and returns them sorted by battery level. It uniquely addresses the question 'which devices need battery replacement', distinguishing it from sibling tools like get_device_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case (answering battery replacement) and highlights efficiency over querying one by one. It does not explicitly state when not to use, but the context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_device_specA
Read-only

获取设备规格:支持的属性(类型/读写/范围/枚举值)与动作列表。

用于确定 get_device_status / set_device_property / run_device_action 可用的属性名与动作名。

ParametersJSON Schema
NameRequiredDescriptionDefault
device_or_modelYes设备名称、did 或设备型号(如 yeelink.light.lamp4)。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds significant detail beyond annotations: it discloses the type of information returned (property types, read/write, ranges, enum values, and action list). No contradiction with readOnlyHint or openWorldHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, front-loaded with core purpose, no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description adequately covers the tool's purpose, usage context, and the nature of returned data. No missing context for this type of tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description covers 100% of the single parameter, so baseline is 3. The description does not add additional semantic information beyond what the schema already provides for the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states what the tool does: retrieving device specifications including supported properties and actions. It distinguishes itself from sibling tools like get_device_status and set_device_property by stating it provides the available property names and action names needed for those tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explicitly mentions using it before get_device_status, set_device_property, and run_device_action, providing clear context. However, it does not specify when not to use it or list alternatives beyond these sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_device_statisticsA
Read-only

获取设备历史统计数据(如插座耗电量、净化器使用时长)。

并非所有设备都支持统计;键 siid_piid 需从设备说明或 https://home.miot-spec.com 查询(常见如插座功耗为 "7.1")。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo返回最近多少条,默认7。
deviceYes设备名称或 did。
siid_piidYes统计键,格式 "siid.piid",如 "7.1"。
granularityNo统计粒度 hour/day/week/month。day

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint. The description adds behavioral context by stating that device support varies and that the key must be looked up externally, which is valuable beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with purpose, and contains no extraneous information. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists and parameters are well-documented, the description covers the essential context: device compatibility, key lookup, and typical use cases. It is complete for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, baseline is 3. The description adds meaning by explaining the siid_piid parameter's format and how to determine it, including an example. This helps agents understand the dynamic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it retrieves historical statistics for devices, with examples like socket power consumption and purifier usage time. It clearly distinguishes from sibling tools like get_device_status and get_device_spec.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description notes that not all devices support statistics and provides instructions on how to find the correct siid_piid key via device spec or an external link. This gives clear usage context, though alternatives among siblings are not mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_device_statusA
Read-only

读取单个设备的详细状态(批量拉取,含原始值与语义化文本)。

ParametersJSON Schema
NameRequiredDescriptionDefault
propsNo可选,只读取这些属性名(可从 get_device_spec 获得);不传则读取全部可读属性(至多32个)。
deviceYes设备名称或 did;名称支持唯一子串匹配。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint. The description adds valuable context: batch pull, includes raw values and semantic text, and is for a single device. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that conveys core behavior. Could benefit from slightly more structure, but it is concise and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description doesn't need to explain return values. It covers key aspects (single device, raw/semantic, batch pull). Missing details like substring matching for 'device' parameter, but schema covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are well-documented. The description adds no extra meaning beyond what the schema provides, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it reads detailed status of a single device, including raw values and semantic text. It distinguishes from sibling tools like 'list_devices' (list all) and 'get_device_statistics' (statistics).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for a single device but does not explicitly state when to use this vs alternatives like 'get_device_spec' or provide when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_home_changesA
Read-only

回答"上次以来家里变了什么":与上一次快照对比,返回变化列表。

变化类型: prop_changed(属性值变化)/ went_offline / came_online / device_added / device_removed。调用后会把本次快照存为新基线 (基线只由本工具读写,get_home_snapshot 不影响它)。 首次调用时没有基线,会先建立基线并说明。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo可选,家庭名称或ID,须与上次快照的口径一致;不传用服务端默认家庭。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description states that calling the tool stores a new baseline, indicating a side effect. This contradicts the readOnlyHint=true annotation which claims no modification. Annotation contradiction detected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise and front-loaded, listing change types and explaining baseline behavior without wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Description covers purpose, change types, side effect, and first-call behavior. With an output schema present, it does not need to detail return format further. Minor omission of auth requirements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage for its single optional parameter, and the description adds no additional meaning beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool compares current home state with a saved snapshot and returns a list of changes, enumerating change types. It distinguishes from sibling get_home_snapshot by noting the baseline behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for detecting home changes since last call and explicitly contrasts with get_home_snapshot, but lacks explicit when-not-to-use instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_home_snapshotA
Read-only

一次调用获取全屋设备状态快照(推荐入口)。

返回 家→房间→设备→语义化状态 的结构化结果,并附 attention (离线/低电量/故障设备)与统计信息。批量拉取,整屋通常几秒内完成。 本工具不影响 get_home_changes 的对比基线。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo可选,家庭名称或ID;不传用服务端配置的默认家庭,均未配置则包含所有家庭。
roomNo可选,房间名;只关心单个房间时用,更快更省 token。
detailNocompact 返回语义化精简状态;full 附带原始值/属性描述/更新时间/did。compact
max_props_per_deviceNo每台设备最多读取的属性数,默认8(full 模式自动放宽到24)。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and openWorldHint. The description adds useful behavioral details: the structured output (home→room→device→semantic state), inclusion of attention and statistics, and batch performance within seconds. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with purpose, no wasted words. Each sentence adds value: purpose, output overview with performance, and clarification of side effects.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description adequately covers purpose, structure, performance, and safety. It does not need to detail return values. Minor omission: no mention of potential load, but 'batch pull completes in seconds' mitigates this.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with good descriptions. The description adds minimal parameter-specific meaning beyond the schema, but it does reinforce the use of 'detail' for semantic vs. raw data. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '获取' (get) and resource '全屋设备状态快照' (full house device status snapshot), distinguishing it from siblings by positioning it as the recommended entry and noting it doesn't affect the get_home_changes baseline.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It recommends this as the primary entry point and advises using the 'room' parameter for single-room efficiency. However, it does not explicitly list alternatives or conditions for not using this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_consumablesA
Read-only

耗材状态(滤芯/拖布/刷头/电池等),回答"哪些耗材该换了"。

status 是米家云端算好的三态:充足/不足/耗尽。needs_attention 里是不足和耗尽的,items 按紧急程度排序。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo可选,家庭名称或ID;不传用服务端默认家庭,均未配置则列所有。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds details about the status calculation (three states from MiCloud), the needs_attention field, and sorting by urgency. This provides useful behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: the first states the tool's purpose, the second provides key details about the output. It is front-loaded and concise with no unnecessary text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple input schema (one optional parameter), annotations, and presence of an output schema, the description adequately explains what the tool returns. It could mention aggregation behavior but is generally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage for the single parameter 'home' is 100% with a description. The tool description does not add additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns consumable status (filter, mop, brush, battery, etc.) and can answer which consumables need replacement. It distinguishes itself from sibling tools like get_battery_report or get_device_status by focusing on consumable items.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the output structure (three states, needs_attention, urgency sorting) but does not explicitly state when not to use this tool or mention alternatives. The context is clear for determining its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_devicesA
Read-only

列出设备(名称/did/model/在线状态/所属家庭房间),支持过滤。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo按家庭名称或ID过滤;不传用服务端默认家庭。
roomNo按房间名过滤(精确匹配)。
online_onlyNo只看在线设备。
name_containsNo设备名包含该子串(不区分大小写)。

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and openWorldHint=true, indicating safe, read-only access. The description adds the specific fields returned and filtering capability. However, it does not disclose any additional behavioral traits such as pagination, rate limits, or authorization requirements. Given the annotations cover the safety profile, the description provides adequate but minimal added context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that immediately states the purpose, lists key return fields, and mentions filtering. Every part is essential, with no wasted words. It is highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the description covers the essential aspects: it lists devices with key fields and supports filtering. The presence of an output schema reduces the need to describe return values. However, it lacks details on default ordering, pagination, or maximum results. Still, it is mostly complete for a straightforward listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so each parameter already has a clear description in the schema. The tool description does not add any new semantic information beyond the schema. It mentions '支持过滤' but this is already evident from the parameters. Therefore, baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states '列出设备' (list devices) and specifies the fields returned: name, did, model, online status, home room. It also mentions filtering support. This effectively communicates the tool's purpose and distinguishes it from siblings like get_device_spec or get_device_status which target specific devices.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs siblings. The description implies it is for general device listing with filters, but does not clarify scenarios where other tools (e.g., get_device_statistics) would be more appropriate. The context from sibling names offers implicit differentiation, but explicit guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_homesA
Read-only

列出所有家庭及其房间(名称与设备数),用于确定 home 参数取值。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint, so the description's mention of 'list' is consistent. However, the description adds minimal behavioral information beyond the annotations, only stating the output content without discussing side effects or data variability.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that clearly conveys the tool's action and purpose. No unnecessary words, and the key information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and the presence of an output schema, the description adequately covers the tool's purpose and return content. It does not mention pagination or ordering, but for a simple list tool, this is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters (100% coverage), so the description carries no burden for parameter documentation. It adds value by explaining the output content and purpose, which aids the agent in understanding what the tool returns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all homes and their rooms with names and device counts, and explicitly states its use case: to determine the home parameter value. This distinguishes it from sibling tools like get_home_snapshot or get_home_changes, which focus on specific homes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining home parameter values, but it does not provide explicit guidance on when to avoid this tool or mention alternatives. Sibling tools exist for related tasks, but no exclusions or comparative context are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_scenesA
Read-only

列出米家手动场景(名称/scene_id/所属家庭)。

ParametersJSON Schema
NameRequiredDescriptionDefault
homeNo可选,家庭名称或ID;不传用服务端默认家庭,均未配置则列所有。

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds that it lists 'manual scenes', which is a specific subtype, but does not disclose additional behavioral traits beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no waste, but it is very brief. It could be slightly more structured, but it is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has a simple parameter set, read-only annotations, and an output schema that describes return values, the description is complete for an agent to understand the tool's purpose and behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'home'. The tool description does not add extra meaning beyond what the schema already explains about the parameter's optionality and default behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists Mi Home manual scenes and provides the returned fields (name, scene_id, home). This distinguishes it from sibling tools like list_devices or list_homes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives, but the resource type (scenes) implies its context among siblings. No when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

loginA

发起米家扫码登录(凭证过期时使用)。

先尝试静默刷新 token;不行则返回二维码图片链接,用米家APP在2分钟内 扫码,然后调用 login_status 查询结果。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description bears full burden. It reveals key behaviors: tries silent refresh first, returns QR code link with 2-minute validity, and requires subsequent login_status call. However, it does not mention potential side effects or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded purpose, no extraneous words. Highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Provides sufficient context for a login initiation tool: explains the flow, timing constraints, and subsequent step. Output schema exists, so return value details are covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist (schema coverage 100%), so baseline of 4 applies. Description adds no parameter info, but none is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool initiates Mi Home QR code login when credentials expire. It includes the verb 'login' and resource 'Mi Home', but does not explicitly differentiate from sibling tools like auth_status or login_status, though the context is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('when credentials expire'), describes the two-step flow (try silent refresh, then QR code), and instructs to call login_status afterward. This provides excellent guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

login_statusA
Read-only

查询 login 发起的扫码登录进度(pending/success/error)。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, indicating a safe read operation. The description adds valuable behavioral context by specifying the three possible states returned, enhancing transparency beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that includes the key subject ('login progress') and the possible values. It is front-loaded but could potentially be structured with a clearer format (e.g., listing states separately).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and an output schema exists (so return values need not be explained), the description is largely complete. However, it slightly lacks context about prerequisites (e.g., requiring a prior login initiation).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters are defined in the input schema, so per the guidelines the baseline is 4. The description does not need to add parameter meaning as there are none.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool queries 'scan login progress' initiated by login, listing three possible states (pending/success/error). This distinguishes it from sibling tools like 'login' (initiates login) and 'auth_status' (likely a different auth check).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies it should be used after login is initiated, but it does not explicitly state when to use or when not to use this tool versus alternatives such as 'auth_status' or 'login'. No explicit exclusions or alternative recommendations are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_historyA
Read-only

查询本地事件历史,回答"今天门开过几次""洗衣机几点跑完"这类问题。

事件在 mijia-home-mcp watch 运行期间、以及每次 get_home_changes 调用时记录,保留 30 天;记录之外的时段没有数据。

ParametersJSON Schema
NameRequiredDescriptionDefault
propNo属性名过滤,支持 glob(如 "door-state")。
limitNo最多返回条数,默认 100,上限 500。
sinceNo起始时间(ISO 格式,如 2026-07-12T14:00);默认 24 小时前。
untilNo截止时间;默认现在。
deviceNo设备名过滤,支持 glob(如 "门锁*")。
event_typeNo事件类型过滤。

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint and openWorldHint. The description adds valuable behavioral details: events are recorded only during specific operations and retained for 30 days, which goes beyond the annotations. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and efficient: two sentences that capture purpose, usage, and data availability. It is front-loaded with the main verb and resource, then provides essential context. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists, the description does not need to detail return values. It sufficiently covers behavior (data source, retention) and usage context (event types). For a query tool, this is comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description does not add significant new meaning about individual parameters beyond what the schema provides, but the overall context (e.g., event recording conditions) indirectly informs parameter use.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Query local event history' and provides concrete example questions ('Did the door open today?', 'When did the washing machine finish?'), making the tool's purpose immediately understandable. It differentiates from siblings like get_device_status by focusing on historical events.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when data is available (during 'mijia-home-mcp watch' runtime and get_home_changes calls) and retention (30 days), guiding appropriate use. It does not explicitly state when not to use, but the context is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a distinct aspect of the Mi Home ecosystem: authentication, device listing, status retrieval, battery check, consumables, scenes, history, changes, and specs. No two tools have overlapping purposes.

Naming Consistency4/5

Most tools follow a verb_noun pattern (get_, list_, query_), but 'auth_status' and 'login_status' are noun_verb, which is a minor inconsistency. Overall, the pattern is readable and predictable.

Tool Count5/5

With 14 tools, the set is well-scoped for a home automation server. Each tool serves a clear purpose, covering authentication, device information, battery, consumables, scenes, history, and changes.

Completeness2/5

The tool surface is missing write operations (e.g., set_device_property, run_device_action), which are referenced in get_device_spec but not implemented. This is a significant gap for a home automation server, as agents cannot control devices.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    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.
  • F
    license
    Not graded
    quality
    C
    maintenance
    MCP server for controlling Xiaomi/Mi Home smart devices via natural language, supporting device listing, property read/write, action calls, and camera snapshots.
    11
  • A
    license
    Not graded
    quality
    D
    maintenance
    A powerful MCP server that enables AI assistants to discover, commission, and control Matter-compatible smart home devices through a standardized interface.
    21
    8
    MIT
  • A
    license
    Not graded
    quality
    A
    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.
    77
    MIT

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/jiayunlimailutorontoca/mijia-home-mcp'

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