English · 中文

phonectl-mcp
Let AI agents see and drive a real iPhone from your Mac, over USB or Wi-Fi.
Install · Tools · Troubleshooting · Security
An MCP server for screenshots, on-screen text, taps, swipes, typing, buttons, apps and the clipboard on an iPhone connected to your Mac. Nothing to install on the phone, no Xcode, no jailbreak. Several agents and scripts can use it at once: they take turns, and none taps on another's screen.
| An AI agent makes a rednote post: text card, template, stickers, filter, caption. It stops before Post. Sped up. | A script applies to a job in a recruiting app: read_text finds the buttons, tap presses them. 2× speed. |
Requirements
- A Mac with uv
- An iPhone on iOS 27 or later, with Developer Mode on
- A USB data cable for the first setup. After that, Wi-Fi works too
Tested on an iPhone 17 Pro with iOS 27.2 and macOS 27.
Install
uv tool install phonectl-mcp
phonectl install-service # runs the server at login on http://127.0.0.1:47321/mcp
phonectl doctor # checks cable, trust, Developer Mode, disk image and server
phonectl setup claude-code # or: codex, gemini (the desktop app), deepseek-harness
Reload the agent as setup says, then ask it for a screenshot of the phone. setup adds the server and its token to the agent's MCP config, the phonectl-scripts skill, and, for Claude Code, Codex and Gemini, a hook that frees the phone when the agent's turn ends (Codex asks you to approve it once). It backs up each file it changes as <file>.phonectl.bak.
Or paste this to your coding agent:
Install phonectl-mcp by following https://github.com/jiefeng-ai/phonectl-mcp#install and connect yourself with
phonectl setup. Runphonectl doctoruntil it passes. When I need to do something on the phone, tell me step by step and wait for me. Finally, tell me how to restart you so the phone tools load.
Other MCP clients (Cursor and others with streamable HTTP)
Add the server by hand. The agent gets the phone but not the skill, so scripts it writes will not know to yield the phone to other agents.
{
"mcpServers": {
"phone": {
"url": "http://127.0.0.1:47321/mcp",
"headers": { "Authorization": "Bearer <contents of ~/.config/phonectl/token>" }
}
}
}
Tools
Coordinates are iOS points, the same as the pixels of the returned screenshot.
| Tool | What it does |
|---|---|
screenshot |
Captures the screen |
read_text |
Text on screen with positions, as JSON. Much cheaper than an image |
tap_text, wait_text |
Tap text found on screen; wait until text appears or goes away |
tap, long_press, swipe |
Touch. To scroll down, swipe upward |
type_text |
Types into the focused field by pasting, so the phone's input method cannot change it; submit with press_key('enter'). method="keys" types key by key, for fields that refuse pasting |
press_key |
A key or chord, such as enter or cmd+a |
press_button |
home, lock, volume-up, volume-down, mute, siri |
launch_app, list_apps |
Opens apps (with url, hands the app a link to open), finds bundle ids |
get_clipboard, set_clipboard |
The phone's clipboard |
status |
The server, the phone link, and who is using the phone |
Tools that act on the phone return a screenshot taken afterwards (screenshot=False skips it). Taps are not confirmed, so check that screenshot.
Scripts. A fixed sequence of steps runs faster and cheaper as a script than as one model round trip per step. A script is one more MCP client of the same server (same URL, same token); never connect to the phone directly. Agents connected with phonectl setup get the full rules in the phonectl-scripts skill.
phonectl hold 30m keeps agents off the phone while you use it; phonectl hold off ends that.
How it works
The server drives the phone through Apple's developer services, using pymobiledevice3. Taps and keys take the same path as Xcode's device mirroring, which is why it needs iOS 27. read_text reads the screen on the Mac with Apple's Vision framework. The only thing put on the phone is Apple's developer disk image, which the server mounts by itself: no WebDriverAgent, no app, no jailbreak.
Troubleshooting
Run phonectl doctor first. It tells you which link is broken.
| Symptom | Fix |
|---|---|
| No iPhone found | Use a data cable, unlock the phone, replug |
| "Mac is not trusted" | Unlock the phone, replug, tap Trust |
| No Developer Mode switch | Run phonectl doctor --fix; the switch appears under Settings › Privacy & Security |
| Disk image install fails | The server installs the developer disk image on first connect and downloads it from GitHub; check the network or proxy, then phonectl restart |
| Taps do nothing | Needs iOS 27+; keep the screen on and unlocked |
| Wi-Fi link drops | A locked phone leaves the network for up to minutes at a time. Unlock it and wait a few seconds |
| Clients cannot connect | phonectl restart, then check ~/Library/Logs/phonectl.error.log. A 401 means the client's token differs from ~/.config/phonectl/token |
Security
- The server listens only on
127.0.0.1and rejects requests without the token. - An agent can do anything your finger can: send messages, pay, delete. Keep its instructions narrow and watch the screen. Use at your own risk; automating third-party apps may break their terms.
Settings
Environment variables (set them, then run phonectl install-service again; restart keeps the old values)
| Variable | Default | Meaning |
|---|---|---|
PHONECTL_UDID |
first connected iPhone | Which phone to use when several are connected |
PHONECTL_PORT |
47321 |
HTTP port (127.0.0.1 only) |
PHONECTL_TOKEN_FILE |
~/.config/phonectl/token |
Where the token is kept |
PHONECTL_SCALE |
3 |
Pixels per point; 2 on iPhone SE, XR, 11. Only affects screenshot size |
PHONECTL_OCR_LANGS |
zh-Hans,en-US |
read_text languages, in priority order |
PHONECTL_SETTLE |
0.6 |
Seconds to wait before the screenshot after an action; settle_ms overrides it per call |
PHONECTL_TOUCH_IDLE |
30 |
Idle seconds before the input stream closes (reopening takes ~0.6 s) |
PHONECTL_KEY_IDLE |
5 |
Seconds without a key before the virtual keyboard detaches, so the on-screen keyboard comes back |
PHONECTL_CALL_TIMEOUT |
15 |
Seconds to wait for the phone, on top of the gesture time |
PHONECTL_IDLE |
90 |
Seconds without a call after which a client that has not said it is done counts as done, if someone waits |
PHONECTL_WAIT |
50 |
Seconds a call waits in line before it ends with WAITING; keep it below the clients' own tool timeouts |
PHONECTL_MAX_HOLD |
1800 |
After holding the phone this long, a client lets a waiting one go first |
PHONECTL_LOG |
WARNING |
Log level (INFO for the service, which logs each call with its client); logs in ~/Library/Logs/phonectl*.log; a log over 10 MB moves to <file>.1, replacing the older one |
Update and uninstall
uv tool upgrade phonectl-mcp && phonectl restart && phonectl update
What changed in each version: Releases.
To uninstall, run phonectl setup --remove <agent> for each agent you connected, then:
phonectl uninstall-service
uv tool uninstall phonectl-mcp
rm -r ~/.config/phonectl
License
MIT
Metadata
Release files for phonectl-mcp 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phonectl_mcp-0.2.1.tar.gz | 176.5 kB | With provenance | Details for phonectl_mcp-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phonectl_mcp-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for phonectl_mcp-0.2.1-py3-none-any.whl |
Total release size: 233.1 kB
Release files / phonectl_mcp-0.2.1.tar.gz
| Download URL | phonectl_mcp-0.2.1.tar.gz |
|---|---|
| Size | 176.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41ea2ee57109dbd6f340d66bef93b88ea68c4578d524a08e3c46558438a66514
|
|
BLAKE2b-256 checksum How to use checksums |
ddec06cb977002a229af0d9c3efa0a452d76df68ef342d1e93f2eaaa41304f72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / phonectl_mcp-0.2.1-py3-none-any.whl
| Download URL | phonectl_mcp-0.2.1-py3-none-any.whl |
|---|---|
| Size | 56.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c28d60a5d8f11f7a4ec2cc1b51b63fb21dc57864eb0a250263990c663ff2678
|
|
BLAKE2b-256 checksum How to use checksums |
1a408fed5d8711062e4de3b428ce2f8df8578d3eba9ea915444b1a390f99d97b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for phonectl-mcp 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for phonectl_mcp-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.