Set up the agent-device MCP server

Install agent-device globally, validate the environment with `agent-device doctor`, and connect the stdio MCP server in Claude Code, Cursor, or Codex.

Published on 18.09.2026

agent-device is not a hosted service but a locally installed command-line tool that also provides an MCP server. This guide covers the steps from installation to a first connection with an AI client.

Prerequisites

You need Node.js 22.12 or newer (24 or newer for web mode), plus — depending on the target platform — the matching native toolchain: Xcode with an installed iOS Simulator for iOS and tvOS, the Android SDK with USB debugging enabled and an authorized ADB connection for Android and Android TV, the HarmonyOS toolchain with HDC for HarmonyOS devices, the Vega CLI/VDA for the Amazon Vega OS TV platform, and, on Linux, access to the AT-SPI accessibility bus. On macOS, the local helper needs the accessibility permission under the privacy section of System Settings.

Installation

Install the package globally via npm:

npm install -g agent-device@latest

Then run agent-device doctor. The command checks the local environment — installed SDKs, connected devices, and granted permissions — and reports any missing prerequisites before you hand the tool to an agent. agent-device help workflow links to matching guides for debugging, replay, and profiling that always match the installed version.

Connecting the MCP server to a client

The agent-device mcp command starts the official stdio MCP server, exposing the installed CLI commands as structured tools. In clients such as Claude Code or Cursor, register it with this configuration:

{
  "mcpServers": {
    "agent-device": {
      "command": "agent-device",
      "args": ["mcp"]
    }
  }
}

Since the server runs over stdio, no additional authentication or URL is required — the client starts the process directly and communicates over standard input/output. Per the project, the same basic configuration works analogously with Codex, Windsurf, Cline, and Goose.

Running a first session

Test the setup directly via the CLI before handing it to an agent. A simple run against the built-in iOS Contacts app looks like this:

agent-device open Contacts --platform ios
agent-device snapshot -i
agent-device press @e2 --settle
agent-device screenshot ./evidence.png
agent-device close

snapshot -i shows interactive elements with their references; after each command run with --settle, the output includes a diff with fresh, valid references. References from older output become stale — request a new snapshot whenever you need one.

Checking and releasing device state

With parallel agents or worktrees, agent-device device status shows which process currently holds which device, and agent-device device release --stale frees claims left behind by processes that are no longer running.

Common pitfalls

A frequent issue is an outdated Node.js version — web mode in particular fails under Node.js 22 because it requires version 24; agent-device doctor flags this upfront. On Android, connections often fail due to unauthorized USB debugging: run a plain adb devices to confirm the device shows as "device" rather than "unauthorized". On macOS, the local helper aborts without the accessibility permission, which must be granted manually in System Settings for the terminal or editor program actually running the command. Using stale references from an older snapshot usually causes the next command to report that the element was not found — a fresh snapshot call resolves that.

Published on 18.09.2026

Categories

Frequently asked questions

Does agent-device require a Callstack account?

No, it runs entirely locally and is free to use without an account. Only connected device clouds such as BrowserStack or AWS Device Farm need their own separate credentials.

Does agent-device work with native apps that aren't React Native?

Yes, per the project it supports native iOS and Android apps as well as React Native, Expo, and Flutter. The exact command coverage varies by target platform.

How does agent-device differ from Playwright or Chrome DevTools in this catalog?

Playwright and Chrome DevTools automate web browsers. agent-device additionally covers native mobile, TV, and desktop apps, offering only a basic mode for web via the external agent-browser project.

Can I use agent-device in CI?

Yes, recorded `.ad` scripts can be replayed in CI, with screenshots and logs kept as artifacts. The project points to an EAS workflow example for Expo apps for this.

Does agent-device replace tools like Appium, Detox, or Maestro?

Not necessarily: with agent-device, an agent decides each step at run time, while those frameworks are built for fixed, maintained test suites. Successful agent runs can still be exported as Maestro YAML.