
Pilotdroid
io.github.mofanxPublished by GitHub account mofanxv0.6.1.post1Updated Nov 22, 2026
Android UI automation device agent: 27 MCP tools — tap/swipe/selector/watcher/stream
Overview
Pilotdroid's local MCP server; no sign-in required; STDIO.
No AI overview yet: these facts come from the registry entry and the server itself.
Installation
In SourceWeft
- Open Pilotdroid in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
pilotdroid
English: a device-side Android automation stack — persistent binary protocol + on-device batch execution, built to break uiautomator2's per-call HTTP/JSON-RPC round-trip ceiling. Three surfaces over one device backend:
pilotdroid-cli(one-shot ops + stdio MCP server, 27 tools), a Rust facade (pilotdroid-agent), and a uiautomator2 drop-in Python shim (from pilotdroid import u2shim; xpath explicitly out of scope). Same-script wall-clock vs real u2 on retail devices: 8.8× USB / 4.7–7.4× adb-TCP (op-mix sensitive,spike/e2e/RESULTS-M7.md). Details in Chinese below; protocol contract:docs/02-protocol.md.
用 Rust 独立开发的 Android 自动化控制库 / CLI。借鉴 uiautomator2-rs 与 scrcpy 的工程思路,但不照抄其架构——核心目标是通过自研持久二进制协议 + 设备端批量执行,突破「每条指令一次 HTTP/JSON-RPC 往返」的性能天花板(u2 实测 click ~263ms、exists ~26ms、screenshot ~186ms),拿到数量级的延迟改善。
Demo — live frame stream
[live-view: real device frames at ~6fps]
Captured from python3 spike/e2e/live-view.py <serial> (MJPEG → browser)
on a retail device — swipes injected mid-stream. The same frames are
exposed to MCP clients via stream_read.
安装
-
预编译 CLI(推荐):从 Releases 按平台下载,
chmod +x入 PATH:macOS 注意:Release 二进制未签名,浏览器下载后首次运行会被 Gatekeeper 拦截——先执行
xattr -d com.apple.quarantine pilotdroid-cli再运行(或直接用下方 Homebrew 安装,无此问题)。Windows 注意:
.exe未签名,首次运行会被 SmartScreen 拦截—— 点"更多信息 → 仍要运行";命令行下载的可用 PowerShellUnblock-File pilotdroid-cli-windows-x86_64.exe解除标记。 该产物为 compile-verified only:CI 构建通过但尚未在 Windows 实机跑过,如遇运行问题请提 issue。 -
Homebrew(macOS):
CLI 已内嵌 agent.jar,一条命令完成部署+八步自检,无需
--jar: -
源码构建:
cargo install --locked --path crates/pilotdroid-cli(Rust 1.74+)。 -
Python u2 shim:
pip install pilotdroid(v0.6.1 publish 后生效; 此前用 git 安装pip install "git+https://github.com/mofanx/pilotdroid#subdirectory=python")仓库内可用
pip install ./python;随后from pilotdroid import u2shim。 -
agent.jar 亦可单独取用:Release assets 或仓库
agent/agent.jar(与 CLI 内嵌字节一致)。
定位
- 协议与架构自主:ADB client 层 vendor 成熟实现(
adb_client等,Apache/MIT),差异化投入集中在设备端 agent 与 RPC 协议层。 - 设备端 agent:Java dex 为能力主体(实测裁决:
app_process+InputManagerGlobal注入 p50≈3ms、30/30 成功;/dev/input写在 Enforcing 下被 SELinux 全拒)。Rust native 仅为可选监听件。 - 能力探测 + 降级链:注入(InputManagerGlobal → 隐藏 API 兜底 → UiAutomation →
input命令)、截图(resident → exec-out screencap → 帧流)均按设备能力运行时探测降级,以实测为准。
三种调用面(M5,ADR-007)
同一设备后端,三种接入形态,按调用方选:
另有 u2 兼容 shim(compat/u2shim.py,host 侧翻译层,pip install ./python
后 import pilotdroid):u2 脚本零改动跑通。
支持集(明确不暗示全覆盖):click/long_click/swipe/press/set_text/dump_hierarchy/ screenshot/app_start/app_stop/app_current/info + selector text/resourceId/ description/className/packageName/scrollable/index + d(scrollable=True).scroll.*;
仅 xpath 显式拒绝(ValueError,非目标)。M6 真实脚本对拍:23/24 op 通过,唯一
unsupported = xpath(spike/e2e/m6-compat.json);方法级矩阵见
compat/SUPPORTED.md。xpath 明确不在
supported-set 目标内(u2 xpath 本为可选插件,非 drop-in 承诺)。
MCP client 挂接(mcpServers 片段,二进制名 pilotdroid-cli,cargo install 后在 PATH):
多设备场景补 -s:"args": ["serve", "-s", "<serial>"](-s 是 serve 子命令选项)。
一设备一 client:agent 单 conn 顶替语义(ADR-007)——同一设备上第二个
serve/shim/verify 连接会顶掉前一个;被顶替方下一次 op 显式报 io error,
serve 会在下一 call 惰性重连夺权(M10 起),并在 stderr 打 conn-lost
warn(M12 起;stdout 仍只有 JSON-RPC,不污染协议流)。两个 serve
实例并存会来回夺权 ping-pong(如同时开 Cursor+Claude Desktop 指向
同一设备)——功能不丢但每次 call 多出重连延迟,请保持一设备一 serve。
经官方 python mcp SDK 与 Devin CLI 实测握手通过(spike/e2e/mcp_client_check.py
agent_e2e_transcript.txt);initialize 应答同时透出agentVer(设备 jar 版本)。
实测数据(真机,同口径)
路线图(以真机实测数据驱动)
仓库结构
详细方案见 docs/(随首次提交落盘)。
License
MIT,见 LICENSE。
Source: README.md at commit 8e865c9
Tools
0Version history
1- v0.6.1.post1LatestNov 22, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts