Skip to main content

English · 中文

phonectl-mcp

Let AI agents see and drive a real iPhone from your Mac, over USB or Wi-Fi.

PyPI macOS only iOS 27+ MCP server Tests License: MIT

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 jailbreak.

An AI agent makes a rednote post through phonectl-mcp: text card, template, stickers, filter, title and caption A script applies to one job in the BOSS Zhipin app through phonectl-mcp, reading the screen with read_text and tapping
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 (not a charge-only one) for the first setup. After that, Wi-Fi works too

Tested on an iPhone 17 Pro with iOS 27.2 and macOS 27.

Install

Let your agent install it

Paste this to your coding agent (Claude Code, Codex, Cursor…):

Install phonectl-mcp by following https://github.com/jiefeng-ai/phonectl-mcp#install-by-hand, then add it to your MCP config and take a screenshot of my phone to check it works. When I need to do something on the phone, tell me step by step and wait for me.

Install by hand

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

install-service also creates an access token in ~/.config/phonectl/token. Then connect your client:

Claude Code

claude mcp add --scope user --transport http phone http://127.0.0.1:47321/mcp \
  --header "Authorization: Bearer $(cat ~/.config/phonectl/token)"

Cursor (~/.cursor/mcp.json) and other clients with streamable HTTP

{
  "mcpServers": {
    "phone": {
      "url": "http://127.0.0.1:47321/mcp",
      "headers": { "Authorization": "Bearer <contents of ~/.config/phonectl/token>" }
    }
  }
}

To check, ask your agent to take a screenshot of the phone.

After one setup over the cable, it also works over Wi-Fi while the phone and the Mac share a network.

All agents and scripts share this one server, since the phone takes a single control connection; let one agent drive at a time.

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, long_press, swipe Touch. To scroll down, swipe upward
type_text Types into the focused field. Non-ASCII text goes through the clipboard
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, finds bundle ids
get_clipboard, set_clipboard The phone's clipboard
status The server and the phone link

Tools that act on the phone return a screenshot taken afterwards (screenshot=False skips it). Taps are not confirmed, so check that screenshot.

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
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.1 and 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
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_LOG WARNING Log level (INFO for the service); logs in ~/Library/Logs/phonectl*.log

Other commands: phonectl restart (e.g. after uv tool upgrade phonectl-mcp). To remove: phonectl uninstall-service, uv tool uninstall phonectl-mcp, and delete ~/.config/phonectl.

Development

git clone https://github.com/jiefeng-ai/phonectl-mcp
cd phonectl-mcp
uv sync
uv run pytest

uv run phonectl install-service from the clone runs your working copy as the service.

License

MIT

Metadata

Release files for phonectl-mcp 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phonectl-mcp 0.1.3
File Size Uploaded Provenance Actions
phonectl_mcp-0.1.3.tar.gz 131.0 kB With provenance Details for phonectl_mcp-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for phonectl-mcp 0.1.3
File Interpreter ABI Platform Actions
phonectl_mcp-0.1.3-py3-none-any.whl Python 3 none any Details for phonectl_mcp-0.1.3-py3-none-any.whl

Total release size: 156.8 kB

Release files / phonectl_mcp-0.1.3.tar.gz

Download URL phonectl_mcp-0.1.3.tar.gz
Size 131.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f2c155c4a14bf90f4329ff9c166e23a80fb1f21000c4fa89904161ad32d6646b
BLAKE2b-256 checksum
How to use checksums
9e897edacbbda68ac4a57ca3fc46fae3029be60c681efc99666e3b1076a9f334
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 12, 2026.

Transparency log

Release files / phonectl_mcp-0.1.3-py3-none-any.whl

Download URL phonectl_mcp-0.1.3-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
387570de878b4a160c5b7d09e804d3604154044434411c90637ee5695fa38cdf
BLAKE2b-256 checksum
How to use checksums
ec7f8bb09760a03b47ca641c95cdb8418fe5b36fc19c7cd830c59c378790ab22
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 12, 2026.

Transparency log

Security for phonectl-mcp 0.1.3

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.

Select from 2 files

Attestation for phonectl_mcp-0.1.3.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 12, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page