Corral
Manages a pool of Android devices and emulators, allowing agent sessions to list devices, queue for and claim exclusive leases, renew or release them, take screenshots, and start or stop emulators.
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.

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:8799The console itself shows a persistent DEMO banner at the top of its window:

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 --uiFrom 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 consoleThe 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 whenWire an agent in
claude mcp add --transport http corral http://127.0.0.1:8798/mcpEight 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 |
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 toolsclaimA
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.
freeADestructive
Release the lease on a serial held by this session. Refuses if another owner holds it.
Inputs: serial.
list_devicesARead-only
List known devices with model, OS, transport and current lease holder.
queueARead-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.
screenshotARead-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_emulatorAIdempotent
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_emulatorADestructive
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
Scored across 8 tools
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.
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.
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.
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
Related MCP Connectors
Coordinate multiple AI agents over MCP: atomic claims, leases, shared ledger, handoffs, tasks.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Open-source MCP gateway with per-agent tool permissions, call approvals and tool-change review.
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal 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 npm1MIT
- AlicenseAqualityBmaintenanceDrives 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.8124MIT
- AlicenseNot gradedqualityBmaintenanceEnables 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
- AlicenseBqualityBmaintenanceEnables 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.10MIT