iPhone Agent
Controls and inspects a physical iPhone running iOS, enabling screen and accessibility-tree reading, tapping, swiping, typing, app launching, file/media access, and app management.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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.
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 |
๐ USB or Wi-Fi | Plug in a cable, or use Apple's paired network. |
๐งพ 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 mcpAny 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 |
| Connects, then reports the link, lock state, keep-awake and every available action |
| Accessibility tree of the foreground app, with element bounds in screen points |
| PNG where one pixel is one screen point; |
| Tap at |
| Drag from |
| Type into the focused field, optionally clearing it first |
|
|
| Launch an app by bundle ID, or open a URL or deep link |
| Any other action from the reference |
| Frees the phone when the task is done |
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" --> DThe 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 neededRead 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โฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Give an AI agent an iPhone to see, tap and type on over MCP. Free early access (Simulator).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceControl a real, physical iPhone from an MCP client, enabling tapping, swiping, typing, reading messages, and navigating apps via Apple's UI-automation channel.1 npmMIT
- AlicenseAqualityCmaintenanceEnables 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.11MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceEnables 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