Skip to main content
Glama

Corral

Two coding agents. One phone. No collisions.

Corral pools every Android device on your machine — USB, WiFi, emulators — and leases each one to exactly one agent session. The second agent doesn't trample the first one's test run: it queues, or it is turned away with a message that names the holder and the two forms that work.

Two agents, one device: lease, denial, queue

Adopting Corral · Security policy and threat model · Agent skill · Apache-2.0 (LICENSE, NOTICE)

Try it without a phone

Once installed, corral demo starts a second, isolated daemon whose pool is simulated in process — no adb, no SDK, no real device or home, no gates, nothing installed. It prints the URL, and the same CLI and console point at it:

corral demo                              # 8799 unless taken; it prints the actual URL
CORRAL_URL=http://127.0.0.1:8799 corral devices
corral-ui --url http://127.0.0.1:8799

The console itself shows a persistent DEMO banner at the top of its window:

The Corral console watching the demo pool

Ctrl-C stops it and removes the demo home it made; CUTOVER.md § Demo has the flags and the cleanup rules.

Related MCP server: adb-mcp

Install (Linux, JDK 17+; Windows uses the same installer)

No clone and no Gradle: the release bundle carries both jars and the installer. Check it against the published checksum, and read the installer first — it is the same scripts/install.sh the source tree uses. You need JDK 17+ and an Android SDK with platform-tools/adb. The installer stops without usable Java, and it refuses an adb that is not the SDK's — one that only resolves from PATH, such as the distro's /usr/bin/adb — before anything is written, because it has to replace the SDK's adb with the lease-gating wrapper. With no adb at all it installs with a warning and the daemon lists no devices; corral demo needs no adb, SDK or phone.

curl -fsSLO https://github.com/ciszkin/corral/releases/download/v0.1.7/corral-0.1.7.zip
curl -fsSLO https://github.com/ciszkin/corral/releases/download/v0.1.7/corral-0.1.7.zip.sha256
sha256sum -c corral-0.1.7.zip.sha256
unzip corral-0.1.7.zip -d corral-0.1.7 && cd corral-0.1.7 && ./install.sh --ui

From a source checkout instead:

git clone https://github.com/ciszkin/corral && cd corral
./gradlew :corral-daemon:shadowJar :corral-ui:shadowJar
scripts/install.sh --ui          # --no-ui skips the console

The installer is user-scoped (no root) and idempotent: it puts the corral CLI, an adb wrapper and the corral-ui shim on ~/bin, shims the SDK's adb, drops the Gradle gate and the agent skill, and starts the daemon at login. On Windows the same installer writes corral.bat and adb-wrapper.bat to %USERPROFILE%\bin instead, with no SDK adb shim. install.sh --help lists the flags; CUTOVER.md § Windows has the Windows detail.

It ends by listing what it installed and the one line this shell needs: ~/bin has to be ahead of the Android SDK on PATH (%USERPROFILE%\bin on Windows), or adb resolves to the ungated one:

export PATH="$HOME/bin:$PATH"

The installer appends that line to ~/.bashrc/~/.zshrc when either exists, so a new shell already has it; a shell that is already open needs the line once. Then:

corral devices                   # live pool
corral doctor                    # per-layer health (not the Gradle gate — see CUTOVER.md)
corral lease --timeout 60 --type emulator -- ./gradlew connectedDebugAndroidTest
corral status                    # who holds what, and until when

Wire an agent in

claude mcp add --transport http corral http://127.0.0.1:8798/mcp

Eight tools (list_devices, queue, claim, free, renew, screenshot, start_emulator, stop_emulator), one identity per MCP session. The installer also drops the agent skill at ~/.agents/skills/corral/SKILL.md — creating ~/.agents/skills when the host has none, so a fresh machine gets it from the one command — and links ~/.claude/skills/corral at it for Claude Code, which reads ~/.claude/skills/ instead. Any harness can drive the CLI verbs directly.

Why not just ANDROID_SERIAL?

Because that only binds callers that cooperate, and agents don't. Corral decides at exec time, with three layers on POSIX: an adb wrapper on PATH, an SDK platform-tools/adb shim for absolute-path callers, and a Gradle init.d gate — AGP never runs the adb binary, so only a build-level gate can stop an install* / connected*AndroidTest. A Windows install has two of those layers (the .bat wrapper and the Gradle gate), because the SDK's adb.exe is not shimmed. Leases are FIFO-queued, TTL-bounded, pid-liveness-aware, persisted in SQLite and audited, and a denial is self-teaching rather than a mystery. The wrapper's rules live in one editable file, ~/.config/corral/rules, and a missing one fails closed. Repair is automatic: while the daemon runs it checks the SDK adb shim every 10 seconds and restores it after an SDK update, keeping the updated binary as adb.real; if the daemon was stopped at the time, it heals at the next start. Re-running the installer is the manual fallback, not a routine step. corral doctor reports each layer it can inspect; the Gradle gate is the one it cannot see.

Status — plainly

Linux

verified: four Gradle modules, five suites (module tests, wrapper, e2e, install, demo), Linux CI plus a host

Windows

host-verified on one box; two gate layers, not three (CUTOVER.md § Windows)

macOS

no installer — the daemon and CLI are portable Java, packaged and verified nowhere

Gate

exec time: a client that bypasses the wrapper, the SDK shim and Gradle is outside it

Identity

cooperative, not authentication: a local process can claim to be anyone

Reviews

52 independent review passes, all findings closed; the count at the first release, with later gates recorded in corral-docs

Console

Compose Desktop, verified on JDK 17 (Linux) and JDK 25 (Windows, § Windows); other very new JDKs untested

Loopback

the daemon binds 127.0.0.1 and refuses a non-local Host header

License

Apache-2.0

Versions. The tag is the only source: a release jar reports the tag it was built from (0.1.7), a source build reports git describe --tags --match v* — that tag, or <tag>-<n>-g<sha> past it — and only a tree with neither a reachable v* tag nor CORRAL_VERSION (a jar built outside git, or a tagless clone) reports 0.0.0-dev, which the console shows as-is.

Where the detail lives

  • CUTOVER.md — install, the claim/lease/wait loop, selectors, Gradle builds, emulators, the console, configuration, doctor, updates and uninstall.

  • Known limits — the absolute-path adb exception, cooperative identity, loopback, Linux-only service paths.

  • Behaviour reference — the gates and their rules, the pool, the HTTP/WS/MCP surface, the config API and self-healing.

  • Repository shape and build — the four modules, the build, the five test suites.

  • Updates — the daily check, the kill switch, and what an apply does to a running daemon or console.

  • SECURITY.md — the trust boundary, including what the release checksum does and does not prove.

Available Tools

8 tools
claimA

Claim a device matching the selector (empty = any usable device). waitSeconds > 0 queues the claim and returns a ticket; re-call claim with that ticket to poll on the returned retryAfterMs cadence (5 s for MCP, or your own clamped proposal via retryAfterMs) until a matching device frees up, then the poll returns the lease. A ticket is skipped by dispatch once it is a few intervals stale, and dropped entirely after ~30 s of silence.

Inputs: owner, ticket, selector, ttlSeconds, +2 more.

freeA
Destructive

Release the lease on a serial held by this session. Refuses if another owner holds it.

Inputs: serial.

list_devicesA
Read-only

List known devices with model, OS, transport and current lease holder.

queueA
Read-only

List agents waiting in the selector FIFO queue.

renewA

Extend the lease TTL on a serial held by this session; also accepts a pending offer.

Inputs: serial, ttlSeconds.

screenshotA
Read-only

Capture a PNG screenshot of a device screen. Read-only. serial is optional: omit it to target the single usable connected device. Strict mode (default): your session must hold the device's lease, or be a configured observer (CORRAL_SCREENSHOT_OBSERVERS).

Inputs: serial.

start_emulatorA
Idempotent

Boot an AVD. A started emulator appears in the pool within seconds and is claimable once booted; claim with waitSeconds > 0 and transport=emulator to queue for boot.

Inputs: avd.

stop_emulatorA
Destructive

Stop every running instance of an AVD. Refuses while one is leased, naming the holder; free that lease first.

Inputs: avd.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools target a clearly distinct action (list, start, stop, claim, free, renew, screenshot). The main risk is the pair 'queue' and 'claim': 'queue' sounds like it could join a wait queue rather than list agents, and claim's ticket-polling overlaps conceptually with queueing, but the descriptions clarify the split.

    Naming Consistency4/5

    All names are snake_case, but the pattern mixes verb_noun (list_devices, start_emulator, stop_emulator) with bare verbs/nouns (claim, free, renew, queue, screenshot). Still predictable and readable, with no camelCase/snake_case mixing.

    Tool Count5/5

    Eight tools is well-scoped for a device-pool/emulator manager: one per lifecycle stage (inspect, boot, stop, wait, acquire, release, extend, capture) with no redundant entries.

    Completeness4/5

    The lease lifecycle is fully covered: discover, start/stop emulators, queue inspection, claim with polling, renew, free, plus screenshot. Gaps exist for post-claim interaction (adb/shell execution, logcat, app install, or device reset), which an agent would likely need next.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Local MCP server for Android and iOS mobile automation and performance telemetry, enabling device control (screenshot, tap, swipe, input, app launch) and metric collection (CPU, memory, launch time) via ADB, simctl, and WebDriverAgent with SQLite session history.
      25 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Drives an Android emulator or a physical device over adb. The agent screenshots, reads the UI hierarchy with true device-pixel coordinates, taps and types, manages app lifecycle, reads logcat, and runs Gradle builds and tests.
      81
      24
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents and humans to lease exclusive Android emulator sessions for bounded periods via MCP or HTTP, with a live web UI for watching or taking over active sessions.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables an AI agent to lease its own Android emulator phone and drive it over stdio: reading the screen, tapping, typing, and opening apps, with every action leaving an audit line and screenshot. Leases keep one agent per phone, and a locked phone stays inert until an operator unlocks it on its own screen.
      10
      MIT