Repository navigation
MCP Server v1.0.1
·
125 commits
to master
since this release
MCP Server v1.0.1
First public release / 首个公开版本. Includes the previously unpublished v1.0.0 development work.
Requires AutoJs6 versionCode 5279 or later. Optional offline documentation resources require a host build with app.listDocs / app.readDoc and the Offline Docs plugin.
默认仅监听 127.0.0.1:9637/mcp. 在 AutoJs6 抽屉开启服务, 从设置页复制客户端配置, 并在手机上确认首次配对.
简体中文
- Feature 可选的离线文档资源: 安装 AutoJs6 离线文档插件且宿主通过 app.listDocs / app.readDoc 转读时, resources/list 增加 autojs6://docs/ (带子 URI 的索引) 与每个文档页面对应的 autojs6://docs/{+path} 资源, resources/templates/list 增加 docs 模板; 未安装插件或宿主不含这两个方法时不列出任何条目, 并由 _meta.docsCatalogStatus 说明原因
- Improvement 将 compileSdk 提升到 37 (Android 17), targetSdk 保持 36, 待依赖目标版本的行为验证后再提升
- Improvement MCP 一致性 (P6): 在两台设备上以官方 @modelcontextprotocol/conformance 套件 0.1.16 测试有状态的 /mcp 路径. 32 个服务器场景中 9 个通过 (initialize, ping, tools/list, 文本与错误工具结果, resources/list, prompts/list, 并发 SSE 流, DNS rebinding 保护); 18 个调用套件自带的参考夹具 (test_* 工具, 提示与 test:// 资源, 本服务器以未知工具结果, -32602 或 isError 应答), 5 个依赖本服务器未声明的能力 (logging, completions, 资源订阅). 回环 Origin 头现在在任何模式下都被接受 (套件如此要求); CORS 头与预检应答仍仅限开发者模式. 2026-07-28 无状态模型没有路由 (Roadmap D9). 详见 docs/dev/p6-conformance.md.
- Improvement 安全审计 (P6): 七项清单 (令牌存储, 日志脱敏, 导出组件, 明文范围, 局域网默认关闭, 配对撤销, 工具分组默认关闭) 已在代码与两台设备上逐项核对, 记录于 docs/dev/p6-security-audit.md, README 安全章节改为说明这些边界. 明文 HTTP 由网络安全配置限定为回环地址, 取代应用级 usesCleartextTraffic 标志; 插件不发起客户端连接, 监听器也不需要该标志.
- Improvement 性能基线 (P6): 在 API 24 模拟器, Sony 手机 (API 33) 与小米平板 (API 35) 上测量 ui_dump 50 / 200 / 400 节点, screen_capture 三档尺寸, script_run 往返与 4 路并发请求, 记录于 docs/dev/p6-performance-baseline.md, 仅作参考不设阈值. 仅由插件应答的调用在模拟器与手机上约 20 ms, ui_dump 每节点约增加 0.05 ms, 无障碍截图路径 100 ms 内应答而 API 24 的 MediaProjection 路径每次约 1.35 s, 4 路并发请求在宿主 4 路并发上限内以单次往返的 1.0-1.8 倍完成.
- Feature 手机设置页提供服务状态, USB 转发, 端口和局域网访问, 令牌显示/复制/轮换, 配对撤销, 工具分组和 root 权限, 开发者模式, 可复制的 Claude Code / Cursor / Codex / 通用 HTTP 配置及发行历史, 并跟随 AutoJs6 外观. 网络设置会重启运行中的监听器, 令牌和权限变更立即生效. 敏感信息窗口禁止截图.
- Feature MCP 资源 (P3.5) 提供只读工作目录文件, 可浏览的宿主示例, 设备信息和最近控制台输出, 遵守配对与分组开关. 文本和二进制读取报告截断状态. write_autojs6_script, automate_task 和 debug_selector 提示提供中英文指导, 其他手机语言回退英语.
- Feature 工作目录工具 (P3.4): files_list / stat / read / write / mkdir / rename / delete, 使用从 1 开始的行列号的 editor_open, app_launch / list, clipboard_get / set, device_ensure_accessibility, toast 和 shell_exec. 二进制读取使用 base64, 原始数据最多 1 MiB. 写入还受宿主请求预算约束 (通常为包含 JSON 转义的 96 KiB). 文件删除和 Shell 默认关闭; root 另需 allowShellRoot 开关与宿主 shell.root 授权. 这些能力需要匹配的 P3.4 宿主构建.
- Feature 插件标识
mcp-server, 含 INFO 服务, Wake Activity 以及供宿主发现的org.autojs.plugin.MCP_SERVER服务骨架 - Feature 10 种语言的 README, 插件中心说明与更新日志
- Feature 位于
http://127.0.0.1:9637/mcp的 Streamable HTTP 端点及device_ping工具, 由可经 adb 或宿主启停的前台服务承载 (开发预览) - Feature
/mcp端点的传输加固: 绑定地址与端口来自服务器配置存储, 请求体上限 1 MiB, 空闲连接 60 秒后关闭, 端口被占用或绑定被拒绝时以port_in_use/bind_failed状态附带提示结束而非崩溃 - Feature SDK 传输前置的 DNS rebinding 保护: 回环模式只接受
localhost/127.0.0.1/[::1]作为Host, 局域网模式加入设备当前 IPv4 地址与可选的额外主机名并在网络变化时刷新; 浏览器来源一律拒绝, 仅 "开发者模式" 开关经 CORS 放行 Inspector 的回环来源 - Feature 服务器标识
autojs6-mcp-server携带插件版本, 并声明 tools (listChanged), resources 与 prompts 能力;tools/list保持注册顺序以便客户端缓存 - Feature 每个
/mcp请求的 Bearer 令牌鉴权: 首次启动时生成 32 字节令牌, 以 Android Keystore 的 AES-GCM 密钥包裹后存放在插件私有且不参与备份的存储中;Authorization头缺失或错误时经常量时间比较后以401+WWW-Authenticate: Bearer与 JSON-RPC-32001错误拒绝; 令牌不写入日志 - Feature 传输前置的首次配对: 未配对客户端可以
initialize并列出 tools, resources 与 prompts, 但首次tools/call,resources/read,resources/subscribe或prompts/get返回PAIRING_REQUIRED(-32002), 直到 60 秒内在手机上确认; 拒绝或超时后 30 秒内返回PAIRING_DENIED(-32003); 客户端按clientInfo名称 (缺失时用User-Agent) 加地址类别 (回环 / 局域网) 识别, 因此令牌轮换不影响已有配对, 最多可配对 32 个客户端 - Feature 手机上的配对确认走双通道: 带允许 / 拒绝动作的高优先级通知, 以及屏幕解锁时弹出的对话框; 服务器配置, 令牌与已配对客户端保存在原子替换的文件中, 服务器进程与设置页共享且不会读到过期缓存
- Feature 带分组开关的工具目录 (决策 D6):
device_ping(插件本地),device_info(AutoJs6device.info) 与script_run(AutoJs6engines.execScript: 运行 JavaScript, 最多等待timeoutMs直到脚本结束, 返回结果与最新的控制台行, 运行期间发送进度通知); 每个工具声明封闭的 JSON Schema (additionalProperties: false), 参数在到达 AutoJs6 之前完成校验; 分组开关script/ui/ui_gesture/screen/files/files_delete/device/shell存放于tool_groups.json, 关闭的分组自下一次请求起从tools/list消失, 其工具回答TOOL_DISABLED - Feature 宿主桥接:
org.autojs.plugin.MCP_SERVER服务实现真实的IMcpServerPluginBinder (getInfo/getCapabilities报告契约版本 1, 工具分组, MCP 协议版本与 SDK 版本;openServer只接受已安装且同签名的 AutoJs6, 返回带getStatus/updateConfig/stop/close的IMcpServerSession); 工具调用经宿主能力代理传递, 带单调递增的请求 id, 每次调用的超时, 4 路并发上限, 宿主错误类别映射为HOST_UNAVAILABLE/A11Y_SERVICE_NOT_RUNNING/CAPABILITY_DENIED/LIMIT_EXCEEDED/RATE_LIMITED/TIMEOUT/HOST_ERROR; AutoJs6 退出时监听器继续运行, 依赖宿主的工具回答HOST_UNAVAILABLE直到宿主重新连接; 状态与事件 (pairing_requested,client_paired,tool_call,warning) 经回调送达宿主 - Feature 前台服务通知显示端点, AutoJs6 连接状态与已配对客户端数, 并提供停止动作; 通知被禁用时以 toast 提示端点;
dumpsys activity service额外打印宿主会话, 工具分组开关与已注册工具 - Feature 补全脚本分组:
script_run_file运行设备上的脚本文件,script_stop/script_stop_all停止一个或全部 AutoJs6 执行,script_list列出运行中的执行,console_tail返回最新的控制台行并带nextSinceId游标与级别过滤;script_run与script_run_file现在返回executionId,status(finished/error/running),durationMs, 含行号的异常与最新的控制台行, 等待期间每 2 s 发送一条携带最新控制台行的进度通知 - Feature MCP 端点的响应改为以服务器发送事件 (SSE) 流式返回 (不再使用 SDK 的 JSON 响应模式), 属于某个请求的通知 (如运行中脚本的进度心跳) 会随该请求自身的响应送达客户端
- Feature 新增 UI 分组 (roadmap P3.2):
ui_dump以带#n引用的紧凑节点树返回当前窗口 (format为 text / json / xml,maxNodes最多 400,maxDepth,visibleOnly,window),ui_find/ui_wait_for轮询选择器,ui_current_window与ui_explain_selector报告窗口与选择器失败的原因,ui_click/ui_long_click/ui_set_text/ui_scroll作用于nodeRef(按指纹重定位, 节点消失时返回NODE_REF_STALE) 或selector,ui_press_key按下 back / home / recents / notifications / quick_settings / power_dialog / lock_screen, 默认关闭的ui_gesture分组增加ui_swipe,ui_gesture与点击工具的坐标形式 (分组关闭时返回TOOL_DISABLED); 工具目录快照增至 20 个工具; 坐标手势需要 2026-09-11 或之后构建的 AutoJs6 宿主 (更早的宿主会随机以 "the system cancelled ..." 应答) - Feature 截图分组 (P3.3): screen_capture 返回 MCP 图片, 支持裁剪, scale 或 maxWidth, JPEG / PNG / WebP 与质量参数. 默认 JPEG 质量 70, 最长边 1280 px. base64 超过 4 MiB 时降低质量或尺寸重试, 元数据说明调整情况. screen_state 返回亮屏状态, 尺寸, 方向和密度. 工具目录现有 22 项. MediaProjection 回退需要 2026-09-13 或之后构建的 AutoJs6 宿主及手机端授权, 宿主会话复用该授权.
- Feature 局域网路径 (P5.1): 开启局域网访问后, 设置页列出手机当前地址 (Wi-Fi 变化时刷新) 并提示同网段与防火墙; 来自局域网的配对请求在对话框和通知中显著标注; 每日提醒服务器仍可从局域网访问, 可关闭且不重启监听. README 记录 USB 与局域网路径.
- Feature 每客户端速率限制 (P6): 每客户端每秒最多 20 个请求, 每分钟最多 30 次 screen_capture. 超限请求返回 HTTP 429, 带 Retry-After 头和含 retryAfterMs 的 JSON-RPC RATE_LIMITED 错误; 超限截图以带 retryAfterMs 的 RATE_LIMITED 工具结果应答, 便于模型等待. 宿主 grant 的无障碍查询速率在此之上仍然生效.
- Feature 空闲自动停止与电量 (P6): 设置页新增 "空闲时自动停止" (默认关闭; 5 / 15 / 30 / 60 / 120 分钟). 监听器在所选时间内没有客户端请求时自行停止, 记录插件内部的 idle_timeout 原因, 留下一条可自动消失的通知, 且不算作用户停止; 处理中的请求 (正在运行的工具调用) 不算空闲, 而仅保持连接却不发请求的客户端不会让服务器继续运行. 当 Android 限制了本应用的电池用量 (HyperOS 与 MIUI 默认对侧载应用如此, 息屏并使用电池约一分钟后会停止前台服务) 时, 设置页显示警告和 "电池设置" 按钮, AutoJs6 收到一条 warning 事件. 空闲 CPU 时间与一小时空闲的 batterystats 估算记录于 docs/dev/p6-battery-and-residency.md.
- Improvement 构建阶段阻止意外引入原生依赖, 并输出 JSON 校验报告
- Fix IDE rebuild 不再为 JVM 单元测试查找 APK. APK 校验任务会自动组装所需产物, 可直接从 clean 后执行.
- Fix 插件中心亮暗模式下图标比例不一致及自适应图标留白不足的问题; 夜间同样使用自适应图标, 调整图层尺寸以保留 ic_launcher_round.png 的完整图形和留白, 仅切换背景色
- Fix 设置页的键盘 Tab 导航会跳过工具栏返回按钮; 现在 Tab 循环覆盖返回按钮和全部控件 (含 Android 7). 设备测试检查读屏标签与键盘操作.
- Fix script_run 与 script_run_file 的 arguments 映射以 JSON Schema 数组声明值类型, 部分 MCP 客户端会拒绝或弱化; 现改为单类型 anyOf 分支. README 新增 "接入" 与 "常见问题" 章节及实测客户端矩阵.
- Fix 敌意请求体在任何解析器递归之前就被拒绝: 嵌套超过 64 层的 JSON, 重复请求 id 的请求体, 以及同一会话上仍在途的请求 id (原本会让先到的请求得不到应答) 都返回 400 与 JSON-RPC 错误; 没有有效会话的 GET 流返回 400 / 404 而非空事件流. JVM 测试与设备测试 (API 28 / 31 / 33 / 35) 覆盖超长, 超深, 非法 UTF-8, 未知方法, 头部组合, 超大 base64 与 64 并发会话.
- Fix 生命周期矩阵 (P6): 带有上一个监听进程会话 id 的请求 (监听进程被杀, 或因令牌轮换而重启之后) 交由传输层回 404, 让客户端重新 initialize, 而不再以请求的 User-Agent 为已配对的客户端发起多余的配对提示; 监听进程死亡后残留在通知栏的配对通知在下一个监听器启动时清除. 宿主被杀, 监听进程被杀, 两者同时被杀, 在系统设置中强制停止, 活动会话中的令牌轮换, 以及跨越宿主被杀与监听进程被杀的待确认配对, 各自的期望状态与恢复路径记录于 docs/dev/lifecycle-matrix.md 并在真机上验证.
- Dependency MCP Kotlin SDK 0.15.0 (
kotlin-sdk-server) 与 Ktor 3.5.1 CIO 引擎 - Dependency 附加 Ktor 3.5.1
ktor-server-test-host用于 JVM 传输测试 (仅测试范围) - Dependency 附加
mcp-server-api.aar(AutoJs6 模块plugin-api/mcp-server-api, 宿主构建 6.8.0 / 5279, MPL 2.0) 作为 AutoJs6 与插件之间的 Binder 契约, 并在locks/host-api-aars.lock中锁定哈希 - Dependency 更新来自 P4 宿主构建的 common-plugin-api 和 mcp-server-api 配套 AAR: 可选设置扩展 v1, AIDL transaction 顺序不变, SHA-256 锁定, 保留 SDK 36 消费兼容性.
English
- Feature Optional offline documentation resources: when the AutoJs6 Offline Docs plugin is installed and the host relays it through app.listDocs / app.readDoc, resources/list adds autojs6://docs/ (an index with child URIs) and one autojs6://docs/{+path} resource per documentation page, and resources/templates/list adds the docs template; without the plugin, or on a host without these methods, nothing is listed and _meta.docsCatalogStatus tells why
- Improvement Raise compileSdk to 37 (Android 17); targetSdk stays at 36 until the behavior that depends on the target is verified
- Improvement MCP conformance (P6): the official @modelcontextprotocol/conformance suite 0.1.16 was run against the stateful /mcp path on two devices. 9 of its 32 server scenarios pass (initialize, ping, tools/list, text and error tool results, resources/list, prompts/list, concurrent SSE streams, DNS rebinding protection); 18 call the suite's own reference fixtures (test_* tools, prompts and test:// resources, which this server answers with an unknown-tool result, -32602 or isError) and 5 need capabilities the server does not declare (logging, completions, resource subscriptions). A loopback Origin header is now accepted in every mode, as the suite expects; CORS headers and preflight answers stay limited to developer mode. The stateless 2026-07-28 model has no route (Roadmap D9). Details in docs/dev/p6-conformance.md.
- Improvement Security audit (P6): the seven checklist items (token storage, log redaction, exported components, cleartext scope, local network off by default, pairing revocation, default-off tool groups) are verified in the code and on two devices in docs/dev/p6-security-audit.md, and the README security section now states these boundaries. Cleartext HTTP is limited to loopback addresses by a network security configuration instead of the app-wide usesCleartextTraffic flag; the plugin opens no client connections and the listener does not need the flag.
- Improvement Performance baseline (P6): ui_dump at 50 / 200 / 400 nodes, screen_capture at three sizes, script_run round trips and four concurrent requests were timed on an API 24 emulator, a Sony phone (API 33) and a Xiaomi Pad (API 35) and recorded in docs/dev/p6-performance-baseline.md as a reference without thresholds. A plugin-only call answers in about 20 ms on the emulator and the phone, ui_dump grows by about 0.05 ms per node, the accessibility screenshot path answers within 100 ms while the MediaProjection path on API 24 takes about 1.35 s per capture, and four concurrent requests complete in 1.0-1.8 times one round trip within the host's limit of four concurrent calls.
- Feature Phone settings for server status, USB forwarding, port and LAN access, token display/copy/rotation, pairing revocation, tool groups and root permission, developer mode, copyable Claude Code / Cursor / Codex / generic HTTP configurations, release history, and appearance following AutoJs6. Network settings apply by restarting an active listener; token and permission changes take effect immediately. Secret dialogs block screenshots.
- Feature MCP resources (P3.5) expose read-only workspace files, browsable host samples, device information, and recent console output, respecting pairing and group switches. Text and binary reads report truncation. The write_autojs6_script, automate_task, and debug_selector prompts provide English and Chinese guidance, with English fallback for other phone languages.
- Feature Workspace tools (P3.4): files_list / stat / read / write / mkdir / rename / delete, editor_open with one-based line and column, app_launch / list, clipboard_get / set, device_ensure_accessibility, toast, and shell_exec. Binary reads use base64, up to 1 MiB of raw data. Writes also obey the host request budget (normally 96 KiB including JSON escaping). File deletion and Shell are off by default; root additionally requires allowShellRoot and a shell.root host grant. These additions require the matching P3.4 host build.
- Feature Plugin identity
mcp-serverwith the INFO service, the Wake Activity, and theorg.autojs.plugin.MCP_SERVERservice skeleton for host discovery - Feature README, plugin-center instructions, and changelog in 10 languages
- Feature Streamable HTTP endpoint at
http://127.0.0.1:9637/mcpwith thedevice_pingtool, hosted by a foreground service that adb or the host can switch on and off (development preview) - Feature Transport hardening for the
/mcpendpoint: the bind address and port come from the server config store, request bodies are capped at 1 MiB, idle connections close after 60 s, and a port that is already taken or a refused bind ends in aport_in_use/bind_failedstatus with a hint instead of a crash - Feature DNS rebinding protection in front of the SDK transport: loopback mode accepts only
localhost/127.0.0.1/[::1]asHost, LAN mode adds the device's current IPv4 addresses and optional extra host names and refreshes them when the network changes; browser origins are refused unless the developer-mode switch admits the Inspector's loopback origin through CORS - Feature Server identity
autojs6-mcp-serverwith the plugin version and the tools (listChanged), resources, and prompts capabilities;tools/listkeeps the registration order so clients can cache it - Feature Bearer token authentication for every
/mcprequest: a 32-byte token generated on first start, wrapped with an Android Keystore AES-GCM key and kept in the plugin's private, never-backed-up storage; a missing or wrongAuthorizationheader is refused after a constant-time comparison with401+WWW-Authenticate: Bearerand a JSON-RPC-32001error; the token never reaches the log - Feature First-use pairing in front of the transport: an unpaired client may
initializeand list tools, resources, and prompts, but its firsttools/call,resources/read,resources/subscribe, orprompts/getanswersPAIRING_REQUIRED(-32002) until the request is confirmed on the phone within 60 s; a denial or a timeout answersPAIRING_DENIED(-32003) for 30 s; a client is identified by itsclientInfoname (orUser-Agent) plus the address class (loopback / LAN), so a token rotation keeps existing pairings, and up to 32 clients can be paired - Feature Pairing confirmation on the phone through two channels: a high-priority notification with Allow / Deny actions, plus a dialog while the screen is unlocked; the server configuration, the token, and the paired clients live in atomically replaced files that the server process and the settings page share without stale caches
- Feature Tool catalog with group switches (decision D6):
device_ping(plugin-local),device_info(AutoJs6device.info), andscript_run(AutoJs6engines.execScript: runs JavaScript, waits up totimeoutMsfor it to finish, and returns the outcome plus the newest console lines, with progress notifications while it runs); every tool declares a closed JSON Schema (additionalProperties: false) and its arguments are validated before anything reaches AutoJs6; the group switchesscript/ui/ui_gesture/screen/files/files_delete/device/shellare stored intool_groups.json, a switched-off group disappears fromtools/liston the next request and its tools answerTOOL_DISABLED - Feature Host bridge: the
org.autojs.plugin.MCP_SERVERservice implements the realIMcpServerPluginBinder (getInfo/getCapabilitiesreport contract version 1, the tool groups, the MCP protocol versions, and the SDK version;openServeradmits only the installed same-signer AutoJs6 and returns anIMcpServerSessionwithgetStatus/updateConfig/stop/close); tool calls travel through the host capability broker with monotonic request ids, per-call timeouts, the 4-call concurrency ceiling, and host error categories mapped ontoHOST_UNAVAILABLE/A11Y_SERVICE_NOT_RUNNING/CAPABILITY_DENIED/LIMIT_EXCEEDED/RATE_LIMITED/TIMEOUT/HOST_ERROR; when AutoJs6 dies the listener keeps running and host-backed tools answerHOST_UNAVAILABLEuntil the host reconnects; status and events (pairing_requested,client_paired,tool_call,warning) reach the host through its callback - Feature Foreground service notification with the endpoint, the AutoJs6 connection state, and the paired client count plus a Stop action; a toast names the endpoint when notifications are blocked;
dumpsys activity serviceadditionally prints the host session, the tool group switches, and the registered tools - Feature Script group completed:
script_run_fileruns a script file on the device,script_stop/script_stop_allstop one or every AutoJs6 execution,script_listlists the running ones, andconsole_tailreturns the newest console lines with anextSinceIdcursor and a level filter;script_runandscript_run_filenow reportexecutionId,status(finished/error/running),durationMs, the exception with its line, and the newest console lines, and while they wait a progress notification every 2 s carries the newest console line - Feature Responses of the MCP endpoint stream as server-sent events (the SDK's JSON response mode is not used), so a notification that belongs to a request, such as the progress heartbeat of a running script, reaches the client on the response of that request
- Feature UI group added (roadmap P3.2):
ui_dumpreturns the active window as a compact node tree with#nreferences (formattext / json / xml,maxNodesup to 400,maxDepth,visibleOnly,window),ui_find/ui_wait_forpoll a selector,ui_current_windowandui_explain_selectorreport the window and why a selector fails,ui_click/ui_long_click/ui_set_text/ui_scrollact on anodeRef(relocated by its fingerprint,NODE_REF_STALEonce it is gone) or aselector,ui_press_keypresses back / home / recents / notifications / quick_settings / power_dialog / lock_screen, and theui_gesturegroup (off by default) addsui_swipe,ui_gesture, and the coordinate form of the click tools (TOOL_DISABLEDwhile the group is off); the tool catalog snapshot grows to 20 tools; the coordinate gestures need an AutoJs6 host built on 2026-09-11 or later (an older host answers them at random with "the system cancelled ...") - Feature Screenshot group (P3.3): screen_capture returns MCP images with crop, scale or maxWidth, JPEG / PNG / WebP, and quality controls. Defaults are JPEG quality 70 and longest edge 1280 px. Images above 4 MiB of base64 are retried at lower quality or smaller dimensions, with metadata reporting adjustments. screen_state reports power, dimensions, orientation and density. The catalog now has 22 tools. MediaProjection fallback requires an AutoJs6 host built on 2026-09-13 or later and consent on the phone; the host session reuses that consent.
- Feature Local network path (P5.1): with local network access on, the settings page lists the current addresses of the phone (refreshed when Wi-Fi changes) with same-network and firewall hints; a pairing request from the local network is marked in the dialog and the notification; a daily reminder says the server is still reachable from the local network and can be turned off without restarting the listener. README documents the USB and local network paths.
- Feature Per-client rate limits (P6): at most 20 requests per second and 30 screen_capture calls per minute per client. A request over the limit gets HTTP 429 with a Retry-After header and a JSON-RPC RATE_LIMITED error carrying retryAfterMs; a screenshot over the limit is answered as a RATE_LIMITED tool result with retryAfterMs so the model can wait. The host grant keeps its own accessibility query rate on top.
- Feature Idle auto-stop and battery (P6): the settings page offers "Stop automatically when idle" (off by default; 5 / 15 / 30 / 60 / 120 minutes). The listener stops itself after the chosen time without client requests, records the plugin-only idle_timeout reason, leaves one auto-cancelling notification and does not count as a user stop; a request in flight (a running tool call) is never idle, while a client that keeps its stream open without sending requests does not keep the server running. When Android restricts the app's battery usage (HyperOS and MIUI do so for sideloaded apps by default and stop the foreground service about a minute after the screen turns off on battery), the settings page shows a warning with a Battery settings button and AutoJs6 receives a warning event. Idle CPU time and the batterystats estimate of one idle hour are recorded in docs/dev/p6-battery-and-residency.md.
- Improvement Build verification rejects accidental native dependencies and produces a JSON report
- Fix IDE rebuild no longer looks for an APK for JVM unit tests. APK verification tasks automatically assemble their inputs and work from a clean build.
- Fix Plugin Center icon proportions differed between light and dark modes; night mode now also uses the adaptive icon, with layer sizing adjusted to preserve the complete ic_launcher_round.png artwork and margins while changing only the background color
- Fix Keyboard Tab navigation on the settings page skipped the toolbar back button; the Tab cycle now covers the back button and every control, including on Android 7. Device tests check screen reader labels and keyboard operation.
- Fix The arguments map of script_run and script_run_file declared its value type as a JSON Schema array, which some MCP clients reject or weaken; the schema now uses single-type anyOf branches. README gains Clients and FAQ sections with the tested client matrix.
- Fix Hostile request bodies are refused before any parser recurses into them: JSON nested deeper than 64 levels, a body that repeats a request id, and a request id still in flight on the same session (which would have left the earlier request without an answer) get a 400 with a JSON-RPC error; a GET stream without a live session gets 400 / 404 instead of an empty event stream. JVM tests and device tests (API 28 / 31 / 33 / 35) cover oversized, over-deep, invalid UTF-8, unknown method, header combination, large base64 and 64 concurrent session cases.
- Fix Lifecycle matrix (P6): a request that names the session of a previous listener process (after the listener was killed, or restarted by a token rotation) is left to the transport's 404 so the client initializes again, instead of raising a pairing prompt under the request's User-Agent for a client that is already paired; pairing notifications a dead listener process left in the shade are cleared when the next listener starts. Host kill, listener kill, both at once, force-stop from the system settings, token rotation under a live session and a pending pairing across a host kill and a listener kill are recorded with their expected states and recovery paths in docs/dev/lifecycle-matrix.md and verified on devices.
- Dependency MCP Kotlin SDK 0.15.0 (
kotlin-sdk-server) on the Ktor 3.5.1 CIO engine - Dependency Ktor 3.5.1
ktor-server-test-hostadded for the JVM transport tests (test scope only) - Dependency Added
mcp-server-api.aar(AutoJs6 moduleplugin-api/mcp-server-api, host build 6.8.0 / 5279, MPL 2.0) as the Binder contract between AutoJs6 and the plugin, hash-locked inlocks/host-api-aars.lock - Dependency Update the paired common-plugin-api and mcp-server-api AARs from the P4 host build: optional settings extension v1, unchanged AIDL transaction order, SHA-256 locks, and SDK 36 consumer compatibility.