How to Let Claude Code (or Any MCP Client) Control a Real iPhone

2026-11-24来源 dev.toEnglish

Claude Code already reads files and runs commands on your computer. With Manina AI CLI, it can also see a real iPhone screen and tap on it. The phone stays stock: no jailbreak, and no developer account for daily use.

Manina AI, from Holomix, Inc., is built around the open-source ESP32 iPhone Agent project. A Seeed Studio XIAO ESP32S3 sits on the phone's USB port as a mouse and keyboard, receives the mirrored screen, and talks to your computer over Bluetooth. The Claude Code landing page has the short path and a sample session. Use only devices and accounts you own or are authorized to control.

What you need

You need Details
A flashed board Seeed Studio XIAO ESP32S3, standard version, 8 MB flash and 8 MB PSRAM, about $7, with its Wi-Fi/Bluetooth antenna attached. The browser installer supports this board, not Sense or Plus.
A browser Chrome or Edge. Safari, Firefox, and phones cannot flash the board.
An iPhone XS or newer on iOS 18 or later (or iPhone 8 / X on iOS 16.4+ with the TestFlight app 1.0.9+), with cellular data on.
A data cable USB-C to USB-C, about 30 cm (1 ft), not charge-only. Lightning phones also need a Lightning to USB Camera Adapter.
Bluetooth On the computer running your MCP client.

The phone powers the board over USB, so once the board is flashed it does not need to stay attached to your computer. On a USB-C iPhone the board occupies the port, so there is no wired charging during a run.

1. Flash the board

Open the firmware installer in Chrome or Edge: https://manina.ai/install (the TestFlight channel also works; official docs say both channels support the CLI). The page looks up the latest firmware for the selected board. The CLI needs firmware v0.2.2 or later; v0.2.3 or later is required for the optional Wi-Fi link and for esp32agent net to show the hotspot name and password.

Connect the board with a data cable, click Connect board, and select it in the browser's USB list. If the page says it is restarting into install mode, click Connect board and select it again. Keep the page open until it says Installed, then unplug the board.

2. Install the CLI

On macOS or Linux:

curl -fsSL https://manina.ai/install.sh | sh 

On Windows PowerShell:

irm https://manina.ai/install.ps1 | iex 

The installer puts the binary in ~/.local/bin (Windows: ~\.local\bin). Put that directory on your PATH, and confirm with esp32agent version. Screenshots also need ffmpeg; follow the installer's package-manager prompt if it offers one. npm install -g esp32agent (Node.js 18 or later) and npx -y esp32agent are documented alternatives that download the same release.

3. Pair the board and connect the phone

Plug the flashed board into the iPhone, turn on Bluetooth on the computer, and keep them nearby. The iPhone app is not required. Do not pair the board in the computer's OS Bluetooth settings; the CLI does that itself.

esp32agent devices esp32agent pair 

Pair within three minutes of powering the board; if that window has closed, unplug and reconnect it, then retry. If more than one board is found, use esp32agent pair --device <id> with an identifier from devices.

  1. Find the board hotspot (ESP32Agent-…) name and password. With firmware v0.2.3 or later, esp32agent net shows them. Otherwise view them in the ESP32 Agent app, or over USB serial as described in the FAQ. Then move the board back to the iPhone.
  2. On the iPhone, open Settings → Wi-Fi and join the hotspot.
  3. Turn on Control Center → Screen Mirroring → ESP32 Agent.
  4. Turn on Settings → Accessibility → Touch → AssistiveTouch. Keep the pointer visible, and keep the phone unlocked and in portrait.

The board's hotspot has no internet, so any app on the phone that needs a network during the task will use cellular data.

esp32agent device info esp32agent screenshot esp32agent calibrate 

Open the PNG path that screenshot prints and check that it shows the live phone screen. If the image is stale, restart Screen Mirroring. Optional, with firmware v0.2.3 or later: esp32agent net join puts the board on your Wi-Fi so commands and video can travel over that link. MCP tools do not perform the initial discovery and pairing; finish that in a terminal first.

4. Register the MCP server

The MCP server is the same CLI, started with the mcp subcommand:

claude mcp add esp32agent -- esp32agent mcp esp32agent skill install 

The skill goes under ~/.claude/skills/esp32agent/. It gives Claude the phone workflow; MCP provides the tools. If you are using npx instead of a global binary, the GitHub README documents claude mcp add esp32agent -- npx -y esp32agent mcp.

There is also a Claude Code plugin that adds the MCP server and skill in one step. Inside Claude Code:

/plugin marketplace add onehumanbeing/esp32-iphone-agent /plugin install esp32agent@manina 

Start Claude Code and ask it to do something on the phone. Other MCP clients can use the same command shape: an executable esp32agent with the argument mcp. For Codex: codex mcp add esp32agent -- esp32agent mcp. For a generic stdio client, the repository documents:

{ "mcpServers": { "esp32agent": { "command": "npx", "args": ["-y", "esp32agent", "mcp"] } } } 

The client needs access to this computer's Bluetooth and to the saved screenshot files.

What a session looks like

Ask Claude Code to open Settings on the iPhone and tell you which iOS version is installed. For a first check, have it take a screenshot, open Settings, go to Wi-Fi, and stop when that page is visible, checking a fresh screenshot after each action.

It then works through a loop with the MCP tools: request a screenshot, pick a tap, swipe, or typed text, let the CLI send that action to the board, and screenshot again. The USB pointer is relative, so the system tracks it, re-homes it in a corner, and before a precise tap wiggles it, finds it on screen, and corrects the miss. After each action it waits for the screen to settle. If the board, hotspot, or mirroring link drops, the run pauses and picks up at the same step.

A longer official example, which matches the public demo video (some footage is sped up or cut), is to open Chrome in incognito mode, visit the Google Maps website, and find coffee near East Broadway station in New York. Keep tasks short and specific. The CLI cannot open or install apps directly; have the agent go through the Home Screen or search.

Limits and troubleshooting

Plan around these documented limits. Bluetooth LE moves about 300–500 kbps, so screenshots are 480×1040 and video is at most 5 fps. A step takes a few seconds, most of it model time. Typing is ASCII only, with no clipboard access. iOS will not mirror passcode entry, Apple Pay, or DRM-protected video. Mirroring stops if the phone locks, so raise auto-lock time for long sessions. Landscape apps are not supported yet. If you also use the iPhone app, pointer and keyboard commands fail with busy: the app is using the phone while the app is operating the phone, and for about 20 seconds after.

Screenshots may be sent to your computer agent's model provider. CLI history and screenshots stay on your computer. Check that agent's data policy and Manina AI's privacy policy before using personal accounts or screens.

From the public docs and FAQ:

  • No board in the installer, or no pointer on the phone. Try another known-good data cable, plug in directly (skip hubs and docks), and close other apps using the serial port. If the installer still cannot see the board, hold the BOOT button next to the USB-C port while plugging it in, then try Connect board again.
  • Pairing fails, or only works at very close range. Attach the included antenna, keep the board close, and retry esp32agent pair within three minutes of plugging the board in.
  • ESP32 Agent is missing from Screen Mirroring. Finish pairing, join the board's Wi-Fi, choose ESP32 Agent in Control Center, and keep the iPhone unlocked.
  • Stale screenshot. Restart Screen Mirroring. After a board restart, reconnect Wi-Fi and mirroring.
  • Taps land in the wrong place. Keep AssistiveTouch on, the pointer visible, and the phone in portrait, then run esp32agent calibrate. If accuracy is still poor, set Tracking Speed to the middle, turn off Pointer Animations, and calibrate again.
  • Logs for support. esp32agent logs --save writes a file on your computer and prints its path; nothing is sent by the CLI. You can email it to support@manina.ai yourself.

See the CLI docs and the FAQ for more detail.

Set it up

Flash the board, connect the phone, and hook the CLI to your agent with the steps above. The Claude Code walkthrough is the shortest public path, and the GitHub repository has the source (MIT, except the firmware's AirPlay receiver, which is GPL-3.0). The board you flash yourself is the open-source one. A plug-and-play Manina device is listed on a waitlist; it is not for sale yet.

原文:https://www.a8q9.cn/en/article/how-to-let-claude-code-or-any-mcp-client-control-a-real-iphone-626606.html

相关文章