Repository navigation
Releases: SuperMonster003/AutoJs6-Plugin-MCP-Server
Release list
1.1.0
MCP Server 1.1.0
Official APKs signed with the AutoJs6 release certificate.
Source: 00850fb0da3914412a10c5a49dd752a6bb9816d4
Published release.
- Hint: Requires AutoJs6 6.8.0 build 5298 or later (previously 5279), because node references now rely on AutoJs6
- Hint: Behavior change of the ui tools: ui_find and ui_wait_for return a selector for each node instead of a #n reference, the json and xml forms of ui_dump have no references, ui_set_text with append needs a selector, and ui_dump shows full resource ids
- Fix: The status bar of the settings and release history pages did not take the theme color on Android 15 and later (only the toolbar did)
- Fix: Pairing requests from a computer could stay invisible on the phone on Android 14 and later when notifications were not allowed (the settings page now shows a pending request when it opens and points out that notifications are off)
- Improvement: AutoJs6 connects to the plugin through the capability interface it shares with its other plugins (MCP contract version 2)
- Improvement: The #n references of ui_dump are kept by AutoJs6, which finds the node again when you act on it: a reference keeps working while the window and the node stay the same instead of expiring after 60 s, the newest 8 dumps stay available through snapshotId, and a stale reference says why
- Dependency: AutoJs6 plugin API files updated to host build 6.8.0 / 5329, with
host-capability-api.aar(AutoJs6 moduleplugin-api/host-capability-api, MPL 2.0) added; all hash-locked inlocks/host-api-aars.lock
Requires AutoJs6 host build 5298 or later (1.0.x needed 5279). The MCP endpoint and its authentication are unchanged, so clients and the stdio bridge autojs6-mcp-bridge 0.1.1 (Node.js 22 or newer) connect as before.
APK checksums are in SHA256SUMS.
1.0.3
MCP Server 1.0.3
Official APKs signed with the AutoJs6 release certificate.
Source: d8a75f30e86e3d4bb19f7e1c4937adce10a969b6
Published release.
- Feature: VS Code mcp.json snippet in the client configuration of the settings page: VS Code asks for the token when the server first starts, so the token stays out of the file (the dialog has a "Copy token" button)
- Feature: The client configuration snippets and the token dialog on the settings page can show a QR code holding the same text as the "Copy" button (the token included when the text contains it; the window blocks screenshots)
- Feature: The annotate option of screen_capture, which draws the #n references of the latest ui_dump / ui_find on the image (boxes and labels); the annotation field of the result reports how many were drawn
- Improvement: Resumable event streams on the stateful MCP endpoint: events carry ids, clients of protocol 2025-11-25 or newer first receive a priming event with the reconnection interval, and a dropped request stream can be resumed with a GET carrying Last-Event-ID, which replays the missed events and the final result (bounded retention per session)
- Improvement: device_info, screen_state, script_run and script_run_file declare an output schema (outputSchema) that clients can validate their structured results against; errors of these tools carry the error code and message as text only
- Improvement: Plugin Center icons use the sizes, positions, light and dark artwork, and circular backgrounds adjusted in Icon Studio, retaining reproducible sources and parameters
- Improvement: Android App info icons share Icon Studio artwork and light/dark backgrounds while preserving transparent Plugin Center artwork and existing launcher choices
- Dependency: ZXing Core 3.5.4 (
com.google.zxing:core) added to draw the settings page QR codes (encoder only, Apache 2.0)
Requires AutoJs6 host build 5279 or later. On the computer, the stdio bridge autojs6-mcp-bridge 0.1.1 (Node.js 22 or newer) opens a new session by itself when the phone's listener restarts.
APK checksums are in SHA256SUMS.
1.0.2
MCP Server 1.0.2
Official APKs signed with the AutoJs6 release certificate.
Source: 1061bbcfede66b69a08919f80e4afd0946699bbf
Published release.
- Fix: Settings buttons, switch tracks and thumbs, text inputs, radio choices and dialog buttons follow the host theme color with improved contrast in light and dark modes
- Fix: SDK XML v4 parsing warnings with AGP 9.1 and APK native alignment checks incorrectly triggered by JVM unit-test assembly tasks, using shared build plugins 1.8.3
- Improvement: Android 17 local network authorization moves to plugin-center enablement and plugin settings, with no launcher permission page; missing permission keeps the plugin disabled and automatic startup silent
- Improvement: Target Android 17 (SDK 37) with separate local network permission controls and recovery guidance
APK checksums are in SHA256SUMS.
MCP Server v1.0.1
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 answer...