Repository navigation
v0.1.0
[0.1.0] - 2026-12-05
Initial release.
Added
- MCP server over stdio, built on the official
mcpPython SDK. Runs as
theandroid-mcpconsole script orpython -m android_mcp. - Device tools:
list_devicesandget_device_info(model, manufacturer,
Android version, SDK level, build id, battery level).list_devices
returns an empty list with an explanatory error instead of crashing when
theadbbinary is missing. - Screen tools:
screenshotreturns the current screen as a PNG image;
dump_ui_treerenders the uiautomator hierarchy as a compact text tree
with short class and resource-id names, bounds, and flags such as
[clickable]and[disabled], capped at 500 nodes. - Input tools:
tap,swipe,press_key(by name or numeric keycode),
andinput_textwith shell metacharacters escaped, spaces encoded as
%s, and newlines rejected. - App tools:
launch_app,list_packages(optionally third-party only),
install_apk, anduninstall_package. Package names are validated
before they reach the device. logcatreturning the last 1–1000 lines, with an optional substring
filter.shell_readonly, a deliberately small read-only command surface. The
allowlist isgetprop [name],dumpsys battery,df [path], and
ps [-A|-e]; every token is character-checked and anything else is
rejected before it reaches the device.- ADB wrapper that only ever builds argument lists, never shell strings.
Every call has a timeout (30 s by default, 60 s for screenshots and
logcat, 180 s for installs) and captured output is capped at 4 MiB.
When more than one usable device is attached, an explicit serial is
required so a command can never land on the wrong device. - Test suite (52 tests) that runs without a real device against a fake
adbexecutable, including an end-to-end test that spawns the server
over stdio and drives it with a real MCP client.