Let AI agents control your iPhone: MCP server, CLI and HTTP API

Updated October 9, 2026

Mirror my iPhone gives AI agents a real iPhone. Claude, Cursor, Codex or your own script can see the screen, read its buttons and fields, and tap, swipe, type and open apps on an iPhone connected to your Mac by USB. They call tools that act on the phone directly, with no computer use involved.

Why a direct API instead of computer use

The usual way to let an AI use a phone from a Mac is computer use: the agent screenshots your whole desktop, finds the mirroring window, and moves your mouse to click inside it. Apple's iPhone Mirroring offers nothing else, because it has no API. Mirror my iPhone skips all of that:

Quick start

  1. Install Mirror my iPhone, open it and let the Doctor set up touch control (Xcode, a free Apple ID and Developer Mode on the iPhone).
  2. Add the MCP server to your agent, using one of the configurations below.
  3. Ask something like "Open Settings on my iPhone and turn on Dark Mode." You see every agent touch as a blue dot on the mirrored screen.

Claude Code

$ claude mcp add --scope user mirror-my-iphone -- "/Applications/Mirror my iPhone.app/Contents/Resources/bin/mirror-my-iphone" mcp

Claude Desktop, Cursor and Gemini CLI

Add this to ~/Library/Application Support/Claude/claude_desktop_config.json (Claude Desktop), ~/.cursor/mcp.json (Cursor) or ~/.gemini/settings.json (Gemini CLI):

{
  "mcpServers": {
    "mirror-my-iphone": {
      "command": "/Applications/Mirror my iPhone.app/Contents/Resources/bin/mirror-my-iphone",
      "args": ["mcp"]
    }
  }
}

VS Code

In .vscode/mcp.json:

{
  "servers": {
    "mirror-my-iphone": {
      "type": "stdio",
      "command": "/Applications/Mirror my iPhone.app/Contents/Resources/bin/mirror-my-iphone",
      "args": ["mcp"]
    }
  }
}

Codex CLI

In ~/.codex/config.toml:

[mcp_servers.mirror-my-iphone]
command = "/Applications/Mirror my iPhone.app/Contents/Resources/bin/mirror-my-iphone"
args = ["mcp"]

Any other MCP client that runs local (stdio) servers works the same way.

Tools

Coordinates are iPhone points, which are also the pixels of a default screenshot, with (0, 0) at the top left.

MCP toolCLIHTTPWhat it does
screenshotscreenshot [FILE]GET /v1/screenshotThe screen as PNG or JPEG, after it settles
describe_uiui [--json]GET /v1/uiElements on screen: type, label, value and the point to tap
tap, double_taptap X Y, double-tap X YPOST /v1/tap, /v1/double_tapTap at a point
long_presslong-press X YPOST /v1/long_pressTouch and hold
swipeswipe X1 Y1 X2 Y2POST /v1/swipeDrag a finger; scroll, go home, open Control Center
type_texttype TEXTPOST /v1/typeType into the focused field; \n presses Return
press_buttonbutton NAMEPOST /v1/buttonHome, Lock, volume up or down
open_app, list_appsopen-app ID, appsPOST /v1/open_app, GET /v1/appsOpen an app by bundle ID; list installed apps
device_infoinfoGET /v1/infoModel, iOS version, screen size, touch and capture status

Gesture tools answer with a screenshot of the result, so the agent sees each step without asking.

What the agent sees

Example output of describe_ui (or mirror-my-iphone ui) in Settings:

In front: Settings (com.apple.Preferences). Screen 393 × 852 points. Keyboard hidden.
SearchField "Search" at (196.5, 160)
Cell "Wi-Fi" value "Home" at (196.5, 398)
Cell "Bluetooth" value "On" at (196.5, 442)
Cell "Display & Brightness" at (196.5, 640)
...

HTTP API for scripts and other agents

While it runs, the app serves the API on 127.0.0.1:8101 (or a free port). It writes the URL and a token to ~/Library/Application Support/Mirror my iPhone/api.json, which only your user account can read. Every request needs the token.

$ API="$HOME/Library/Application Support/Mirror my iPhone/api.json"
$ URL=$(plutil -extract url raw -o - "$API") TOKEN=$(plutil -extract token raw -o - "$API")
$ curl -H "Authorization: Bearer $TOKEN" "$URL/v1/screenshot" -o screen.png
$ curl -H "Authorization: Bearer $TOKEN" -d '{"x": 196, "y": 400}' "$URL/v1/tap"

The same from Python, with only the standard library:

import json, pathlib, urllib.request

api = json.loads((pathlib.Path.home() / "Library/Application Support/Mirror my iPhone/api.json").read_text())

def call(path, body=None):
    data = json.dumps(body).encode() if body is not None else None
    request = urllib.request.Request(api["url"] + path, data=data,
                                     headers={"Authorization": f"Bearer {api['token']}"})
    return urllib.request.urlopen(request).read()

call("/v1/open_app", {"bundle_id": "com.apple.Preferences"})
print(json.loads(call("/v1/ui"))["elements"][:5])
pathlib.Path("screen.png").write_bytes(call("/v1/screenshot"))

GET /v1 lists every endpoint. The README has the full parameter reference.

What people use it for

Safety and privacy

Limitations

FAQ

Is there an MCP server for controlling a real iPhone?

Yes. Mirror my iPhone, a free and open-source Mac app, includes an MCP server that lets AI agents take screenshots of a USB-connected iPhone, list the elements on screen, and tap, swipe, type, press buttons and open apps.

Which AI agents can control my iPhone with Mirror my iPhone?

Any MCP client that runs local servers, including Claude Code, Claude Desktop, Cursor, VS Code, Codex CLI and Gemini CLI. Agents and scripts without MCP can use the mirror-my-iphone command-line tool or the local HTTP API.

Does the agent need computer use?

No. The agent calls tools that act on the iPhone directly. It doesn't screenshot your Mac, look for a window or move your mouse, so you can keep using your Mac while it works.

Can an agent control an iPhone app I'm developing?

Yes. Build and install your app with Xcode as usual, then let the agent open it by bundle ID, tap through it and check the screenshots and on-screen elements on a real device.

Is it safe to let an agent use my iPhone?

The API listens only on 127.0.0.1, needs a token that only your user account can read, and refuses requests from web pages. The MCP server tells the agent to ask before anything hard to undo, such as sending messages, buying or deleting data, and you see every agent touch as a blue dot on the mirrored screen.

Give your agent an iPhone

Free and open source. Works with Claude, Cursor, Codex, Gemini CLI and any MCP client.