callstack/agent-device

Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.

What it does

agent-device is a command-line tool and MCP server that lets AI coding agents (Claude Code, Codex, Cursor, Windsurf, Cline, Goose) inspect, control, debug, and verify apps running on iOS, Android, HarmonyOS, TV platforms, web, macOS, and Linux. It works on simulators, emulators, and physical devices.

The core idea is giving agents a token-efficient view: instead of reasoning over screenshots, the agent reads the app's accessibility tree as a text snapshot and interacts through refs (@e2, @e7…) that point to UI elements. It saves screenshots, video, logs, traces, network data, crash details, and React Native performance profiles as evidence for humans to review.

Why it matters

Verifying code changes in a running app was historically a manual or scripted-assertions job (Appium, Detox, Maestro). agent-device flips this: the agent itself reads app state, chooses commands at runtime (tap, fill, scroll, gesture, assert), and repeats workflows — so a coding agent can implement a feature, run it on two platforms, and attach reviewable proof to a PR.

It also solves coordination problems: sessions are scoped to the caller's git worktree, and device claims stop parallel agents from stealing each other's simulators. Recorded runs can be saved as .ad replay scripts for CI or exported as Maestro YAML.

How it works

  • Three entry points, one runtime: CLI, stdio MCP server (agent-device mcp), and a typed Node.js client (createAgentDeviceClient()) — all share sessions, device ownership, selectors, evidence, and replays.
  • Per-platform backends: a local accessibility bridge for iOS Simulator snapshots; XCTest for iOS interactions and physical devices; ADB on Android; HDC/ArkUI uitest on HarmonyOS; Vega CLI on the Vega Virtual Device; AT-SPI on Linux. Support depth varies by target, checkable via agent-device capabilities --platform <platform>.
  • The inspect-act-verify loop is adapted from Vercel's agent-browser. MCP exposes the CLI commands as structured tools; plain CLI is preferred for some clients.
  • Cloud/remote support: the same commands drive hosted devices on BrowserStack, AWS Device Farm, TestMu AI, and Limrun.

Maturity

Production-tooling quality: MIT-licensed, npm-distributed, CI badge, official docs site, integration guides for Vercel's AI SDK and Eve, a workflow template for Expo EAS CI. Named adopters include Expensify, Shopify, JPMorgan Chase, and others. Requires Node.js 22.12+ (24+ for web automation).

Related

  • Project
  • Project
  • Project
  • Project
  • Project