mp_healthCheck
Aggregate read-only health status of the automation environment, including connections, page, logs, and screenshot results, to determine if connection recovery is required.
Instructions
只读聚合当前自动化环境健康状态:连接(devtoolsOnline / wsReachable / automatorConnected)、当前页面路由、项目、日志监听、以及上次 mp_screenshot 结果(lastScreenshotOk / errorCode)。不修复任何东西——要恢复用 mp_recoverConnection,要建立连接用 mp_ensureConnection。
何时用:操作出问题时先调它看全局状态;尤其在 mp_screenshot / page_snapshot 反复失败后,先 healthCheck 再决定是否 mp_recoverConnection。 关键字段:summary='degraded' 表示至少一项能力降级,但不一定可通过重连修复;只有 needsRecovery=true 才调 mp_recoverConnection。连接全绿但 lastScreenshotOk=false 时会返回 summary='degraded' + needsRecovery=false,说明是截图通道降级,不要循环重连。
serverVersion 是本 MCP server 的版本号(不是小程序版本、不是基础库版本、不是开发者工具版本),反馈/调试时带上它即可。
参数:includePage=true 额外探当前路由,includeLogs=true 额外查日志监听状态(都默认 true;探测失败只会进 warnings,不影响其余字段)。connection 可选,覆盖默认连接参数。
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。 | |
| includeLogs | No | ||
| includePage | No |