android-root-mcp
One-line summary: Drive a rooted Android phone through one MCP server — read the OS-reported UI as named controls, act on them (fast native input), learn what unnamed controls do, run multi-step workflows, and reach anything through root (apps, files, DBs, providers, logs, system settings).
Perceive without screenshots —
ui_describe,ui_snapshot,get_ui_tree,find_elements,ui_queryreturn typed controls with role, label + provenance, actions, stablesemantic_key, region, and delta vs a prior snapshot;screenshot_annotated(Set-of-Mark) andinspect_view_hierarchyare fallbacks for Canvas/ROM-specific view trees.Act semantically —
act,tap_element,element_action,perform_gesture,swipe_screen,press_key: address a control by text/id/desc/index/semantic_keyor x/y, and get back the observable effect (navigation, dialog, scroll, no change) in one round trip via a resident root input daemon (~41 ms taps).Type text —
input_textandfill_formhandle Chinese/Emoji through UIAutomator2, with focus/clear/enter options and one tree dump per form.Learn unnamed controls —
learnprobes one unknown control at a time, diffs the screen, persists per-app effects, and refuses destructive/financial targets (delete/pay/logout/uninstall/password).Batch and automate —
batch_ui_actions,run_workflow(launch/tap/input/swipe/wait/assert/shell/if/repeat with postconditions and bounded loops),workflow_control,saved_workflow(persist/reuse named workflows),wait_for_conditioninstead of blind sleeps.Control apps —
app_action(list/info/launch/stop/restart/clear/enable/disable/install/uninstall),app_permissions,export_apks,send_intent(internal components, DeepLinks, broadcasts),start_activity_root,deploy_and_verify_apk(install → cold start → crash/log/LSPosed/UI summary in one call).Root filesystem & data access —
root_shell,shell_execute,shell_batch,adb_command,device_files,file_transfer_root,inspect_app_data,shared_preferences,sqlite_database(parameterized, WAL-aware, backed up),content_provider,query_system_provider(notifications, SMS, clipboard),app_data_archive(tar+SHA256 backup/restore).Device & system control —
device_control(wifi/bt/data/airplane, brightness, rotation, density, volume, wake/sleep, reboot),system_settings,system_property(+resetprop),optimize_device_for_agent/agent_profile(zero animations, stay-awake, restore by profile_id),device_connection,device_doctor,get_device_status.Diagnostics & verification —
read_logcat_smart(PID/crash/tag/keyword),inspect_lsposed(+ KernelSU/Zygisk modules),device_diagnostics,device_job(background logcat/instrumentation/perfetto with bounded output),record_screen,compare_screenshot(pixel regression),port_forward,webview_control(DevTools DOM/CSS clicks),tool_catalog.
Provides tools for perceiving and controlling a rooted Android device: reads the OS-reported UI hierarchy to identify controls, performs taps, swipes, and key events through native input injection, and learns the effects of unnamed controls by probing and remembering them.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@android-root-mcp Open Settings, tap Wi-Fi, and tell me which networks are listed."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
android-root-mcp
An MCP server that drives a rooted Android phone the way a person does: it reads what the operating system reports, and it remembers what happened the last time it touched something.
Not a screenshot pipeline. Not OCR. Not a blind coordinate tapper.
flowchart LR
A[AI agent] -->|MCP tool call| B[android-root-mcp]
B --> C[Perception<br/>ui_semantics.py]
B --> D[Action<br/>native_input.py]
B --> E[Learning<br/>probe_engine.py]
C --> F[(one hierarchy dump)]
D --> G["/data/local/tmp/pfdaemon<br/>uid 0 · /dev/input/event7"]
E --> H[(control_memory.json)]
F --> I[Android device]
G --> I
H --> CWhy this exists
Every agent that touches Android hits the same wall, and it is not a latency wall. It is an information wall.
We audited how much the operating system actually tells a controller, across five real apps — 889 hierarchy nodes, every app foreground-verified before dumping:
app | tappable nodes | named by the OS | bare |
launcher ( | 15 | 93.3 % | 6.7 % |
notes ( | 7 | 100 % | 0 % |
browser ( | 24 | 41.7 % | 58.3 % |
settings ( | 14 | 21.4 % | 78.6 % |
taobao ( | 44 | 25.0 % | 75.0 % |
WeChat ( | 0 | — | 100 % |
Only 43.3 % of tappable controls carry any OS label. 56.7 % carry none.
WeChat reports 44 hierarchy nodes with zero
clickable="true". It draws custom views and handles touch inonTouchEventwithout ever callingsetClickable(true). Any agent that enumerates controls by theclickableflag sees WeChat as an empty screen — and reports it confidently.Six richer accessibility fields never reach the dump on this ROM:
tooltip-text,state-description,pane-title,actions/action-list,input-type,important-for-accessibility.hintappeared twice in 889 nodes.dumpsys activity topyields no view ids and no text on this ROM (verified:mID=,mText,android:textall zero lines).
An agent built on "screenshot → guess → tap" is therefore guessing on more than half the screen. This server takes the three positions that remain available: read what the OS did say, watch what a control actually does, and say "unknown" when it is unknown.
Related MCP server: MobileMCP
What it costs
Measured through the real tool paths on a Xiaomi 2210132C (HyperOS 3.0.310, Android 16 / SDK 36, 1080×2400, KernelSU).
operation | before | after |
tap | 95–114 ms ( | 40.8 ms |
swipe (300 ms gesture) | 664 ms | 310.9 ms — 300 ms gesture + 11 ms overhead |
key event | 75–114 ms | 16.5–41 ms |
5-step workflow, no UI return | 663 ms | 215.9 ms |
5-step workflow with UI return | 1028 ms | 597.4 ms |
| — | 231 ms |
full hierarchy snapshot | — | ~330 ms |
| 1895 ms | raw path 615 ms, host decode 0.00 ms |
The "before" column is the ordinary path: adb shell input tap starts a JVM on every single call. The "after" column comes from a resident daemon that writes packed input_event structs straight to the touchscreen node.
Architecture
1. Perception — src/ui_semantics.py
One hierarchy dump becomes typed, addressable controls:
field | meaning |
|
|
| best human name, and where it came from: |
| only capabilities the OS actually reported for that node |
| stable identity — contains no coordinates: |
|
|
|
|
interactive_mode="inferred" recovers the controls the clickable flag loses — the WeChat case — while excluding full-viewport containers and sub-pixel dots. Inferred candidates are marked needs_probe and confidence-capped, so a caller can always tell a system fact from a deduction.
Cost: 51.1 ms for 2000 nodes, deterministic to the byte across runs.
2. Action — src/native_input.py + native/pfdaemon
A resident root daemon (app_process, uid 0, setsid) writes packed input_event bursts to /dev/input/event7. ABS maxima are read from the hardware at startup (maxX=14399, maxY=31999, 13.333× scale) — not hardcoded. Fallback chain: injectInputEvent (binds as UID 2000, no root needed) → uiautomator2 → adb input.
The agent-facing verb returns the interaction and its consequence in one round trip:
act(action="tap", selector={"semantic_key": "com.miui.home|button|天气"})
# -> {"success": true,
# "effect": "opened a different screen (activity changed to ...)",
# "snapshot_id": "...", "current_package": "..."}Observation reuses the snapshot already cached from the caller's last look, so reporting what changed costs one capture, not two. There is no separate "now perceive again" step to forget.
3. Learning — src/probe_engine.py + src/control_memory.py
This is the answer to the 56.7 %. For a control the OS refuses to name, the server does what a person does: it touches the thing once and remembers.
Pick the highest-value unknown control on screen (unlabeled, not yet learned, content and bottom bars before system chrome).
Refuse anything destructive or financial — 删除 / 支付 / 退出登录 / uninstall / password fields — and record the refusal rather than pressing.
Tap it, diff the screen, persist the observed effect per
(package, activity, control identity).Later
ui_describecalls surface it aslearned_effect.
diff_screens classifies navigation / dialog_appeared / dialog_dismissed / scrolled / selection_changed / content_changed / no_visual_change. Any node added or removed is always reported, so no_visual_change strictly means nothing detectable differs — and it is never treated as proof that a control is inert.
Cost: 9.45 ms diffing 2000 × 2000 nodes.
Quick start
Requirements
adbonPATH(orADB_PATHpointing at it)A rooted device — KernelSU or Magisk. Root is a design requirement, not a convenience.
Python 3.10+ (developed and measured on 3.12)
Android SDK build-tools (
d8+android.jar) — only to build the native daemon
Install
git clone https://github.com/<you>/android-root-mcp.git
cd android-root-mcp
python -m pip install -e .
.\install.ps1 # optional helper: checks adb, root, python, SDKStart the native input daemon
# build, push, and start as root; prints the pidfile and the forwarded port
python native\run.py start
python native\verify.py ping # -> uid 0, route "devnode", touch /dev/input/event7If you skip this step the server still works — every gesture falls back to uiautomator2 and adb input — it is simply slower. Speed is the only thing you lose.
Point your MCP client at it
{
"mcpServers": {
"android-root": {
"command": "android-root-mcp",
"args": []
}
}
}pip install -e . puts that console script on your PATH. If your client cannot launch a
console script, point it at your checkout instead:
{
"mcpServers": {
"android-root": {
"command": "python",
"args": ["/absolute/path/to/your/checkout/src/server.py"]
}
}
}Two environment variables are optional and only needed when the defaults do not fit:
ADB_PATH (when adb is not on PATH) and ANDROID_MCP_STATE_DIR (defaults to
~/.android-root-mcp).
First three calls
Perceive. Ask the OS what is on screen. This is the call that replaces screenshots.
{"name": "ui_describe", "arguments": {"max_controls": 40}}Returns a one-line summary, an ordered control list carrying role / label / actions / semantic_key / interactive_source, the screen structure (top bar, ordered bottom-nav labels, dialogs, scroll containers, primary action), and a coverage block telling you how much the OS actually named.
Act. Address a control by identity, not by pixel. The response tells you what happened.
{"name": "act", "arguments": {
"action": "tap",
"selector": {"semantic_key": "com.miui.home|button|天气"}
}}{ "success": true,
"effect": "opened a different screen (activity changed to ...)",
"effect_detail": { "classification": "navigation" },
"snapshot_id": "…", "current_package": "…" }Learn. Teach it the controls the OS will not name.
{"name": "learn", "arguments": {"budget": 2}}{ "success": true,
"rounds": [
{ "label": "天气",
"effect": "opened a different screen (activity changed to ...)",
"kind": "navigation" }
],
"memory": { "screens": 1, "controls": 1 } }Those learned effects are annotations on the next ui_describe — the same screen, now partly understood.
How this differs
screenshot + OCR + blind tap |
| android-root-mcp | |
How a control is identified | pixels | accessibility text | OS-reported role, label with provenance, stable |
When the OS has no label | OCR guess, often wrong | reports nothing |
|
Apps that never set | works, slowly | sees an empty screen |
|
Latency per tap | 1–2 s round trip | ~95–114 ms | 40.8 ms |
What a new screen costs | a screenshot into context | ~330 ms dump | one dump, typed, delta-addressable |
Persistent knowledge | none | none | per-app control memory on disk |
Fabrication | whatever the model infers | none | none — unlabeled stays unlabeled |
The distinction that matters: this server will tell you "I don't know what this control is, here is where it is, and here is what happened when I tapped it." That is more useful than a confident hallucination, and it is the only honest answer available for 56.7 % of real controls.
Safety design
No OCR, no template matching, no vision. Ever. Every semantic claim traces to a system-reported attribute or an observed consequence.
Nothing is fabricated. A control with no name gets
label: "". There is no "unknown button 3".Provenance is mandatory.
label_sourceandinteractive_sourcelet any caller separate a system fact from an inference, per field, per control.learnrefuses dangerous targets — delete, pay, log out, uninstall, password fields — and records the refusal instead of pressing. Absence of aclickableflag is never grounds for refusal; that is the condition it exists to resolve.Learned effects are observations, not claims — stored with
observed_atand the before/after snapshot ids they were derived from.
Honest limitations
These are real and you should read them before adopting this.
Unicode text does not go through the native daemon. HyperOS rejects key injection via
injectInputEvent, the touchscreen node carries no keyboard usage codes, and there is no root clipboard CLI on this ROM. Text uses uiautomator2set_text. Gestures are native; typing is not.Controls without a
semantic_keyuse a position-anchored geometric identity (~43 px bucket). A list scrolled further than that will re-learn the row. Keying on document order instead would survive scrolling but mis-attribute after any insertion — re-learning is the safer failure. Controls that do carry asemantic_keyare unaffected.Rotation other than 0 is implemented but unverified on this device.
A planned LSPosed module is designed but not built. It would read the live
Viewobject (including whether anOnClickListeneris attached) — the only route to naming controls that are invisible to both the accessibility dump and behavioural probing. Not shipped.The persistent adb-shell accelerator was measured slower than plain adb on this host (106 ms vs 66 ms per command) and is therefore gated off by default:
ANDROID_MCP_FASTPATH=1to enable.Root is required by design. This is not a sandboxed or user-consent automation tool.
Repository layout
path | contents |
| FastMCP entry point, tool registration, single-flight lock |
| perception layer: roles, labels, provenance, |
| snapshot cache, selector resolution, gestures, |
| client for the resident input daemon |
| screen diffing, probe selection, safety guard |
| persistent per-app control knowledge, atomic and bounded |
| the single adb subprocess primitive |
| live controller: transport, device selection, u2 session |
| root file / XML / SQLite / archive operations |
| app lifecycle, intents, permissions, settings |
| the input daemon ( |
| daemon lifecycle and the verification harness |
| binder bridge experiment (launch/focus/settings without JVM spawn) — not wired in |
|
|
| pytest suites: transport, automation, data, settings, MCP, stdio |
| full architecture write-up with the measurements |
| generated schema for all tools |
| install helpers and packaging |
Roughly 57 MCP tools across perception, action, workflows, app control, root data access, and device diagnostics.
Scope
This project automates devices you own and control. It requires root and it injects input at the kernel input-node level; treat it with the same care as any other privileged automation, and do not point it at hardware you are not authorised to operate.
中文简介
android-root-mcp 是一个 MCP 服务器,让 AI 真正"会用手机":不是截图、OCR、盲点坐标,而是读系统上报的控件,再靠动手观察学会系统不肯命名的那些。
要解决的问题
在一个 889 个节点、5 个真实 App 的实测里(每个 App 都先确认在前台):
App | 可点节点 | 系统给出名字 | 无名 |
桌面(com.miui.home) | 15 | 93.3 % | 6.7 % |
便签(com.miui.notes) | 7 | 100 % | 0 % |
夸克(com.quark.browser) | 24 | 41.7 % | 58.3 % |
设置(com.android.settings) | 14 | 21.4 % | 78.6 % |
淘宝 | 44 | 25.0 % | 75.0 % |
微信 | 0 | — | 100 % |
只有 43.3 % 的可点控件带系统标签,56.7 % 什么都没有。
微信 44 个节点里
clickable="true"是零——它自绘 View、在onTouchEvent里处理触摸,从不setClickable(true)。任何靠 clickable 标志枚举控件的方案,都会把微信报成一块空屏。这台 ROM 上还有 6 个富字段根本进不了 dump:
tooltip-text、state-description、pane-title、actions/action-list、input-type、important-for-accessibility。hint在 889 个节点里只出现两次。dumpsys activity top在这台机器上拿不到任何 view id 和文本(mID=、mText、android:text全为 0 行)。
所以本项目的立场只有三条:系统说了就照抄,能动手就观察,不知道就说不知道。
实测性能
操作 | 改造前 | 改造后 |
点击 | 95–114 ms | 40.8 ms |
滑动(300 ms 手势) | 664 ms | 310.9 ms(手势 300 + 开销 11) |
按键 | 75–114 ms | 16.5–41 ms |
5 步流水线(不返 UI) | 663 ms | 215.9 ms |
5 步流水线(返 UI) | 1028 ms | 597.4 ms |
一次 | — | 231 ms |
一次完整层级快照 | — | ~330 ms |
| 1895 ms | 原始路径 615 ms |
提速来源是一个常驻 root daemon:直接往 /dev/input/event7 写打包的 input_event,不再每次调用都启动一个 input 进程的 JVM。ABS 上限从硬件读(maxX=14399、maxY=31999,13.333 倍缩放),没有硬编码。回退链依次是 injectInputEvent(免 root,UID 2000)→ uiautomator2 → adb input。
三层结构
感知 —— 一次 dump 变成有类型的控件:
role、带来源标注的label(text/desc/hint/resource_name)、actions、不含坐标的稳定身份semantic_key、region,以及标明"这是系统说的还是我推的"的interactive_source。2000 个节点 51.1 ms。行动 ——
act()一次往返就同时返回"做了什么"和"结果是什么",观察复用上一帧缓存,只多花一次截图。学习 ——
learn()专门对付系统不肯命名的控件:挑最该学的一个,危险词(删除/支付/退出登录/卸载/密码框)直接拒绝并记录,点它、比对前后、按(包名, Activity, 控件身份)落盘。下次ui_describe就以learned_effect带出来。2000×2000 节点比对 9.45 ms。
安全与边界
不做 OCR、不做模板匹配、不做视觉猜测;没有名字的控件 label 就是空字符串,绝不编造;每个字段都带来源标注;学习过程拒绝破坏性和支付类控件。已知短板也写在文档里:中文输入走不了原生 daemon(HyperOS 拒绝按键注入),无 semantic_key 的控件身份依赖位置(滚动超过约 43 px 会重新学),非 0 旋转未验证,LSPosed 模块只做了设计。
需要 root,面向你自己拥有并有权操作的设备。
MIT licensed. Architecture details and every measurement: docs/ADAPTIVE-SEMANTICS.md.
Available Tools
57 toolsactA
One human-shaped verb: perform an interaction AND report what changed, in a single round trip. action = tap/long_click/double_click/set_text/append_text/clear/check/uncheck/read/scroll/key. Target a control with selector (supports role, label_contains, semantic_key, text, resource_id - semantic addressing needs no coordinates) or pass x/y. Returns effect, a plain sentence describing what actually happened (navigation, dialog appeared, list scrolled, no visible change) plus the new snapshot_id, so you do NOT need a follow-up perceive call. Set observe=false for tight loops where you will observe later yourself.
Inputs: x, y, value, action, +5 more. Returns: object
adb_commandB
Raw selected-device ADB command escape hatch (e.g. bugreport, jdwp, shell am instrument). Arguments passed directly to native adb, no host shell. Prefer typed tools for timeouts and validation.
Inputs: args (required), timeout, max_output_bytes. Returns: object
agent_profileB
Apply/list/restore an Agent speed profile. Saves exact original animation/stay-awake values BEFORE changes and restores them (including absent keys) by profile_id on the same device.
Inputs: action, profile_id, stay_awake, zero_animation. Returns: object
app_actionC
List/info/paths/launch/stop/restart/clear/enable/disable/uninstall apps; install/install_multiple local APKs (base+splits), explicit downgrade/test/permission switches. clear/uninstall remove user data.
Inputs: action, package, user_id, activity, +5 more. Returns: object
app_data_archiveA
Backup/restore one app's CE or DE private data as tar+SHA256 manifest. Stops app. Restore validates member paths/manifest, keeps pre-restore data backup, restores UID/SELinux; replaces data, leaves app stopped. Keystore/TEE/external storage excluded.
Inputs: action (required), package (required), local_path (required), storage, +1 more. Returns: object
app_permissionsB
Inspect/grant/revoke permissions or set a named appop. grant_runtime_all intersects declared permissions with device dangerous-runtime list and reports failures individually; does not silently enable all special privileges.
Inputs: package (required), mode, action, user_id, +1 more. Returns: object
batch_ui_actionsA
【王牌去人机感工具】单次调用连续执行多步手机操作流水线! 当能够预判接下来的 2~6 步操作时(例如:启动应用 -> 等待首页 -> 点击搜索框 -> 输入关键词 -> 按回车), 必须使用本工具一次性下发,彻底告别『点一下停几秒等下一轮』的卡顿体验! 若中途某一步失败,会自动中断并返回当前停留页面的 UI 树供纠错。
Inputs: steps (required), return_ui_after. Returns: result
compare_screenshotB
Pixel regression check against a local baseline PNG/JPEG. Captures one frame, compares dimensions/changed-pixel ratio/bounds, optionally saves current/diff; useful for Canvas UI verification.
Inputs: baseline_path (required), max_width, threshold, save_diff_path, +1 more. Returns: object
content_providerA
Direct zero-UI ContentProvider query/insert/update/delete/call/gettype with typed bindings. update/delete require explicit where ('1' intentionally means all rows). ROM/provider authorization still applies.
Inputs: arg, uri, root, sort, +7 more. Returns: object
deploy_and_verify_apkA
【Android / LSPosed 开发一键联调闭环】 单次调用自动完成:
安装本地 APK (
adb install -r -d)记录日志起始时间,保留全局 Logcat 缓冲池
强杀并冷启动目标宿主应用 (
am force-stop+ 启动)等待页面渲染与 Hook 注入
自动汇总返回:是否有 Crash 堆栈 + 目标应用 Logcat + LSPosed 模块最新日志 + 当前屏幕 UI 控件树!
Inputs: apk_path (required), target_package (required), log_keyword, wait_seconds, +1 more. Returns: result
device_connectionC
List/select ADB devices or connect/disconnect/pair host:port. Selection clears UI indices; no arbitrary default when multiple devices are attached.
Inputs: action, serial, address, pairing_code. Returns: object
device_controlB
Control wifi/bluetooth/mobile_data/airplane_mode, brightness, rotation, screen_size, density, volume, wake/sleep/dismiss_keyguard, notifications/quick_settings/collapse_panels, reboot/recovery/bootloader/shutdown. ROM support varies. Reboot/network changes may disconnect ADB.
Inputs: action (required), root, value. Returns: object
device_diagnosticsB
Collect summary/memory/cpu/graphics/network/crashes/activity/services/power or bundle. Executes probes in one ADB session; optional persistent host report directory for regression evidence.
Inputs: kind, package, output_dir. Returns: object
device_doctorA
Probe actual Root UID, ROM/SDK, installed command/dependency capabilities. initialize_u2 starts the UIAutomator2 helper and resets a failed connection.
Inputs: initialize_u2. Returns: object
device_filesA
Root file manager: list/stat/read/write/append/hash/mkdir/chmod/copy/move/delete. Text or base64, atomic replacement, preserve existing ownership/mode, backup by default, optional compare-and-swap SHA256. Use transfer for large files/trees.
Inputs: path (required), action (required), mode, root, +7 more. Returns: object
device_jobB
Background device processes: list/start/status/output/cancel/cleanup. Use for logcat, instrumentation, perfetto, tcpdump if installed. Persistent handles, bounded stdout/stderr, incremental byte offsets and PID-reuse checks. timeout=0 explicitly allows indefinite work.
Inputs: root, label, limit, action, +7 more. Returns: object
element_actionA
Act on exactly one matching element: tap/long_click/double_click/set_text/append_text/clear/check/uncheck/read. Ambiguous/stale/disabled targets fail explicitly. Returns a compact ack, not a tree: set return_ui=true only when the next step needs the whole page, otherwise observe with ui_snapshot(since_snapshot_id=...) and pay only for the delta.
Inputs: selector (required), value, action, timeout, +3 more. Returns: object
export_apksA
Export an installed app's base APK and ALL split APKs to a host directory for development/testing.
Inputs: package (required), output_dir (required). Returns: object
file_transfer_rootB
【Root 级跨端文件推拉】利用 /data/local/tmp 中转与 Root 提权,支持直接拉取或替换 /data/data/、/data/adb/ 等任意私有目录文件。
Inputs: action (required), local_path (required), device_path (required), file_mode. Returns: result
fill_formA
Fill several fields (including Chinese/Emoji) and optionally submit in one tool call. Stops at the first failed field. One tree dump total, not one per field.
Inputs: fields (required), submit, return_ui. Returns: object
find_elementsA
Query UI with AND-combined text/id/class/package/state/region predicates, regex and explicit nth. Does not click; returns all matches plus snapshot_id.
Inputs: selector (required), max_results. Returns: object
get_device_statusA
获取当前连接的 Android 设备状态:设备型号、Android/SDK 版本、实际 Root UID、 当前前台包名与 Activity、屏幕分辨率及 UIAutomator2 可提供的亮屏状态。
Inputs: no named parameters. Returns: result
get_ui_treeA
【核心感知工具 - 替代慢速截图】通过高速 RPC 提取当前屏幕的语义化 UI 控件树。
返回每个元素的 [#index] 编号、类名、文本 (text)、描述 (desc)、id、中心坐标与可交互标志 (flags)。
后续可直接调用 tap_element(index=N) 或 tap_element(text="...") 精准操作!
Inputs: keyword, max_elements, only_interactive. Returns: result
input_textA
极速中文/Unicode 文本输入工具。 可一步完成『聚焦输入框 -> 清空旧内容 -> 注入中文字符串 -> 按回车提交 -> 返回新界面 UI 树』,并自动保护系统原输入法不被篡改。
Inputs: text (required), index, clear_first, press_enter, +3 more. Returns: result
inspect_app_dataA
【零界面数据穿透工具】直接通过 Root 读取或查询 /data/data/<package>/ 下的 SharedPreferences 配置与 SQLite 数据库!
无需打开应用界面,直接核查开关状态、缓存数据与内部表记录。
Inputs: package (required), mode, pref_key, sql_query, +1 more. Returns: result
inspect_lsposedA
【LSPosed / Xposed / KernelSU 专属调试工具】
直接通过 Root 读取 /data/adb/lspd/log/modules_*.log 最新模块日志与已安装的 KernelSU/Zygisk 模块列表,
快速验证 Hook 是否生效、是否有 StackOverflowError / ClassNotFoundException 等异常!
Inputs: lines, keyword, include_verbose. Returns: result
inspect_view_hierarchyA
【仅用于已知能吐出 View 树的 ROM】通过 dumpsys activity top 取 Activity/Task 记录。
注意:本机 HyperOS(Android 16)实测该命令不返回任何 View 层级——mID=、mText、
android:text 均为 0 行,微信整份输出只有 776 字节。所以在该机型上它拿不到控件信息,
需要理解界面请直接用 ui_describe(OS 语义,非 OCR)。
在确实支持 AOSP 式 dumpsys activity top 的 ROM 上,本工具可能额外给出:
真实的自定义 View 类名;2. 16 进制资源 ID 锚点;3. 被隐藏的 GONE/INVISIBLE 节点。
Inputs: keyword, max_lines, visibility_filter. Returns: result
learnA
Teach the agent what an app's unnamed controls DO, by probing and remembering. Many apps expose no label for their buttons (measured: 56.7% of tappable controls carry no text/description/id, and some apps report no clickable flag at all), so the only honest way to learn them is to act and observe. This taps one unknown control at a time, diffs the screen before/after, and persists the observed effect (opened a screen / dialog appeared / list scrolled / no visible change) under the current app+activity. Destructive and financial controls (delete, pay, logout, uninstall, password fields) are refused and recorded as refused, never pressed. Results appear as learned_effect on later ui_describe calls, so the agent stops guessing. budget = how many controls to probe this call (1-5).
Inputs: budget, settle_ms, allow_restore. Returns: object
manage_appC
应用生命周期与权限管理工具(信息、停止、重启、清空数据、逐项尝试授予运行时权限)。
Inputs: package (required), action. Returns: result
optimize_device_for_agentB
【设备极速模式调优】一键将手机调校为最适合 AI Agent 高速操控与调试的状态:
关闭系统窗口与过渡动画 (
animation_scale = 0),消除页面切换等待时间开启连接电源时屏幕常亮 (
stay_on_while_plugged_in)自动唤醒屏幕并滑开锁屏层 (
wm dismiss-keyguard)
Inputs: zero_animation, wake_and_unlock, stay_awake_while_plugged. Returns: result
perform_gestureC
Perform a multi-point swipe path or pinch_in/pinch_out gesture through uiautomator2, avoiding repeated tap/swipe tool round trips.
Inputs: action (required), points, percent, duration, +1 more. Returns: object
port_forwardB
ADB forward/reverse list/add/remove for tcp/localabstract/localfilesystem/jdwp endpoints. tcp:0 allocates a port. No host shell; no-rebind avoids replacing another debugger's mapping.
Inputs: local, action, remote, reverse. Returns: object
press_keyC
发送系统物理/虚拟按键(返回、主页、多任务、回车、电源唤醒等),并自动返回最新界面结构。
Inputs: key, wait_after_ms, return_ui_after. Returns: result
query_system_providerB
【后台零界面取证工具】无需下拉通知栏或打开短信 App,直接通过 Root 提取通知栏消息、短信验证码或读写系统剪贴板。
Inputs: source, value_or_uri. Returns: result
read_logcat_smartB
【智能 Logcat 诊断工具】支持按包名自动绑定进程 PID、一键提取闪退堆栈 (crash_only=True)、按 Tag 或关键词精准过滤日志。
Inputs: tag, level, lines, package, +3 more. Returns: result
record_screenA
Background MP4 recording: start/status/stop/pull. Start immediately returns job_id; stop sends SIGINT for MP4 finalization, pull after completion. ROM screenrecord limits apply.
Inputs: action, job_id, seconds, bit_rate, +1 more. Returns: object
root_shellB
【Root 上帝模式直通车】通过 su -c 在手机上执行任意 Root 特权 Shell 命令。
可执行诸如修改系统属性 (resetprop/setprop)、查看内核/挂载信息、操作 /data/ 私有目录、管理防火墙等任意底层指令。
Inputs: command (required), timeout. Returns: result
run_workflowB
Execute a fully prevalidated UI/Root workflow in ONE call: launch/tap/input/key/swipe/wait/assert/shell/if/repeat/sleep/read_text. Supports per-step postconditions, on_error, bounded loops/deadline and trace. No blind retries of non-idempotent actions.
Inputs: workflow (required). Returns: object
saved_workflowB
Persist/reuse named workflows: list/save/load/run/delete. Save validates all steps before atomic storage; works across MCP restarts.
Inputs: name, action, workflow. Returns: object
screenshot_annotatedA
【视觉兜底与界面审查工具】获取手机屏幕截图。安全图层/DRM 等限制仍可能导致空白或拒绝。
默认开启 Set-of-Mark (annotate_elements=True),在图上直接标出 [#0], [#1] 红框编号,
看图后无需猜像素坐标,直接调用 tap_element(index=编号) 即可!
注意:日常操作请优先使用 get_ui_tree,仅在 Canvas/地图渲染/游戏或视觉验证时调用本工具。
Inputs: max_width, save_path, annotate_elements.
send_intentB
Root/nonroot typed Intent: activity/broadcast/service/foreground_service/stop_service, internal components, DeepLinks, MIME/categories/flags, bool/int/long/float/string/null extras. Reports am errors even if exit code is zero.
Inputs: kind, root, wait, flags, +8 more. Returns: object
shell_batchA
Run 1..200 CLI commands in ONE ADB process/Root session. Per-command exit codes and output, optional fail-fast; avoids one subprocess/tool call per command.
Inputs: commands (required), root, timeout, stop_on_error, +1 more. Returns: object
shell_executeB
Run an arbitrary Android shell command, optionally su uid=0. Returns real exit_code/stdout/stderr/timeout/truncation. Device-side timeout when supported; never invokes a host shell.
Inputs: command (required), root, timeout, max_output_bytes. Returns: object
sqlite_databaseA
Query a private SQLite DB without a phone sqlite3 binary; copies DB+WAL+SHM, parameterized SQL, BLOB base64 and bounded rows. write=true requires package+stop_app=true; backs up sidecars and installs an atomic checkpointed DB, leaving app stopped. Live reads are best effort. SQLCipher needs its own engine/key.
Inputs: database (required), sql, write, package, +3 more. Returns: object
start_activity_rootB
【Root 页面直达工具】利用 Root 权限强行穿透拉起任意内部私有 Activity (exported=false) 或 DeepLink Scheme,
直接一步跨越繁琐的开屏广告与多级菜单跳转!
Inputs: action, extras, package, activity, +3 more. Returns: result
swipe_screenA
智能滑动与滚动查找工具。
支持四向滑动、自定义坐标拖拽,或设置 scroll_to_text="目标文字" 让工具自动滚屏寻找目标!
Inputs: x1, x2, y1, y2, +5 more. Returns: result
system_propertyA
Read Android properties or set them using setprop; resetprop=true explicitly requests the installed Root resetprop utility. Does not install/assume Magisk.
Inputs: name, value, action, resetprop. Returns: object
system_settingsA
Read/list/put/delete exact Android global/system/secure settings; returns command failure rather than claiming unsupported settings succeeded.
Inputs: key, value, action, user_id, +1 more. Returns: object
tap_elementA
智能语义点击工具。支持按 #index、text、text_contains、resource_id、description 或 (x, y) 点击。
点击即返回确认与耗时,不默认回抓整棵树——观察交给 ui_snapshot 的差异模式,节奏才跟得上手。
Inputs: x, y, text, index, +7 more. Returns: result
tool_catalogC
Discover v2 capabilities and the efficient Agent operating rules (no device connection needed).
Inputs: no named parameters. Returns: object
ui_describeA
Read the screen as CONTROLS, not pixels. Each tappable/viewable element is described from what Android itself reports - view class, resource-id name, accessibility description, supported action flags - never from OCR or vision. Returns a one-line summary, an ordered control list with role/label/actions/state, screen structure (top bar, bottom nav, dialogs, scroll containers, primary action), and a coverage line telling you how much the OS actually named. Prefer this over screenshots for understanding a screen.
Inputs: role, region, max_controls, include_containers. Returns: object
ui_queryA
Find controls by OS-derived semantics instead of coordinates or pixels. Filter by role (button/text_input/toggle/tab/nav_back/nav_close/list_item/search), by label substring, by text substring, by stable semantic_key, or by region. Returns matches with their semantic_key, which stays valid when the layout moves - use it to replay an action on the same control later without storing a tap position.
Inputs: role, region, max_results, enabled_only, +3 more. Returns: object
ui_snapshotC
Fresh semantic UI snapshot with stable document-order indices and snapshot_id. Supply since_snapshot_id for added/removed/changed nodes; compact omits the full element array.
Inputs: compact, keyword, include_xml, max_elements, +2 more. Returns: object
wait_for_conditionB
Wait for exists/gone/foreground/shell-exit-and-output/stable UI. Missing UI transport never counts as 'gone'. Replaces blind sleep calls.
Inputs: condition (required), timeout, poll_interval. Returns: object
webview_controlB
Fast WebView/Chrome control using exposed DevTools sockets: discover/pages/dom/click/fill/evaluate/navigate/close. Uses DOM/CSS instead of pixel clicks; only debuggable WebViews. evaluate/click/fill require optional websocket-client.
Inputs: css, url, value, action, +5 more. Returns: object
workflow_controlA
Inspect or cooperatively cancel an active workflow from another request. Cancellation stops subsequent steps; in-flight device/RPC calls finish or time out first.
Inputs: action, run_id. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 57 tools
Multiple clusters of near-duplicate tools exist: tap_element / act / element_action / batch_ui_actions all perform interactions; ui_snapshot / get_ui_tree / ui_describe / ui_query / find_elements / inspect_view_hierarchy all read the screen; shell_execute / root_shell / adb_command / shell_batch all run commands; shared_preferences / sqlite_database / inspect_app_data / content_provider all read app data. The surface is effectively two overlapping generations of API (v1 'classic' tools plus a 'v2' agent toolkit announced by tool_catalog), so an agent must guess which of several plausible tools to use.
Most names are snake_case, but the conventions vary widely: verb_noun (get_ui_tree, run_workflow, send_intent), noun_verb (device_control, app_action, device_files, record_screen), bare verbs (act, learn), and noun-only names (tool_catalog, saved_workflow, adb_command). Individually readable, but there is no predictable pattern an agent can rely on to infer a tool's name.
57 tools is far past the 3-15 sweet spot, and much of the bulk is duplicated capability across v1 and v2 layers rather than genuinely distinct functionality. The Android-automation domain is broad enough to justify a large surface, but the overlap makes the set feel accumulated rather than curated.
Coverage is unusually thorough: UI perception and interaction, gestures, forms, workflows with persistence and cancellation, root and non-root shell, background jobs, file management and transfer, app lifecycle/permissions/APK export, intents, WebView control, screen recording, pixel regression, logcat triage, and LSPosed/KernelSU debugging. Almost every lifecycle stage has an entry point, with no obvious dead ends.
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
AI agents on your own iPhone or Android: run tasks in real apps, read the screen, tap and type.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Related MCP Servers
- AlicenseBqualityAmaintenanceA lightweight bridge enabling AI agents to perform real-world tasks on Android devices such as app navigation, UI interaction, and automated QA testing without requiring computer-vision pipelines or preprogrammed scripts.141,067 PyPI940MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to operate a real Android phone through its accessibility service, exposing screen trees with stable refs, taps, typing, gestures, notifications, apps, and other device controls.5MIT
- AlicenseNot gradedqualityAmaintenanceLets AI agents see and use a real Android phone over Wi-Fi: read the screen, find elements by text or ID, tap, type, swipe, take screenshots and read notifications, without ADB or root.552MIT
- AlicenseAqualityBmaintenanceEnables AI agents to see and drive a real Android phone over plain ADB: screenshots and numbered UI trees, gestures, typing with accents and emoji, SMS/RCS reading and prepared replies, notifications, files, and settings, with no root and no app installed on the phone. Safeguards mask security codes and require explicit confirmation before sending, paying, deleting or confirming anything.182MIT