mp_diagnoseConnection
Read the current connection status of the target (port listening, devtools online, ws reachable, automator connected) without modifying environment. Use to diagnose connectivity issues without triggering reconnection or IDE launch.
Instructions
只读探测当前连接目标的状态(port 是否监听、devtools 是否在线、ws 是否可达、automator 是否已连),不启动 IDE、不重连、不改任何项目状态。
何时用:只想拿一份不改动现状的连接快照时(如用户问“为什么连不上”但不想动环境),或在 mp_ensureConnection / mp_recoverConnection 已失败后,用本工具读细节辅助判断。 何时不用:想“把连接弄通”时不要先调本工具——直接调 mp_ensureConnection,它会自愈/自动拉起 IDE,并在返回里自带一份 diagnosis。
⚠️ 本工具是保守设计:它如实报告 “port not listening / automation not enabled” 等,但不会修复。这种红色结果不是死路、也不需要找用户确认——下一步就是调 mp_ensureConnection 让它自动拉起/重连。
返回 JSON 含各探测项的布尔/状态字段;红色项只代表“当前未就绪”,不代表无法恢复。connection 可选,传入可临时覆盖 projectPath / wsEndpoint / mode / port 等连接参数,省略则用已配置的默认值。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | 可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。 |