r/coolgithubprojects • u/tilt2k • 1d ago
mobile-agent: a Rust daemon, CLI and MCP server that lets AI agents drive iOS Simulators, iPhones and Android devices, built around performance
https://github.com/gesposito/mobile-agentI built mobile-agent because agents driving phones spend most of their time waiting: every tap is followed by a fresh read of the device and a sleep "to let it settle".
mobile-agent keeps a live mirror of each attached screen (windows, accessibility tree, latest frame), updated from the platform's change events and frame callbacks, so snapshots, waits and settle checks are answered from the mirror instead of polling the device.
- Android: a single-dex agent pushed over adb runs under `app_process` as the shell user. No APK is installed and no instrumentation runs. On the emulator it uses the gRPC controller when that answers.
- iOS Simulator: everything runs from the host, with no XCTest runner and nothing installed. Input goes through the Simulator's HID service, frames come from the display's IOSurface, and the accessibility tree comes from a small Rust reader.
- Physical iPhones (USB): a Rust XCTest runner serves the tree, and the rest goes over a CoreDevice tunnel opened in-process, without root.
- Interface: the CLI follows agent-browser's grammar (`snapshot`, `click u/e3`, `fill`, `wait`), so agent prompts written for browsers carry over. The MCP server exposes the same tools to Claude Code, Codex, Cursor and others.
Try it with Claude Code:
claude mcp add --transport stdio mobile-agent -- npx -y --package=@mobileagent/cli@alpha mobile-agent-mcp
1
u/kantorcodes1 1d ago
Question on the MCP side: snapshot and wait read from the mirror, while click and fill act on a real device. Once an MCP client connects, does it get every tool, or can you hand a client the read tools only and keep click and fill off? A phone is a lot of surface to leave open by default.