iPhone MCP

io.github.DamienDrash由 GitHub 帳號 DamienDrash 發布v0.9.0更新於 Nov 19, 2026

See and control a real iPhone over USB or Wi-Fi: screenshots, UI tree, taps, swipes, typing, apps.

發布方自己的服務:PhoneMCP: AI-powered texts

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

讓助理透過 USB 或 Wi-Fi 檢視並操控實體 iPhone:截圖、UI 樹、點擊、滑動、輸入、啟動 App 和開啟深層連結。

可以做什麼
  • 啟動與停止手機上的 WebDriverAgent,查看連線、螢幕尺寸、鎖定狀態和前景 App
  • 擷取以 iOS 點為單位縮放的螢幕截圖,讀取含文字與中心點的可見 UI 樹
  • 點擊、連點、長按、依文字點擊、滑動、捲動、雙指縮放、輸入文字,以及按 Home 或音量鍵
  • 等待文字出現或消失,不必猜測延遲時間
  • 依名稱或 bundle ID 列出、啟動和關閉 App,並開啟網址或深層連結
  • 鎖定或喚醒螢幕,並開關保持螢幕常亮
適用情境
適合讓助理操作實機而非模擬器的情境:走查 App 各頁面、測試註冊流程並逐步截圖,或讀取手機螢幕上的內容。
執行需求
以 uvx 執行的本機 Python 程序;需要一台開啟開發者模式和 UI 自動化的實體 iPhone,並已透過傳輸線信任配對。WebDriverAgent 需以 Apple ID 建置並簽署,這需要裝有 Xcode 的 Mac,或在 Linux 與 Windows 上使用已簽署的預建 App。選用變數包括 IPHONE_MCP_MODE、IPHONE_MCP_UDID 和 IPHONE_MCP_WDA_URL。
安裝前請注意
助理將直接操作帶有真實帳號、訊息和付款方式的手機;README 要求它在傳訊息、購買、付款、刪除資料或變更安全設定前先徵求同意,請保持用戶端的工具核准開啟。WebDriverAgent 執行期間會在手機上無驗證地監聽 8100 埠,請只在可信任網路使用,用完即停止。免費 Apple ID 的簽章約 7 天後過期。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 iPhone MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[iphone-mcp – let AI agents see and control your real iPhone]

[CI] [PyPI] [Python] [MCP] [Platforms] [License: GPL v3] [Sponsor]

An MCP server that gives Claude Code, OpenAI Codex and any other MCP client
eyes and hands on a real, physical iPhone – over a cable or Wi-Fi.

Quick start · Tools · Wi-Fi · Linux & Windows · Reliability · Safety · Troubleshooting · Sponsor ❤


✨ Highlights

👀 Sees the screen

Screenshots come scaled to iOS points, so every pixel the model sees is a coordinate it can tap. The UI tree turns the screen into compact text with labels and positions. It is faster, cheaper and more precise than pixels.

👆 Acts like a person

Tap, double-tap, long-press, tap by text, swipe, scroll, pinch-zoom, type, press Home and the volume buttons, and wait for text to appear instead of guessing delays. It can also launch apps by name ("Settings", "Einstellungen") and open URLs and deep links.

📶 Cable or Wi-Fi

It picks the best route on its own: the Xcode tunnel, then usbmux, then the iPhone's last known Wi-Fi IP. If the cable drops out, it reconnects over Wi-Fi.

🔆 Stays awake

While an agent is connected, the screen doesn't auto-lock. It sends an invisible touch just outside the display, and no settings are changed. This works even in Low Power Mode, where Auto-Lock is fixed at 30 s.

🔐 Your device, your signature

No jailbreak, no third-party cloud. WebDriverAgent is built and signed with your own Apple ID (a free one works), and all traffic stays between your computer and your phone.

🐧 Not only macOS

On Linux and Windows, WebDriverAgent starts without Xcode through pymobiledevice3's root-free tunnel. iphone-mcp doctor checks the whole chain.

🚀 Quick start

You need: uv, an iPhone with an Apple ID, and a Mac with Xcode (for Linux / Windows see below).

1 · Prepare the iPhone (once)

  • Connect it by cable, unlock it and tap Trust.
  • Settings → Privacy & Security → Developer Mode → on (the phone restarts).
  • Settings → Developer → Enable UI Automation → on.

2 · Build WebDriverAgent (once, and again after Xcode updates)

bash
uvx iphone-mcp doctor     # checks Xcode, signing, iPhoneuvx iphone-mcp setup      # builds & installs WebDriverAgent, signed with your Apple ID

3 · Add it to your agent

Claude Code
bash
claude mcp add iphone -s user -- uvx iphone-mcp
OpenAI Codex

~/.codex/config.toml

toml
[mcp_servers.iphone]command = "uvx"args = ["iphone-mcp"]tool_timeout_sec = 180   # starting the agent can take a minute
Claude Desktop, Cursor, VS Code & other MCP clients
json
{  "mcpServers": {    "iphone": { "command": "uvx", "args": ["iphone-mcp"] }  }}
From a git checkout
bash
git clone https://github.com/DamienDrash/iphone-mcp.git && cd iphone-mcpuv run iphone-mcp setupclaude mcp add iphone -s user -- uv --directory "$PWD" run iphone-mcp

4 · Ask, for example:

“Start the iPhone agent, open Settings and tell me which Wi-Fi I'm on.”

“Open the App Store, search for ‘Duolingo’ and show me the rating – don't install anything.”

“Test the sign-up flow of my TestFlight build and screenshot every step.”

🧠 How it works

mermaid
flowchart LR    A["Claude Code · Codex<br/>any MCP client"] -- stdio --> B["iphone-mcp"]    B -- "HTTP :8100<br/>Xcode tunnel · usbmux · Wi-Fi IP" --> C["WebDriverAgent<br/>on the iPhone"]    B -. "launch: xcodebuild (macOS)<br/>or pymobiledevice3 (any OS)" .-> C    C -- XCUITest --> D["iOS UI"]

WebDriverAgent is the XCUITest-based agent that Appium also uses. It runs as a test runner on the iPhone and exposes the UI over HTTP. iphone-mcp:

  • builds or installs it,
  • starts it with xcodebuild or with pymobiledevice3's XCUITest service,
  • keeps one connection alive across cable and Wi-Fi,
  • turns it all into a handful of tools a model can use well.

🧰 Tools

ToolWhat it does
iphone_start_agent · iphone_stop_agentStart / stop WebDriverAgent (cable or Wi-Fi)
iphone_statusConnection, screen size, lock state, keep-awake, foreground app
iphone_screenshotScreenshot scaled to iOS points – image pixels = tap coordinates
iphone_ui_treeVisible elements with text and center point
iphone_wait_forWait until a text appears (or disappears) – no guessing of delays
iphone_tapTap, double-tap or long-press at coordinates
iphone_tap_textTap the element showing a given text
iphone_swipe · iphone_scrollSwipe / scroll in any direction
iphone_pinchTwo-finger pinch to zoom in or out
iphone_typeType into the focused field, optionally press Return
iphone_press_buttonHome, volume up, volume down
iphone_lockLock, or wake/unlock (without passcode)
iphone_keep_awakeTurn the no-auto-lock behaviour on or off
iphone_list_apps · iphone_launch_app · iphone_close_appList, launch (name or bundle ID), terminate apps
iphone_open_urlOpen a URL or deep link

📶 Wi-Fi

  1. Connect the iPhone by cable once. In Xcode open Window → Devices and Simulators, select the iPhone and tick Connect via network.
  2. Put the iPhone and your Mac on the same Wi-Fi. The iPhone must be on Wi-Fi, not only on mobile data.
  3. Unplug. uvx iphone-mcp doctor should now say connected via Wi-Fi.

iphone-mcp uses the tunnel that Xcode itself keeps to the phone. That tunnel works the same over cable and Wi-Fi, so a flaky cable is not a problem once Wi-Fi is set up.

🔆 Screen lock

SituationWhat happens
Agent connectedKeep-awake stops the screen from auto-locking. Turn it off with iphone_keep_awake(false) or IPHONE_MCP_KEEP_AWAKE=0.
Phone already lockedThe tools say so. The agent can wake the screen; you enter the passcode or use Face ID – the agent can't, by design.
Starting the agentNeeds an unlocked iPhone (Xcode's rule). The agent is told to ask you, and the start continues by itself once you unlock.

🐧 Linux & Windows

Everything except building WebDriverAgent works without a Mac. iphone-mcp starts WebDriverAgent through pymobiledevice3's XCUITest service and its root-free userspace tunnel (iOS 17.4+), over USB or Wi-Fi.

bash
uvx iphone-mcp setup --prebuilt          # downloads Appium's prebuilt, unsigned WebDriverAgent (.ipa)# sign it with your Apple ID – Sideloadly (Windows, free Apple ID) or zsign (Linux, paid account)uvx iphone-mcp setup --ipa signed.ipa    # installs it over USB and remembers its bundle IDuvx iphone-mcp start                     # or let your agent call iphone_start_agent
macOSLinuxWindows
Build & sign WebDriverAgent✅ setup➖ sign the prebuilt .ipa➖ sign the prebuilt .ipa
Install WebDriverAgent✅✅ setup --ipa✅ setup --ipa
Start WebDriverAgent✅ Xcode or pymobiledevice3✅ pymobiledevice3✅ pymobiledevice3
Control over USB✅✅ needs usbmuxd✅ needs Apple Devices / iTunes
Control over Wi-Fi✅✅ IPHONE_MCP_MODE=wifi after one USB pairing✅ IPHONE_MCP_MODE=wifi after one USB pairing

You can also leave WebDriverAgent running from a Mac and drive it from anywhere on the network:

bash
IPHONE_MCP_WDA_URL=http://<iphone-ip>:8100 uvx iphone-mcp

Tested on

SetupStatus
macOS 27 + Xcode 27 · iPhone 15 Pro Max, iOS 26.6 · cable and Wi-Fi✅ full test incl. iphone-mcp selftest
Starting WebDriverAgent without Xcode (pymobiledevice3, root-free tunnel) · over USB and over Wi-Fi sync✅ selftest passed over USB
Linux (Ubuntu 26.04 VM) driving the iPhone over Wi-Fi with IPHONE_MCP_WDA_URL · setup --prebuilt on Linux✅
RemotePairing Wi-Fi without a Mac (IPHONE_MCP_MODE=wifi)⚠️ not tested yet
Real Linux / Windows hosts launching WebDriverAgent · iOS 17 and 18⚠️ not tested yet – CI covers Linux and Windows without a device

Help wanted: if you run iphone-mcp on iOS 17/18, Windows or Linux, please open an issue with the output of iphone-mcp doctor and iphone-mcp selftest, even if everything works.

⌨️ Command line

Command
iphone-mcpRun the MCP server on stdio (what your client starts)
iphone-mcp doctorCheck Xcode / signing / iPhone / connection
iphone-mcp setup [--udid …] [--team …]Build & install WebDriverAgent with Xcode
iphone-mcp setup --prebuilt · --ipa FILEWithout Xcode: download the prebuilt app / install a signed one
iphone-mcp selftestTry the tools on the iPhone with harmless actions (Settings, scrolling, back)
iphone-mcp start · stopStart / stop WebDriverAgent without an MCP client

⚙️ Configuration

Environment variableMeaning
IPHONE_MCP_UDIDPick a device when several iPhones are connected
IPHONE_MCP_MODEauto (default), usb or wifi
IPHONE_MCP_WDA_URLFixed WebDriverAgent address, e.g. http://192.168.1.42:8100
IPHONE_MCP_KEEP_AWAKE1 (default) keeps the screen awake while connected, 0 turns it off
IPHONE_MCP_AUTO_RECOVER1 (default) restarts WebDriverAgent and retries once if it crashed or the link dropped
IPHONE_MCP_STOP_ON_EXIT1 (default) stops WebDriverAgent when the last iphone-mcp server exits; 0 leaves it running
IPHONE_MCP_LAUNCHERxcodebuild (default on macOS) or pymobiledevice3
IPHONE_MCP_TEAM_ID · IPHONE_MCP_BUNDLE_IDSigning team and bundle ID for setup
IPHONE_MCP_RUNNER_BUNDLE_IDBundle ID of an installed WebDriverAgent runner (no-Xcode launch)
IPHONE_MCP_WDA_REFWebDriverAgent release to build or download (default: a tested one)

iphone-mcp writes files only to these places, never to your project:

WhatmacOSLinux / Windows
Config~/.config/iphone-mcp/~/.config/iphone-mcp/
WebDriverAgent source and builds~/Library/Application Support/iphone-mcp/~/.local/share/iphone-mcp/
Logs~/Library/Logs/iphone-mcp/~/.local/share/iphone-mcp/logs/

🔁 Reliability

  • Self-healing: if WebDriverAgent crashes or the cable drops mid-session, the next tool call restarts it and retries once. If that is impossible (for example because the iPhone is locked), the tool says why.
  • Several agent windows, one iPhone: every iphone-mcp process joins the running WebDriverAgent session instead of replacing it, and none stops the agent while another still uses it.
  • Cleans up: when the last iphone-mcp server exits, WebDriverAgent is stopped, so port 8100 is not left open on the phone. An agent you started by hand with iphone-mcp start keeps running.
  • Check it yourself: iphone-mcp selftest drives the real phone through a harmless sequence and prints ✓/✗ per step.

📐 Versioning

iphone-mcp follows Semantic Versioning. The public interface is the set of MCP tools, their parameters and annotations, the CLI commands and the environment variables documented here.

  • 0.9 is the release candidate for 1.0 (now): the interface is frozen; until 1.0 only fixes and documentation change. Earlier 0.x releases could still rename or merge tools (see the CHANGELOG).
  • From 1.0 on: tools and parameters are only removed or renamed in a new major version. A tool that is going away is first marked deprecated in its description and the CHANGELOG, and keeps working for at least one minor release. New optional parameters and new tools come in minor releases.
  • The interface is pinned by a snapshot test (tests/api_contract.json), so no change slips through by accident.

🛡️ Safety

This gives an AI agent hands on your real phone, with your accounts, messages and payment methods.

  • The server tells the agent to ask before anything with real-world effect: sending messages, purchases, payments, deleting data, changing account or security settings. Watch what it does anyway, and keep your client's tool approvals on.
  • iphone-mcp never types passwords or passcodes.
  • While WebDriverAgent runs, it listens on port 8100 on the iPhone without authentication. Use trusted networks only, and stop it when you're done (iphone-mcp stop).

See SECURITY.md for how to report vulnerabilities.

🩺 Troubleshooting

SymptomFix
Unable to find a destination matching … id:The iPhone isn't connected right now – replug, unlock, run iphone-mcp doctor.
“Unlock … to Continue” / “device is locked”Unlock the iPhone; the start continues by itself.
unavailable after unpluggingWi-Fi isn't set up – see Wi-Fi. Is the iPhone on the same Wi-Fi as the computer?
Signing errors during setupXcode → Settings → Accounts: sign in. Use --team if you're in several teams.
Worked yesterday, not today (free Apple ID)The signature expired after 7 days – run iphone-mcp setup again.
Runner exits immediatelySettings → Developer → Enable UI Automation, and trust the developer app under General → VPN & Device Management.

Logs: ~/Library/Logs/iphone-mcp/wda.log (runtime) and build.log (setup).

🤝 Contributing

Issues and pull requests are welcome – see CONTRIBUTING.md. Run the checks with:

bash
uv sync && uv run pytest && uv run mypy && uv run ruff check . && uv run ruff format --check .

👤 Author

Built by Damien Frigewski – @DamienDrash.

💖 Support the project

iphone-mcp is free and open source, and it stays that way. If it saves you time, you can support its development through GitHub Sponsors. Monthly and one-time options are available, and every amount helps. Sponsors get nothing extra in the software; it's simply a thank-you that keeps the work going.

[Sponsor Damien Frigewski on GitHub]

A ⭐ on GitHub helps too – it makes iphone-mcp easier for others to find.

📄 License & credits

GPL-3.0-or-later. The GPL follows from pymobiledevice3, which iphone-mcp builds on.

WebDriverAgent (BSD-3-Clause, © Meta Platforms and Appium contributors) is downloaded and built or installed on your own machine; it is not redistributed here.

Not affiliated with Apple. iPhone, iOS and Xcode are trademarks of Apple Inc.

來源:README.md,提交 46e38ae

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.9.0最新Nov 19, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Phone-Mcp 整合