iospilot
Controls a real iPhone running iOS 27 or later over USB, reading the foreground app's accessibility tree, performing taps, long presses, swipes, scrolling, text entry, key presses, waits, and screenshots, and managing app launch, stop, and listing.
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., "@iospilot Open Settings and turn on Airplane Mode"
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.
iospilot
An MCP server that lets an LLM agent drive a real iPhone (iOS 27+) from Windows, Linux or macOS, with nothing installed on the phone: no WebDriverAgent, no XCTest runner, no signing, no Mac.
It talks to Apple's CoreDevice developer services over USB through opendevice:
Screen as text: the accessibility tree of the foreground app with frames, compressed into a short numbered element list. One read takes ~1 s.
Input: HID touch (tap, long press, drag, swipe) and a virtual keyboard, as if a finger and a Bluetooth keyboard were used. Text of any script is entered by pasting.
Waits like a person: the phone streams its screen as HEVC at ~60 fps even when nothing moves. A frame that repeats the last picture is a few hundred bytes, any visible change is far more, so the frame sizes tell when the screen has stopped changing, with no decoding. Every action waits for that, then returns the new element list. One round trip per step.
This is the iPhone sibling of droidpilot and keeps its tool surface where it can.
Requirements
An iPhone on iOS 27 or later (screen streaming and HID input over CoreDevice start there), with Developer Mode on (Settings → Privacy & Security → Developer Mode).
USB cable, the phone unlocked and trusting this computer.
Windows: Apple's device drivers (the Apple Devices app from the Microsoft Store, or iTunes). Linux:
usbmuxd.Python 3.10+.
The developer disk image must be mounted once per phone boot. opendevice can do it:
opendevice mounter mount # or: pymobiledevice3 mounter auto-mountRelated MCP server: Zeptap
Setup
git clone https://github.com/WaziXuan/iospilot && cd iospilot
python -m venv .venv && .venv/bin/pip install -e . # Windows: .venv\Scripts\pip install -e .Register it with your MCP client, e.g. Claude Code:
claude mcp add iospilot -- /path/to/iospilot/.venv/bin/python -m iospilotWith several phones connected, pass --udid <udid> (or set IOSPILOT_UDID).
Quick checks without an agent:
python scripts/mcp_call.py # list the tools
python scripts/mcp_call.py observe # what is on screen
python scripts/smoke.py # end-to-end run inside the Settings appWhat the agent sees
app: Settings (com.apple.Preferences) screen: 402x874pt elements: 14
[e1] Header "Settings" @(79,141) 126x38 header
[e2] Button "Zixuan W, Apple Account, iCloud+, and more" @(201,213) 370x90
[e6] Switch "Airplane Mode" ='0' @(201,470) 370x50 off
[e7] Button "Wi-Fi, HKU-SH" @(201,520) 370x50
[e13] SearchField "Search" @(185,822) 346x28 edit[eN]is a handle for action tools; it is valid for the latest list only.Coordinates are iOS points.
@(x,y)is where a tap lands: the centre of the element's visible part, not of its frame, when something covers part of it.Flags:
edit,on/off,selected,disabled,header,adjustable,embedded(drawn by another process, e.g. a Home Screen widget, whose frames are widget-local).The header says
keyboard: shown (covers y>=…)when the on-screen keyboard is up; then its action key (Search/Go/Send/Return) is listed as aKeyelement.hidden: Ncounts elements left out because they are covered or off screen.
Tools
Tool | What it does |
| Element list, optionally with a screenshot |
| JPEG; at the default width of 402 px, 1 px = 1 point |
| Tap a handle, |
| Press and hold (context menus) |
| From one handle/point to another; |
|
|
| Enter text into the focused field (any script); |
|
|
| Wait for a text, or for the screen to stop changing |
| Apps by name ("Settings", "微信") or bundle id |
| Device, iOS version, screen size, latest timings |
Action tools return ok (settled in N ms; read in M ms) and the new element list.
Measurements
iPhone 17 Pro Max (iPhone19,2), iOS 27.2, USB, Windows 11:
Connect (tunnel + stream) | ~0.5 s |
Read the element list | 0.9–1.2 s |
Tap → settled → new list | ~1.5–2.5 s (opening a page ~2 s, no change ~1.4 s) |
Scroll a list | ~2 s |
Enter text (paste + iOS's paste prompt) | ~2.5 s |
Screenshot | ~1.5 s |
Design notes
Things found on the device that the code depends on:
First payload only. The accessibility daemon answers a request with an InitialDump (~1 s; labels, traits, frames) and ~0.5 s later a ~300 kB AdditionalData payload. The first is complete for our purposes, so reads return there.
One connection per read. A connection kept open was still receiving that 300 kB payload while the next tap or a screenshot ran, which garbled the DTX framing over opendevice's userspace TCP stack. A new connection costs 10–100 ms and fixed it. About one request in ten right after a tap gets no answer; it is retried on a new connection after 2.2 s.
Settling on frame sizes. Still frames are ~500 B on a Settings page, ~1.2 kB on a Home Screen whose clock icon ticks (a ~19 kB frame each second). The still-frame floor follows the recent frames, capped so a transition can't become the new normal. A Home button press blocks ~0.4 s and its animation starts after that, so "nothing changed" is timed from when the action returned, not from when it started.
Scrolls that stop. iOS takes the release velocity from the last touch samples. Resting the finger without reporting it does nothing; the finger eases in and then keeps reporting its position at 60 Hz for 0.15 s, so lists stop where they were dragged and pages overlap.
Text by pasting. Letters typed on the (virtual) hardware keyboard go through the active input method: with Pinyin on, "wifi" became an uncommitted composition and later "我i分". The text is put on the pasteboard and pasted with Cmd+V instead. iOS then asks "Settings" would like to paste from "dtpasteboardd"; iospilot taps Allow Paste (exact label only) and then restores the user's clipboard.
Return only with a keyboard. With no text field focused, a hardware Return activates the control that has keyboard focus and once opened an unrelated Settings page.
press_key entertaps the keyboard's action key when one is shown and refuses otherwise.Occlusion without z-order. The dump has no z-order. Something smaller over part of an element, or a control over plain content (a tab bar item over the last chat row), counts as on top. iOS 27's glass search bar takes touches ~30 pt above the field it reports, so a band of 40 pt above bottom search fields and narrow floating buttons counts as covered too.
Role from traits. The role description sometimes arrives only with the second payload, so roles come from UIAccessibilityTraits (including the private toggle bit, 1 << 53).
Which "Settings". Two installed bundles are named Settings (
com.apple.Preferencesandcom.apple.CarPlaySettings); app lookup prefers user apps, then non-CarPlay, non-internal ones.
Limitations
iOS 27+ only, and USB only for now (opendevice has a Wi-Fi mode that iospilot doesn't use yet).
Reading the screen costs ~1 s, far slower than an on-device XCTest runner (~0.1 s); that is the price of installing nothing on the phone.
Portrait was tested; landscape frames are not handled specially.
Apps that draw their own UI (games, maps, canvases) expose little or no accessibility tree; use screenshots and point taps there.
Home Screen widget elements carry widget-local coordinates (flagged
embedded).The paste prompt is answered for English and Chinese UIs.
After a phone reboot the developer disk image must be mounted again.
Development
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytestThe unit tests need no device. scripts/smoke.py and scripts/mcp_call.py drive a real phone.
Related projects
opendevice: the CoreDevice client this builds on.
droidpilot: the same idea for Android emulators.
iphone-use, SideTap, mobile-mcp: iPhone control through an XCTest runner (WebDriverAgent or their own) on the phone; faster reads, but the runner must be built, signed and installed.
License
MIT
Available Tools
15 toolsapp_launchA
Open an app by its name ("Settings", "微信") or bundle id (see app_list). Brings it to the front if it is already running.
Inputs: name (required), max_wait_ms, observe_after. Returns: result
app_listB
Installed apps as "Name (bundle id)", optionally filtered by substring.
Inputs: contains. Returns: result
app_stopC
Quit an app by name or bundle id.
Inputs: name (required). Returns: result
long_pressC
Press and hold an element handle or "x,y" (context menus, Home Screen edit mode).
Inputs: target (required), hold_ms, max_wait_ms, observe_after. Returns: result
observeC
List the foreground app's elements with handles. Optionally attach a screenshot.
Inputs: width, screenshot.
press_keyB
Press: back, home, lock, volume_up, volume_down, enter (also search/go/send/done: taps the keyboard's action key when shown), backspace, tab, escape, space, up, down, left, right.
Inputs: key (required), max_wait_ms, observe_after. Returns: result
screenshotA
Current screen as JPEG, width px wide. The default 402 makes 1 px = 1 point on a 402-point-wide
iPhone, so coordinates read off the image can be passed to action tools as they are.
Inputs: width.
scrollB
Scroll "down" (reveal content below), "up", "left" or "right", within an element handle or the
whole screen, by about distance of its height/width so consecutive pages overlap. The finger rests
before lifting so the list stops where it was dragged; fling=True lets it coast (faster, may skip).
Inputs: direction (required), fling, target, distance, +2 more. Returns: result
statusB
Device, iOS version, screen size and the latest timings.
Inputs: no named parameters.
swipeC
Swipe from start to end (handles or "x,y"). Set hold_ms > 0 to press first, i.e. drag.
Inputs: end (required), start (required), hold_ms, duration_ms, +2 more. Returns: result
tapB
Tap an element handle ("e7") or a point ("201,437").
Inputs: target (required), max_wait_ms, observe_after. Returns: result
tap_textB
Tap the first element whose label or value contains text (case-insensitive).
Inputs: text (required), exact, max_wait_ms, observe_after. Returns: result
type_textA
Enter text into the focused field (tap the field first). Any script works: the text is pasted, so the active input method (Pinyin etc.) cannot garble it, and the user's clipboard is restored afterwards. clear=True empties the field first.
Inputs: text (required), clear, max_wait_ms, observe_after. Returns: result
wait_forC
Wait until an element whose label or value contains text appears.
Inputs: text (required), exact, timeout, observe_after. Returns: result
wait_idleB
Wait until the screen stops changing (a page still loading, an animation), then return the list.
Inputs: max_wait_ms. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool maps to a distinct action (observe vs screenshot, tap vs tap_text vs long_press, wait_for vs wait_idle), and descriptions clarify the boundaries well. Minor overlap remains: observe can return a screenshot so it partially duplicates screenshot, and wait_idle also returns an element list like observe.
Almost everything is lowercase snake_case with verb_noun compounds (tap_text, long_press, type_text, press_key, wait_for, wait_idle), which reads predictably. The exceptions are the noun-style app_* tools (noun_verb order) and bare nouns like observe/screenshot/status, a small but visible deviation.
15 tools is at the top of the comfortable range but each covers a real gesture or device query rather than padding. Slightly heavy — a few (tap_text, wait_for) are conveniences layered on observe/tap — but nothing feels redundant enough to cut.
The surface covers the full observe-act-wait loop plus app lifecycle and device status, which is the core of UI automation. Gaps: no pinch/zoom or multi-touch gesture, no URL/deep-link opening, and no way to query a single element's attributes without a full observe.
Related MCP Connectors
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Let your AI use a real iPhone: see the screen, tap, type, open apps, run saved workflows.
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.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Related MCP Servers
- FlicenseAqualityAmaintenanceControl a real iPhone or iOS Simulator through a macOS daemon and XCTest runner over USB or Wi-Fi: read screen text, tap, type, swipe, inspect logs and replay flows with explicit outcomes. Browser sandbox: use readonly to inspect 12 preloaded flows without a phone. Reuse an existing sandbox from MCP Deployments, or delete it before starting another. Device control needs your Mac and iPhone.43531-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to operate a real iPhone from a Mac by reading the screen over USB and sending taps, swipes, typing, and app launches over Bluetooth, with every action returning a fresh screenshot so the agent can verify its work. Runs as a local MCP server, so agents can test iOS apps on physical devices and automate everyday phone tasks.38 npm10MIT
- AlicenseBqualityFmaintenanceEnables AI agents to see and operate a real USB-connected iPhone from a Linux Docker host — taking screenshots with region zoom, reading the element tree, tapping, swiping, long-pressing, typing text, pressing hardware buttons, listing/launching/terminating apps, and opening URLs. Automatically recovers from replugs and crashes, re-signs its automation agent before expiry, and falls back to a signing-free HID path on newer iOS.131MIT
- AlicenseAqualityAmaintenanceLet AI agents operate a real USB-connected iPhone from Linux — no Mac, no jailbreak, no paid developer account. Screenshots, taps, swipes, text input, element tree and app control via WebDriverAgent, with CoreDevice HID fallback.17198MIT