Skip to main content
Glama
jiayunlimailutorontoca

mijia-home-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MIJIA_HOME_MCP_AUTHNoAuthentication file path (default ~/.config/mijia-api/auth.json)
MIJIA_HOME_MCP_DENYNoComma-separated list of denied device patterns
MIJIA_HOME_MCP_ALLOWNoComma-separated list of allowed device patterns
MIJIA_HOME_MCP_STATE_DIRNoState directory for snapshots and audit logs (default ~/.config/mijia-home-mcp)
MIJIA_HOME_MCP_ENABLE_CONTROLNoEnable control mode (set to '1' or 'true' to enable)
MIJIA_HOME_MCP_ALLOW_DANGEROUSNoAllow dangerous devices (set to '1' or 'true')

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_home_snapshotA

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

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

get_home_changesA

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

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

query_historyA

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

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

list_homesA

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

list_devicesA

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

get_device_statusA

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

get_device_specA

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

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

list_scenesA

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

list_consumablesA

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

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

get_battery_reportA

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

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

get_device_statisticsA

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

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

auth_statusA

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

loginA

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

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

login_statusA

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

Prompts

Interactive templates invoked by user choice

NameDescription
home_briefing生成一份全屋晨报/晚报:状态总览 + 异常提醒 + 变化摘要。

Resources

Contextual data attached and managed by the client

NameDescription
resource_devices设备清单:名称/did/model/在线状态/家庭/房间。几乎不变,读取便宜。
resource_snapshot全屋实时状态快照(compact)。读取会拉小米云端,约几秒,30s 内重复读走缓存。
resource_homes家庭与房间结构。

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