Skip to content

How do I let Codex operate my iPhone?

Register one local MCP server and Codex can see and use a real iPhone. The server is Manina AI CLI (esp32agent). It talks over Bluetooth, or your Wi-Fi, to a small XIAO ESP32S3 board on the phone. The board receives the iPhone’s Screen Mirroring and acts as its mouse and keyboard, so iOS stays stock: no jailbreak, no Xcode, no developer account.

No board yet? Buy a XIAO ESP32S3, then flash it in your browser.

  • A standard Seeed Studio XIAO ESP32S3 (8 MB flash, 8 MB PSRAM), with its antenna attached: where to buy.
  • Board firmware v0.2.2 or later, from the installer in Chrome or Edge.
  • An iPhone XS or newer on iOS 18 (or iPhone 8 / X on iOS 16.4+), with cellular data.
  • A computer with Bluetooth where Codex runs. Screenshots also need ffmpeg.
Terminal window
curl -fsSL https://manina.ai/install.sh | sh

On Windows PowerShell: irm https://manina.ai/install.ps1 | iex. With Node.js 18+: npm install -g esp32agent.

Plug the board into the iPhone, then within three minutes of powering it:

Terminal window
esp32agent devices
esp32agent pair

On the iPhone, join the board’s hotspot (ESP32Agent-…; find the password), turn on Control Center → Screen Mirroring → ESP32 Agent, and turn on Settings → Accessibility → Touch → AssistiveTouch. Check it:

Terminal window
esp32agent screenshot
esp32agent calibrate
Terminal window
codex mcp add esp32agent -- esp32agent mcp

Codex now has these tools: screenshot, tap, longpress, swipe, type_text, press_key, press_button, device_info, history, intent_list, intent_show and intent_save. Pairing stays in the terminal.

Use esp32agent to take a screenshot of my iPhone. Open Settings and go to Wi-Fi. Take a fresh screenshot after each action to check the result. Stop when the Wi-Fi page is visible.

The agent should look → take one action → look again. Watch the first run and stop Codex if it goes off track. Codex supplies the reasoning and the model; the CLI only provides the phone controls.

  • Over Bluetooth, screenshots can be about a second behind. Put the board on your Wi-Fi with esp32agent net join for near-live screenshots.
  • The CLI can’t open or install apps directly: the agent goes through the Home Screen or search. HOME is the only hardware button.
  • Typing is ASCII, one key per character; Chinese goes through the Pinyin keyboard.
  • While the iPhone app is running a task, CLI commands answer busy. Use one at a time.

Screenshots go to the model Codex uses. Check its data policy before working on personal accounts, and use only devices and accounts you own or may control (disclaimer).

Full command list, Wi-Fi link and logs: CLI & AI agents. The same server works in Claude Code and other MCP clients.