Skip to content

Releases

v0.1.1

Choose a tag to compare

@Draklyfg Draklyfg released this 05 Dec 07:40

[0.1.1] - 2026-12-05

Fixed

  • input_text now types percent signs correctly. Verified against the
    AOSP Input.java sendText source: it rewrites only the exact
    sequence %s into a space; a % followed by anything else (or at
    the end of the string) passes through unchanged, and %% is not
    an escape. The old encoder doubled every %, so 100% was typed as
    100%%, 50%sale came out as 50% ale, and a URL such as
    https://example.com/a%20b gained a spurious percent. Percent signs
    are now sent as-is, spaces still go through %s, and a literal %s
    in the user's text is split across two input text calls (between
    the % and the s) so it is typed literally instead of becoming a
    space. Control characters (newlines, tabs, ...) are now rejected
    with an explanation, since input text has no encoding for them.
  • dump_ui_tree race: every call shared the remote file
    /sdcard/window_dump.xml, so concurrent dumps could overwrite or
    delete each other's output (the first caller could get an empty or
    foreign hierarchy). Each call now uses a unique remote filename
    (pid + counter + random token), removes only its own file, and a
    cleanup failure can no longer mask the dump result.
  • The output cap is now enforced while output streams in, not after
    the fact. Both pipes are drained concurrently under a hard byte
    limit and the process is stopped as soon as a stream exceeds it;
    previously the whole output was buffered first, so a runaway
    command could consume unbounded memory before the 4 MiB cap was
    applied (a one-second stdout flood grew the server process to
    roughly 1 GB). Normal outputs are byte-for-byte unchanged, and
    timeouts behave as before.
  • screenshot now validates that the capture is a complete PNG: the
    full PNG signature and the final IEND chunk are both required, so a
    truncated capture is reported as an error instead of being returned
    as an image. Screenshots get their own larger capture limit
    (32 MiB), and binary exec-out output in general now raises when it
    exceeds its limit instead of silently returning partial data.
  • Over-limit output is no longer returned as success through the text
    and binary paths. The streaming cap already flagged the stream that
    overflowed, but _run_text ignored the flags and exec_out checked
    only stdout — so a command whose stderr overflowed (including one
    that also exited non-zero behind the cap) came back with partial
    output as if it had succeeded, and an exec-out capture could
    return partial binary when only its stderr had flooded. Both paths
    now raise a clear error naming the stream that overflowed and the
    limit, whichever stream it was. Normal commands and screenshots are
    byte-for-byte unchanged.

v0.1.0

Choose a tag to compare

@Draklyfg Draklyfg released this 05 Dec 04:38

[0.1.0] - 2026-12-05

Initial release.

Added

  • MCP server over stdio, built on the official mcp Python SDK. Runs as
    the android-mcp console script or python -m android_mcp.
  • Device tools: list_devices and get_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
    the adb binary is missing.
  • Screen tools: screenshot returns the current screen as a PNG image;
    dump_ui_tree renders 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),
    and input_text with shell metacharacters escaped, spaces encoded as
    %s, and newlines rejected.
  • App tools: launch_app, list_packages (optionally third-party only),
    install_apk, and uninstall_package. Package names are validated
    before they reach the device.
  • logcat returning the last 1–1000 lines, with an optional substring
    filter.
  • shell_readonly, a deliberately small read-only command surface. The
    allowlist is getprop [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
    adb executable, including an end-to-end test that spawns the server
    over stdio and drives it with a real MCP client.