AirPlay Screen
airplay-mcp (MIT, on PyPI) turns this computer into an AirPlay receiver. The user mirrors their iPhone or iPad to it, and you get the screen through MCP tools. Everything stays on this machine. The receiver only listens on the local network and makes no outbound connections.
It only works when this machine is on the same Wi-Fi as the phone. A cloud VM or VPS can't see the phone. Neither can a network behind a VPN or a guest network, because they block mDNS. If that's the setup, tell the user so and stop.
One-time setup
Tell the user what you are about to install or download before you run each step.
-
Install the server:
uv tool install --upgrade airplay-mcporpip install --upgrade airplay-mcp(0.1.4 or later includes the emulator libraries the native receiver needs). Note the absolute path of theairplay-mcpexecutable for step 4, because its install folder is often not on the gateway'sPATH. Check it withairplay-mcp --help. -
Pick a receiver with the user. Recent iOS sends no video until the receiver passes Apple's FairPlay check, and there are two ways to handle that:
- native (default): run the FairPlay code from the user's own iPhone firmware in a local emulator. Any OS, but extraction reads ~2.5 GB of firmware and needs ~20 GB free disk while it runs. The extracted files must never be uploaded or shared.
- uxplay: install UxPlay 1.73 or later, which handles FairPlay itself. Easy on macOS (
brew install uxplay). Linux distro packages are often older (Ubuntu 24.04 ships 1.68), so check the version before choosing it. On Windows it has to be built with MSYS2: follow the README steps.
-
native only: extract the FairPlay files.
- Install ipsw:
brew install blacktop/tap/ipswon macOS. Elsewhere, download the release build for the OS and CPU from its GitHub releases and put it onPATH. On Linux, ipsw also needs apfs-fuse to read the firmware's APFS image (7-Zip is not a substitute: it can't decompress the LZBITMAP files in the dyld cache). Install it from the distro if packaged, or build it from source, and setIPSW_APFS_FUSE_PATHif it isn't onPATH. - Ask the user for the phone model (Settings > General > About) and map it to an identifier such as
iPhone17,3withipsw device-list. - In a POSIX shell, in a folder the user wants to keep (for example
~/airplay-fp), run the commands below. ReplaceMODELwith the identifier.--remotereads only the system image from Apple's CDN (~2.5 GB) instead of downloading the whole IPSW (~13 GB); it takes a few minutes.URL="$(ipsw download ipsw --device MODEL --latest --urls | head -1)" ipsw extract --dyld --dyld-arch arm64e --remote -o fw "$URL" ipsw dyld extract fw/*/dyld_shared_cache_arm64e -o fpdir AirPlayReceiver AirPlaySupport CoreUtils AirPlaySender - Check that
fpdir/holds four files, then deletefw/(~7 GB).
- Install ipsw:
-
Register the MCP server with absolute paths for the command and the FairPlay folder:
- native:
openclaw mcp set airplay '{"command":"/absolute/path/to/airplay-mcp","env":{"AIRPLAY_FP_EMU_DIR":"/absolute/path/to/airplay-fp/fpdir"}}' - uxplay:
Addopenclaw mcp set airplay '{"command":"/absolute/path/to/airplay-mcp","env":{"AIRPLAY_RECEIVER":"uxplay"}}'AIRPLAY_UXPLAY_PATHifuxplayisn't onPATH.
Confirm it with
openclaw mcp list. The tools appear in a new session, or after the gateway reloads. - native:
-
Firewall: the first time the receiver runs, allow it through the firewall. The phone connects over TCP and mDNS (UDP 5353).
Using it
start_receiver, then tell the user: Control Centre > Screen Mirroring > "AI Screen" (PIN3939if asked). With native, the first connection takes about 35 seconds while the emulator warms up.wait_for_changeblocks until the first frame arrives, and afterwards until the screen next changes. Passsince_frame=Nfor the frame you hold.get_screento look, orsave_screento write a full-resolution file and return only its path. Usemode='changes'after the user acts, andregionto read small detail.read_screen_textis cheaper for text-heavy screens, if it is installed.- Repeat 2 and 3, then
stop_receiverwhen done.
Troubleshooting
- The phone doesn't list "AI Screen". Check the network and the firewall (see above).
- It pairs but the screen stays blank (native).
AIRPLAY_FP_EMU_DIRis wrong or incomplete, or airplay-mcp is older than 0.1.4 (uv tool upgrade airplay-mcp). - To see the log:
airplay-mcp --autostart -v(plus--fp-emu-dir <path>or--receiver uxplay).
