ios-agent-driver
The ios-agent-driver server lets an AI agent programmatically control and interact with the iOS Simulator, enabling automated app testing and UI-driven workflows through a perceive → decide → act → observe loop.
Simulator Lifecycle Management
List simulators: View all available devices with their UDID, name, state, and runtime.
Boot a simulator: Start a simulator by UDID, or default to the already-booted/first available iPhone.
Install, launch, terminate, and reset apps: Manage app lifecycle by bundle ID; reset uninstalls and reinstalls for a clean state.
Navigation & Permissions
Open deep links: Navigate directly to a specific screen via URL or universal link.
Set permissions: Grant, revoke, or reset privacy permissions (photos, camera, location, notifications, contacts, microphone, etc.).
UI Perception
Describe the UI (
describe_ui): Retrieve the full accessibility tree of the current screen as structured JSON (labels, types, values, enabled state, frames) — the primary way the agent reads the screen.Take a screenshot: Capture a PNG of the current screen as a visual fallback for custom-drawn views or general state verification.
UI Interaction
Tap: Tap a UI element by accessibility label (preferred) or by raw x,y coordinates; missing labels report nearest available labels instead of failing silently.
Type text: Enter text into the currently focused input field.
Swipe: Scroll or swipe by direction (up/down/left/right) or explicit from/to coordinates.
Press hardware buttons: Simulate HOME, LOCK, SIDE_BUTTON, SIRI, or APPLE_PAY presses.
Allows an AI agent to control the iOS Simulator, performing actions such as tapping, typing, swiping, and reading the accessibility tree to test iOS apps programmatically.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ios-agent-driver Open Settings and confirm Notifications is enabled"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ios-agent-driver
An MCP server that lets an AI agent drive the iOS Simulator in a loop — so an agent can actually use your app: tap, type, swipe, read the screen, and verify what happened.
It bridges the gap between iOS development and agentic testing. The primitives to
control a simulator exist (xcrun simctl, Meta's idb), but
nothing packages them into tools an agent can call to close the
perceive → decide → act → observe loop. This does.
Accessibility-tree-first perception. The agent reasons over labeled UI elements (
describe_ui) and taps by label, not by guessing pixel coordinates — far more robust to layout changes.Screenshot fallback. For custom-drawn views that don't expose accessibility,
screenshotgives a vision fallback and a way to verify state.Loud failures. A tap on a missing label returns the nearest labels on screen, not a silent no-op.
How it works
Agent (Claude / any MCP client)
goal: "log a leg workout, confirm it appears in History"
observe → decide → act → observe (loop)
│ MCP (stdio)
ios-agent-driver
│ │
xcrun simctl idb (+ companion)
lifecycle, screenshots accessibility tree,
deeplinks, permissions tap / type / swipe by elementRelated MCP server: app-screen-mcp
Requirements
macOS with Xcode (provides
xcrun simctl)idb for UI perception and actions:
brew tap facebook/fb && brew trust facebook/fb brew install facebook/fb/idb-companion # source build — needs current Xcode Command Line Tools pip3 install fb-idb # the `idb` CLI; use pipx/venv if pip is externally-managed idb list-targets # confirm it sees your booted simIf the companion build errors with “Command Line Tools are too outdated”, update them (System Settings › Software Update, or
xcode-select --install). Lifecycle tools work without idb;describe_ui/tap/type_text/swiperequire it and will tell you how to install it if it's missing.Node.js ≥ 18
Install
git clone https://github.com/CodeJonesW/ios-agent-driver.git
cd ios-agent-driver
npm install # builds via the prepare scriptRegister with Claude Code
Add to your MCP config (user-level ~/.claude.json, or a project .mcp.json):
{
"mcpServers": {
"ios-agent-driver": {
"command": "node",
"args": ["/absolute/path/to/ios-agent-driver/dist/server.js"]
}
}
}Or with the Claude Code CLI:
claude mcp add ios-agent-driver -- node /absolute/path/to/ios-agent-driver/dist/server.jsTools
Tool | Backend | Purpose |
| simctl | List devices (udid, name, state, runtime). |
| simctl | Boot a sim (defaults to booted, else first iPhone). |
| simctl | Install a built |
| simctl | Launch an app by bundle id. |
| simctl | Terminate a running app. |
| simctl | Uninstall + reinstall for a clean state. |
| simctl | Open a URL / universal link. |
| simctl | Grant/revoke/reset a privacy permission. |
| idb | Primary perception — accessibility tree as JSON. |
| simctl | PNG of the current screen (vision fallback). |
| idb | Tap by accessibility label (preferred) or x,y. |
| idb | Type into the focused field. |
| idb | Swipe/scroll by direction or coordinates. |
| idb | Hardware buttons (HOME, LOCK, …). |
The loop, by example
A typical agent goal runs as a bounded loop:
GOAL: "open Settings and confirm Notifications is enabled"
1. boot_sim
2. launch { bundle_id: "com.apple.Preferences" }
3. describe_ui → see "Notifications" cell
4. tap { label: "Notifications" }
5. describe_ui → assert the toggle state
(re-read after each action; stop when the goal predicate holds
or a step budget is exhausted)The agent owns the loop and the success predicate; this server provides the primitives. That keeps the tool simple and the test logic where it belongs.
Development
npm run build # compile TypeScript → dist/
npm start # run the server on stdioLicense
MIT © Will Jones (CodeJonesW)
Available Tools
14 toolsboot_simB
Boot a simulator. Defaults to the already-booted sim, else the first available iPhone.
Inputs: udid.
deeplinkB
Open a URL / universal link in the simulator (jump straight to a screen).
Inputs: url (required), udid.
describe_uiA
PRIMARY PERCEPTION. Return the accessibility tree of the current screen as a list of elements (label, type, value, enabled, frame). Reason over this and tap by label.
Inputs: interactive_only, udid.
install_appB
Install a built .app bundle onto the simulator.
Inputs: app_path (required), udid.
launchA
Launch an installed app by bundle id. Returns the launch output (pid).
Inputs: bundle_id (required), udid.
list_simsA
List available simulator devices (udid, name, state, runtime).
Inputs: no named parameters.
press_buttonC
Press a hardware button (HOME backgrounds the app; LOCK locks the screen).
Inputs: button (required), udid.
reset_appC
Uninstall then reinstall an app for a clean state.
Inputs: bundle_id (required), app_path (required), udid.
screenshotA
Capture a PNG screenshot of the current screen. Use as the vision fallback when an element is not exposed in the accessibility tree, or to verify state.
Inputs: udid.
set_permissionB
Grant/revoke/reset a privacy permission for an app (e.g. photos, camera, location, notifications).
Inputs: action (required), service (required), bundle_id (required), udid.
swipeA
Swipe/scroll from one point to another. Either give a direction (auto-computed from screen center) or explicit from/to coordinates.
Inputs: direction, from_x, from_y, to_x, +3 more.
tapA
Tap an element by accessibility label (preferred) or by raw x,y coordinate (fallback). Provide either label or both x and y.
Inputs: label, x, y, udid.
terminateC
Terminate a running app by bundle id.
Inputs: bundle_id (required), udid.
type_textB
Type text into the currently focused field. Tap the field first to focus it.
Inputs: text (required), udid.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose: simulator management (boot_sim, list_sims), app lifecycle (install_app, launch, terminate, reset_app), interaction (tap, swipe, type_text, press_button), perception (describe_ui, screenshot), and configuration (set_permission, deeplink). No two tools overlap in functionality.
All tool names follow a consistent lowercase underscore convention (snake_case) with imperative verbs (e.g., boot_sim, install_app, describe_ui). The pattern is uniform across all 14 tools, enhancing predictability.
14 tools is well-scoped for an iOS simulator driver, covering essential operations: setup, app management, interaction, perception, and configuration. The count is neither excessive nor insufficient for the domain.
The toolset covers core simulator workflows: app install/launch/terminate/reset, UI interaction (tap, swipe, type), perception (accessibility tree, screenshot), and permissions. Minor gaps exist (e.g., no dedicated uninstall or app state query), but agents can work around them.
Maintenance
Related MCP Connectors
Give an AI agent an iPhone to see, tap and type on over MCP. Free early access (Simulator).
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Cloud iPhone Simulators for AI agents: build the Xcode project, read the screen, tap by label, test.
Cloud iPhones and Macs with Xcode for AI agents: build, run and test iOS apps, use the screen.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA MCP server that enables LLMs to interact with iOS simulators through natural language commands.345Apache 2.0
- AlicenseBqualityDmaintenanceAn MCP server for reliable iOS Simulator automation that enables agents to control devices, read accessibility UI trees, and capture screenshots. It supports deterministic grounded actions like tapping, typing, and swiping to create a closed-loop observe-reason-act cycle.157 npm2MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for iOS Simulator automation. Enables AI assistants to visually interact with iOS apps running in the simulator.40 npm1MIT
- AlicenseNot gradedqualityDmaintenanceComprehensive MCP server for iOS Simulator automation, enabling AI agents to control simulators via tap, swipe, type, accessibility inspection, app debugging, and device management.77 npm2MIT