Bragproof

← Reports

oh-my-sage-mcp

Starts with no setup0.1.4npm

Installed, started with no arguments, no environment and no input, and listed its tools. Run 2026-11-16.

Needs to start: nothing
Returns a result when called with no setup: 1 of 5 tools tried
Contacts while installing and starting: nothing

32tools listed
0hosts contacted
0files written
0.2 sto start
104dependencies

What it contacted

Nothing besides the npm registry it was installed from. Watched from outside its sandbox while it was installed and started with no input. Its tools may still contact things when called.

Starting it

npx -y oh-my-sage-mcp@0.1.4

Installing a package runs its code. Use a sandbox for anything you have not read.

Calling its tools

5 tools that take no input and look read-only were called once with nothing. 1 returned a result.

mijia_statusReturned a result under 0.1 s · 19 characters
mijia_get_devicesNo usable answer tool reported an error: Error: 网关未连接。请先调用 mijia_auth 进行认证。(get_devices)
mijia_find_device_usageNo usable answer tool reported an error: Error: 网关未连接。请先调用 mijia_auth 进行认证。(find_device_usage)
mijia_get_graphsNo usable answer tool reported an error: Error: 网关未连接。请先调用 mijia_auth 进行认证。(get_graphs)
mijia_get_logNo usable answer tool reported an error: Error: 网关未连接。请先调用 mijia_auth 进行认证。(get_log)

During the calls it contacted nothing it had not already contacted.

Only tools whose names read like looking something up, with no required input, are tried, five at most. Tools that need input, and anything that sounds like it changes or sends something, are not called.

What its tools tell an agent

In the tool descriptions, nothing that talks about the user, other tools or private files, or uses hidden characters.

Found by simple pattern rules in each tool's description (up to 3,000 characters), quoted as written. Parameter descriptions are not scanned. A clean result is not a safety review.

Tools

mijia_auth passcode, gateway_url, reconnect
连接米家网关并建立认证 Session。

此工具必须在调用其他任何工具之前调用,用于建立与米家网关的安全连接。
建议先调用 mijia_status:若已连接(例如 HTTP 模式下其他会话已登录),可直接使用,无需登录码。

注意:登录码是一次性的:一个登录码只能用于一次认证尝试(成功或失败后即作废)。
每次连接都必须向用户索取一个【新的】登录码,不可复用旧码。

已连接时如需更换网关或重新登录,传 reconnect=true,不要先调用 mijia_disconnect:
新连接认证成功后才会替换现有连接;失败时现有连接保持可用,不影响其他客户端。

Args:
  - passcode (string): 6位数字登录码,从网关设备上获取
  - gateway_url (string, optional): 网关地址。未提供时使用 MCP 配置的 GATEWAY_URL 环境变量;两者都没有时会返回错误,请提供地址
  - reconnect (boolean, optional): 已连接时仍重新登录(更换网关或刷新登录),默认 false

Returns:
  - success: boolean - 连接是否成功
  - message: string - 连接状态信息

Error Handling:
  - "登录码格式错误" - passcode 不是6位数字
  - "未配置网关地址" - 未提供 gateway_url 且未设置 GATEWAY_URL,请提供网关地址
  - "网关已连接且可直接使用" - 已有连接(可能来自其他会话),直接调用其他工具即可
  - "网关连接失败" - 无法连接到网关地址
  - "登录码已被使用或无效" - 登录码一次性,需重新获取新登录码
mijia_disconnect
断开与米家网关的连接。

仅在用户明确要求断开时调用;完成任务后不要调用。
HTTP 常驻模式下所有客户端共享这一个连接,断开会让所有客户端同时失去连接,且需要用户提供新的登录码才能重新连接。
更换网关或重新登录请用 mijia_auth 的 reconnect=true,不需要先断开。
mijia_status verify
检查与米家网关的连接状态。

已连接时可直接调用其他工具,无需 mijia_auth;未连接时需向用户索取新的登录码后调用 mijia_auth。

Args:
  - verify (boolean, optional): 向网关实际发一次轻量只读请求,确认连接确实可用(不消耗登录码、不重新登录),默认 false

Returns:
  - connected: boolean - 本地记录的连接状态
  - responsive: boolean - 仅 verify=true 时返回,网关是否实际响应
  - latencyMs: number - 仅 verify=true 时返回,请求耗时
  - error: string - 仅 verify=true 且未响应时返回
mijia_get_devices response_format
获取已连接网关下的所有设备列表。

Returns(紧凑):
  - markdown: 每台设备一行「名称 (did) | 房间 | 型号 | [在线]/[离线]」
  - json: {count, devices:[{did,name,modelName,online,roomName}]}

Error Handling:
  - "网关未连接" - 请先调用 mijia_auth
mijia_get_device dids, detail, siids, response_format
获取指定设备的详细信息,包括 MIOT Spec 能力定义。

默认 detail="summary":每个属性只出现一次 {siid,piid,desc,dtype,access(r=读 w=写 n=订阅),unit?,range?,values?[{v,d}]},枚举最多 30 项(超出见 valuesTruncated),另含 events{siid,eiid,desc,args:[piid]} 与 actions{siid,aiid,desc,in:[piid]}。
detail="full" 返回原始完整对象(含 triggers/actions/readable,体积大)。siids 可只看指定服务。
返回每个设备完整 urn:构造规则节点时必须原样复制到 cfg.urn,不要从型号字符串推导版本号。排查设备映射时优先使用本工具,无需先读取日志。

Args:
  - dids (string[]): 设备ID数组,支持批量查询
  - detail ("summary"|"full", optional): 默认 summary
  - siids (number[], optional): 只返回这些服务的能力
  - response_format (string, optional): 默认 "markdown"(每个属性一行),json 为紧凑 JSON

Returns:
  - devices, count, notFound: 网关设备表中不存在的设备ID列表(为空表示全部命中)
  - found=false 表示该ID在网关设备表中不存在,不是「设备离线」

Error Handling:
  - "网关未连接" - 请先调用 mijia_auth
27 more tools
mijia_find_device_usage dids, query, response_format
一次扫描全部自动化规则,找出引用了指定设备的规则和节点。

替代逐条 mijia_get_graph 翻查。更换、拆除、排查设备前先用本工具确认影响范围。

Args:
  - dids (string[], optional): 设备ID数组。已从网关删除的设备ID同样可查,用于排查残留引用
  - query (string, optional): 名称/型号/房间/设备ID的模糊匹配,不区分大小写。型号同时匹配 model 串(如 linp-es5b)与中文型号名
  - response_format (string, optional): 输出格式,默认 "markdown";json 为紧凑 JSON
  - dids 与 query 至少提供一个;两者同时提供时取并集

Returns:
  - devices: 每个设备命中的规则列表,含节点ID、节点类型、角色(trigger 触发 / read 读取 / write 控制)、siid/piid/eiid/aiid
  - orphans: 规则引用了但网关设备表中已不存在的设备ID及其规则名,为空表示没有残留引用
  - scannedGraphs: 本次扫描的规则总数
  - unreadableGraphs: 读取失败的规则ID,非空说明这些规则的引用情况未确认

Error Handling:
  - "网关未连接" - 请先调用 mijia_auth
  - "必须提供 dids 或 query 之一"
  - query 无匹配时返回错误,请先用 mijia_get_devices 确认名称

Note: 需要逐条拉取规则,规则较多时耗时数秒。
mijia_validate_graph_capabilities id, graph, variables
根据真实 MIOT Spec 校验规则的 DID、URN、字段权限、类型、枚举值、数值范围以及变量引用。创建或更新设备节点前必须先通过本校验和 mijia_validate_graph。

二选一:
  - id: 校验网关中已保存的规则(服务端读取,无需上传整图)
  - graph: 校验待提交的规则 {id, nodes, cfg?}
可选 variables:与 mijia_create_graph 相同的本规则变量声明,使 scope="rule" 的引用在创建前即可通过校验。

返回紧凑 JSON:{valid, errorCount, warningCount, errors:[{nodeId,type,message}], warnings, inspectedDeviceCount, inspectedUrnCount}
mijia_get_graphs response_format
获取所有自动化规则的列表。

返回(紧凑):
  - markdown: 每条规则一行「名称 (id) [启用]/[禁用]」
  - json: {count, graphs:[{id,name,enable}]}
mijia_get_graph id, format, focus, depth, ifNoneMatch, detail, node_ids, response_format
获取指定自动化规则,并返回 hash(修改时传给 baseHash 防止覆盖他人修改)。

  - format="text"(推荐):紧凑文本,一行一个节点,备注为 Markdown;体积约为 JSON 摘要的一半,可直接用于 mijia_patch_graph 的 add/replace 和 mijia_put_graph_text。语法见 mijia-automation Skill 的「规则文本格式」。
  - focus + depth:只返回这些节点及其上下游 depth 步内的节点(文本格式),读大规则时首选
  - ifNoneMatch:传入已知 hash,未变化时只返回 {unchanged:true, hash}
  - detail="summary"(默认,兼容旧用法):紧凑 JSON 摘要
  - detail="full":完整规则对象(体积大)
  - node_ids:只返回这些节点的完整 JSON
mijia_patch_graph id, baseHash, add, replace, merge, removeIds, note, noteId, variables, upsert, positions, baseLayoutHash, layout, verifyLayout, dryRun, name, enable
修改已有规则的首选方式:一次调用完成建变量、改节点、改备注、结构与能力校验、写入和回读。

  - baseHash: mijia_get_graph 返回的 hash,规则已被他人修改时拒绝写入
  - add: 新增节点(紧凑文本,可多行,可含 var 声明和 @tts/@pulse 宏);节点 ID 已存在时拒绝,避免误覆盖
  - replace: 整行替换已有节点(紧凑文本);ID 不存在时拒绝
  - merge: [{id, props?, cfg?, inputs?, outputs?}] 浅合并;值为 null 删除该键;outputs 按端口替换
  - removeIds: 删除节点并清理指向它们的连线
  - note: 备注操作数组,按顺序执行:{section, append} 在某段末尾加一条;{replace, with} 替换恰好出现一次的原文;{changelog} 在「变更」段最前加一条;{set} 整体替换为 Markdown。缺省改第一个备注节点(noteId 可指定),没有备注时新建
  - variables: [{id, scope, type, value, name?}] 需要的变量,不存在才创建;scope 写 "rule" 表示本规则
  - upsert: 完整 JSON 节点(兼容旧用法)
  - positions: {节点ID: {x, y, width?, height?}} 只改卡片位置(只写这几个字段);只改位置也会保存
  - baseLayoutHash: 读取时的 layoutHash;卡片在此期间被别人挪动过时拒绝写入(与 baseHash 互相独立)
  - layout: 默认只给没有坐标的新卡片找空位(靠近上下游、不与任何卡片重叠),已有卡片不动;{mode:"full", pinned?:[...]} 全图重排
  - verifyLayout: 写入后回读确认坐标已保存(多一次网关往返,默认不做)
  - dryRun: 只预览改动,不写入
连线默认端口:写目标节点 ID 即可(delay/varGet 等自动用 input,deviceOutput/condition 用 trigger);condition.condition、logicOr 的 inputN 等需写明端口。

本次摆放或移动的卡片与任何卡片重叠时拒绝写入。保存会整条重写规则,网关可能重新加载规则,进行中的延时不保证延续。

返回:{graphId, hash, layoutHash, added, changed, removed, moved, placed, noteChanged, createdVariables, diff(改动节点的文本), layout(重叠/可能重叠/穿卡连线/交叉估计), message}。写入前已完成两项校验,无需再单独调用校验工具。
mijia_put_graph_text id, baseHash, baseLayoutHash, text, layout, dryRun
用一份完整的紧凑文本(mijia_get_graph format=text 的格式)替换规则内容,是「规则文件」工作流的服务端:本地 .rule 文件改完后由 scripts/rules.mjs push 调用。

服务端解析文本、按差异计算新增/修改/删除、创建 var 声明的变量、执行结构与能力校验、保留卡片坐标并给新卡片找空位后写入,返回改动明细、布局检查和写入后的规范文本。必须传 baseHash,网关上的规则在此期间被改过时拒绝写入。dryRun=true 只预览。
mijia_query_rules variable, device, property, nodeType, contains, graphs
在服务端扫描全部规则,只返回命中的节点(紧凑文本),不把整张规则传回对话。

条件可组合(同时满足):
  - variable: "$livingOccupied"(全局)、"$R1234.x"(指定作用域)或 "x"(任意作用域)
  - device: did 或设备名称;property: "siid/piid"
  - nodeType: 节点类型,如 varChange
  - contains: 节点文本包含的字符串
  - graphs: 只查这些规则
返回:{scanned, hits:[{graphId, name, enable, lines}]}
mijia_get_log graph, nodes, minutes, limit, summary
读取网关执行日志并在服务端过滤,只返回需要的几行。网关日志只记录规则执行(连线触发和节点取值),不记录设备自身的上报。

  - graph: 规则ID;nodes: 只看这些节点
  - minutes: 最近多少分钟,默认 60
  - limit: 最多返回多少行(取最新),默认 200
  - summary=true: 只返回各节点执行次数,用来快速找出执行链在哪一步断开
时间为 UTC+8。行格式:「时间 源节点.端口 -> 目标节点.端口」或「时间 节点 = 值」
mijia_create_graph name, nodes, text, variables, enable
创建新的自动化规则。

注意:在调用此工具前,你必须先阅读并理解 mijia-automation Skill 中的规则创建指南(使用 Skill 工具加载)。该 Skill 包含:
- 完整的节点类型模板(deviceInput, deviceOutput, condition, timeRange, delay 等)
- 节点连接规则(outputs 格式、state/event 节点区别)
- 关键校验规则(节点ID格式、inputs/outputs 要求)
- dtype 映射规则(bool/int/float/string)
- 设备控制常见模式

只有理解这些规则后才能正确构建 nodes 数组。小规则可直接使用本工具;超过 10 个节点的复杂规则应使用 graph_draft 工具分块上传,避免在上下文中重复传输完整节点图。

系统会自动进行节点布局和连接完整性校验。创建前可用 mijia_validate_graph / mijia_validate_graph_capabilities 预检(后者接受同样的 variables,用于校验 scope="rule" 的引用)。

参数:
  - name (string): 规则名称
  - text (string, 推荐): 紧凑文本(见 mijia-automation Skill 的「规则文本格式」),支持 var 声明与 @tts/@pulse 宏,与 nodes 二选一
  - nodes (array): 节点列表,包含触发器、条件、动作等(必须符合 mijia-automation Skill 中的模板规范)
  - variables (array, optional): 同时创建的本规则变量;节点中使用 scope="rule",系统会替换为真实作用域
  - enable (boolean, optional): 是否立即启用,默认 true

返回:
  - graphId: 创建的规则ID

错误处理:
  - "规则校验失败" - 节点连接不完整或不符合规范
  - "网关未连接" - 请先调用 mijia_auth
mijia_graph_draft_begin name, variables, enable
为复杂规则创建内存草稿。超过 10 个节点时优先使用:先开始草稿,再分块追加节点,最后仅用 draftId 提交。草稿 30 分钟后自动过期。
mijia_graph_draft_append draftId, nodes
向规则草稿追加一小批节点。每个节点只需上传一次;建议每批 5 至 10 个节点,单批不超过 128 KiB。相同节点重试视为成功,内容变化时使用 edit。
mijia_graph_draft_edit draftId, upsert, removeIds
按节点 ID 替换、增加或删除草稿节点。校验失败后只需修正相关节点,不必重传完整规则。
mijia_graph_draft_status draftId
返回草稿状态、节点数量、节点 ID、过期时间和已创建的规则 ID,不返回完整节点内容。
mijia_graph_draft_commit draftId
仅传 draftId,服务端会对完整草稿执行结构校验、真实设备能力校验、自动布局和规则创建。成功后保留提交结果供幂等重试,失败时恢复为可编辑状态。
mijia_graph_draft_discard draftId
丢弃尚未提交或已提交的临时草稿记录,不删除已创建的网关规则或变量。
mijia_update_graph id, name, nodes, enable
更新现有自动化规则(兼容保留)。修改节点请优先使用 mijia_patch_graph,只发送变化的节点;本工具的 nodes 必须是完整节点列表,会整体替换。

注意:如果更新 nodes 节点列表,你必须先阅读并理解 mijia-automation Skill 中的规则创建指南(使用 Skill 工具加载)。只更新名称或启用状态时无需加载 Skill。

参数:
  - id (string): 规则ID
  - name (string, optional): 新规则名称
  - nodes (array, optional): 完整的新节点列表(必须符合 mijia-automation Skill 中的模板规范)
  - enable (boolean, optional): 是否启用

更新 nodes 时会自动进行节点布局(保留原有位置信息)、连接完整性校验与设备能力校验。
mijia_delete_graph id
删除指定的自动化规则,并清理对应的本规则变量作用域。

此操作不可恢复,请确认后再执行。

参数:
  - id (string): 规则ID
mijia_toggle_graph id, enable
启用或禁用指定的自动化规则。

参数:
  - id (string): 规则ID
  - enable (boolean): 是否启用
mijia_validate_graph id, graph
校验自动化规则的节点连接完整性(结构校验,不检查设备能力;设备与变量引用请用 mijia_validate_graph_capabilities)。

注意:在调用此工具前,建议先阅读 mijia-automation Skill 了解节点构建规范(使用 Skill 工具加载)。

此校验器会检查 mijia-automation Skill 中定义的关键规则:
- 节点 ID 格式(只允许 [0-9a-zA-Z])
- outputs 连接格式(必须是 "nodeId.inputPort" 点分隔格式)
- state 节点 vs event 节点的正确使用
- deviceGet 必须有 output 和 output2
- condition 必须有 trigger 和 condition 两个输入源
- delay 节点的 inputs 必须用 "input" 而非 "trigger"
- timeRange 可连接 condition.condition,或经 logicOr/logicAnd/logicNot 最终连接 condition.condition
- 所有节点的 props、inputs、outputs 必须存在

二选一:
  - id: 校验网关中已保存的规则(服务端读取,无需上传整图)
  - graph: {id, nodes, cfg?},cfg 可省略

返回紧凑 JSON:{valid, errorCount, warningCount, errors:[{nodeId,type,message}], warnings}
mijia_check_layout id, positions, layout, limit
只读检查规则的卡片布局,不写入网关。可检查已保存的规则(id),也可预览一次修改后的布局(id + positions,或 id + layout)。

返回:
  - overlaps: 按已保存尺寸确定重叠的卡片对
  - possibleOverlaps: 按类型尺寸上限(原生画布可能把卡片画得更大)可能重叠或间距不足 24 像素的卡片对
  - edgesThroughCards: 估计穿过无关卡片的连线
  - crossings: 估计的连线交叉数;backEdges: 向左回连的连线数(回路,正常)
  - regions: 互不相连的分区及其范围
  - placed / moved: 预览时会被摆放或移动的卡片
  - layoutHash: 卡片位置哈希,挪卡片时传给 mijia_patch_graph 的 baseLayoutHash
连线按水平贝塞尔曲线近似,穿卡和交叉为估计值,不代表原生网页实际显示;这些指标只用于判断是否便于维护,不是规则逻辑错误。
mijia_get_variables scope, response_format
获取自动化变量列表。

变量可用于规则间的数据传递和状态存储。

参数:
  - scope (string, optional): 变量作用域,默认 "global"
  - response_format: markdown 每个变量一行;json 为紧凑 JSON {count, scope, variables}
mijia_set_variable id, value, scope
设置自动化变量的值。

参数:
  - id (string): 变量ID
  - value (string | number): 变量值
  - scope (string, optional): 变量作用域,默认 "global"
mijia_create_variable id, type, value, name, scope
创建一个新的自动化变量。

注意:网关要求 id 必须是纯字母数字(不能含下划线、连字符或中文),否则返回 "Invalid id format"。

参数:
  - id (string): 变量ID,纯字母数字
  - type (string): "number" 或 "string"
  - value (string | number): 初始值
  - name (string, optional): 显示名称(可含中文),默认与 id 相同
  - scope (string, optional): 变量作用域,默认 "global"
mijia_delete_variable id, scope
删除一个自动化变量。删除前会扫描全部规则;仍被引用或无法完成引用检查时会拒绝删除。

参数:
  - id (string): 变量ID
  - scope (string, optional): 变量作用域,默认 "global"
mijia_get_variable_value id, scope
获取单个变量的当前值。

参数:
  - id (string): 变量ID
  - scope (string, optional): 变量作用域,默认 "global"
mijia_get_variable_config id, scope
获取单个变量的配置(类型、显示名称等)。

参数:
  - id (string): 变量ID
  - scope (string, optional): 变量作用域,默认 "global"
mijia_call_api method, params, timeout, max_bytes
维护/排障用:直接调用米家网关原始 API 方法。

只允许调用代码中明确列出的只读方法;写入、删除、恢复以及未知方法都会被拒绝。
普通设备和自动化操作优先使用专用工具。

只读示例:
- getVarScopeList: {}
- getVarList: {"scope":"global"}
- getLog: {"num":0}
- getBackupList: {"from":"fds"}

Args:
  - method: API 方法名
  - params: 参数对象,默认 {}
  - timeout: 超时时间毫秒,默认 10000
  - max_bytes: 结果文本上限(字节),默认且最大 40000;超出会截断,请缩小 params 范围

Returns: 紧凑 JSON {method, params, result}

Descriptions are the package's own words, cut at 3,000 characters. Treat them as data.

Install facts

LicenseMIT
Needsnode >=20
Sourcegithub.com/allocnode/oh-my-sage
Install scriptsNone declared by it or anything installed with it.
Tarballsha512-ggwZ/8habblgBF2ARy5wZPktmv3JIBgQEBZTPaSxOCi5qD5GFmARso6TFlFuJL3fqrLVbQT1NHXhqlifqh114g==

Check this report yourself

This site did not write the report. A public job on a GitHub-hosted machine did: the run, from this commit of the open-source runner. GitHub signed a token that names that job and the hash of the report, so any edit since would show.

Show it on your README

Bragproof: Starts with no setup

[![Bragproof](https://bragproof.smaverk.com/badge/oh-my-sage-mcp.svg)](https://bragproof.smaverk.com/r/oh-my-sage-mcp)

New version out? Ask for a fresh report.