Skip to main content
Glama

iPhone Agent lets an AI agent see and use a physical iPhone the way you would: it reads the screen, taps, swipes, types and opens apps. It runs entirely on your Mac and talks to the phone over USB or Apple's paired Wi-Fi connection.

Agents connect through MCP, so Claude Code, Codex and any other MCP client can use it right away. Scripts get an authenticated HTTP, JSON-RPC and WebSocket API.

NOTE

Alpha. Interfaces may change between releases. See hardware support for what has been tested on real phones.

โœจ Why iPhone Agent

๐Ÿ“ฑ A real phone, not a simulator

Work with real apps, real sign-ins and TestFlight or App Store builds on the device your users have.

๐Ÿ”’ Local and private

No cloud account, no relay server. The API listens on 127.0.0.1 behind a bearer token.

๐Ÿ”Œ USB or Wi-Fi

Plug in a cable, or use Apple's paired network. --network-fallback switches between them by itself.

๐Ÿงพ Every action on record

A hash-chained audit journal writes each request before it runs and each result after. Typed text and clipboard contents are stored only as digests.

๐Ÿ›ก๏ธ Safe by default

One controller per phone. A failed action is never replayed. Erase is off unless you turn it on. Keep-awake changes no setting on the phone.

๐Ÿงฉ Open source

GPL-3.0-or-later, built on WebDriverAgent and pymobiledevice3.

Related MCP server: ios-control-mcp

๐Ÿš€ Quick start

You need: a Mac with Xcode and your Apple developer account signed in to it, Python 3.13+ with uv, and an iPhone that trusts the Mac with Developer Mode on.

# 1. Get the controller and the WebDriverAgent source
git clone https://github.com/edigeh/iphone-agent.git
git clone https://github.com/droidrun/WebDriverAgent.git
git -C WebDriverAgent checkout 8ce9d6f

# 2. Install and check the phone connection
cd iphone-agent
uv sync
uv run iphone-agent doctor

# 3. Build, sign and install the on-phone runner (once)
uv run iphone-agent setup --source ../WebDriverAgent --team YOUR_TEAM_ID

# 4. Start it and send a tap
uv run iphone-agent serve
uv run iphone-agent call tap '{"x":100,"y":200}'

setup builds from a private copy of the WebDriverAgent source, so your checkout stays unchanged. Your team ID is in Xcode โ†’ Settings โ†’ Accounts.

๐Ÿค– Connect your agent

Claude Code

claude mcp add iphone -- /absolute/path/to/iphone-agent/.venv/bin/iphone-agent mcp

Any MCP client

{
  "mcpServers": {
    "iphone": {
      "command": "/absolute/path/to/iphone-agent/.venv/bin/iphone-agent",
      "args": ["mcp"]
    }
  }
}

Then ask your agent something like "Open Settings on my iPhone and turn on Dark Mode." The server starts without a phone attached and connects on the first tool call. That first call can take up to two minutes, so set your client's tool timeout above that.

Tool

What it does

iphone_capabilities

Connects, then reports the link, lock state, keep-awake and every available action

iphone_state

Accessibility tree of the foreground app, with element bounds in screen points

iphone_screenshot

PNG where one pixel is one screen point; scale: 2 for more detail

iphone_tap

Tap at x, y; long press with hold_ms

iphone_swipe

Drag from x1, y1 to x2, y2

iphone_type

Type into the focused field, optionally clearing it first

iphone_press

home, back, app_switch, lock, unlock, volumeup, volumedown

iphone_open

Launch an app by bundle ID, or open a URL or deep link

iphone_action

Any other action from the reference

iphone_disconnect

Frees the phone when the task is done

IMPORTANT

The phone must be unlocked. The controller cannot enter Face ID or a passcode, so input sent to a locked phone returns aPhoneLocked error asking you to unlock it.

๐Ÿงฐ What it can do

Control

  • Tap, long press, swipe, multi-finger gestures

  • Type, clear text, keys, Home, lock, App Switcher

  • Accessibility tree and screenshots

  • Launch and stop apps, open deep links

Apps and files

  • Install IPAs from disk or URL, list and uninstall apps

  • Read and write files in the media folder or an app's container

  • Clipboard, simulated location, time zone

Media

  • H.264/H.265 video and ReplayKit app audio streams

  • Local WebRTC with touch and keyboard over the data channel

  • MP4 recording

More

  • SOCKS proxy through an optional VPN runner

  • Read-only Messages snapshots from a local backup

  • Experimental native adapter for iOS 27+

  • Authenticated HTTP, JSON-RPC and WebSocket API

๐Ÿ“ก Without a cable

If Xcode can see your phone over Wi-Fi, use its hardware UDID (with the cable plugged in, uv run iphone-agent devices shows it):

uv run iphone-agent setup --paired-network --udid YOUR_UDID --team YOUR_TEAM_ID --headless-assets
uv run iphone-agent serve --network-fallback --udid YOUR_UDID

--network-fallback uses USB while the cable is plugged in and Wi-Fi when it isn't. Add the same flags after mcp in your client config.

๐Ÿ—๏ธ How it works

flowchart LR
    A["AI agent<br/>(MCP client)"] -- MCP --> C
    S["Scripts"] -- "HTTP / JSON-RPC / WebSocket" --> C
    subgraph Mac
        C["iphone-agent<br/>controller"]
        J[("audit.jsonl")]
        C --- J
    end
    subgraph iPhone
        W["WebDriverAgent<br/>(XCTest runner)"]
        D["iOS device services"]
    end
    C -- "input, screen, audio" --> W
    C -- "pymobiledevice3:<br/>install, files, backup" --> D

The controller launches the signed runner through Xcode's test plan and holds a lock on the phone so that two controllers never fight over it. While an agent is active it sends an F13 key event every 10 seconds, which keeps the screen on and does nothing else. When the session ends, the phone locks on its normal schedule.

โ“ FAQ

No. It drives physical iPhones over USB and Apple's paired network.

The optional VPN proxy runner needs a paid team for its Network Extension entitlement. For the standard runner, sign in to Xcode with your Apple account and pass its team ID to setup.

One controller holds a phone at a time. A second one gets a PhoneBusy error that says who holds it and how to free it. An MCP session frees the phone when the agent calls iphone_disconnect, when the client closes, or after 30 idle minutes.

Every request and result goes to a hash-chained journal in ~/.iphone-agent/, with digests in place of typed text, clipboard contents and credentials. Check it with uv run iphone-agent audit.

Only if you start serve with --allow-erase and the request repeats the phone's exact UDID. It is off by default.

๐Ÿค Contributing

Bug reports, docs fixes and code are welcome. Hardware reports are especially valuable: if you try a feature on your own iPhone, tell us the model, iOS version and what happened in a hardware report.

uv sync
uv run ruff check .
uv run pytest -q   # runs against fakes, no phone needed

Read CONTRIBUTING.md before opening a pull request. Report security issues privately as described in SECURITY.md.

๐Ÿ“„ License

GPL-3.0-or-later. WebDriverAgent is a separate BSD-3-Clause project that setup builds from source on your Mac. Dependency versions and licenses are in THIRD_PARTY.md.

iPhone is a trademark of Apple Inc. This project is not affiliated with or endorsed by Apple.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables a macOS MCP client to control a real iPhone through CoreDevice services, including screenshots, normalized taps and swipes, text entry, hardware-button presses, and app launching or listing.
      11
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables compatible AI apps to observe and control a locally connected iPhone through stdio MCP tools for screenshots, taps, swipes, long presses, text entry, key and button presses, app listing, and app launching, all reusing the console's device session.
      GPL 3.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an MCP client on macOS to control a paired iPhone over Wi-Fi or USB through system developer services, without any app installed on the phone. Exposes tools for device discovery and connection, fresh screenshots, taps, drags, Home, app listing and launching, and Unicode text entry.
      GPL 3.0