Let Claude Code build and ship your iOS app on a cloud Mac
Claude Code, Codex and Cursor can write Swift. They cannot build it without a Mac, because Xcode only runs on macOS. So every MacRun Mac now comes with an MCP server for Xcode. Your agent stays on your own computer. The builds, tests and the Simulator run on the rented Mac. The agent even gets a screenshot of the running app. You set it up with one command.
What the MCP server does
MCP is the way coding agents call outside tools. Ours is a small program at /opt/macrun/bin/macrun-mcp on your Mac. It is plain Python with no extra packages. Your agent starts it over SSH, the same SSH access you already have. Nothing new is opened to the internet. These are the tools your agent gets:
- check_setup: the Xcode version, simulators, free disk and API keys.
- clone_repo, list_projects, list_schemes: get the code and find what to build.
- list_simulators, build, run_tests: build for the Simulator and run your tests.
- run_app: build, install and launch the app in the Simulator, then return a screenshot the agent can see.
- screenshot, open_url: look at the screen again, or open a deep link.
- app_logs, read_log: read errors from the app or from a build log.
- upload_testflight: archive a Release build and send it to App Store Connect.
A failed build does not dump thousands of lines on the agent. It gets the error lines and the path to the full log. That keeps its context small, so it can keep going for longer.
What happened when we tried it
On November 29, 2026, we gave Claude Code only these tools and a small SwiftUI sample app on one of our Macs. It found the project on its own. It ran the test, and 1 test passed. It launched the app on an iPhone 18 Pro simulator. Then it described the screen correctly: "Hello, MacRun!"
Next we broke the code on purpose. The build came back with just the one compile error line, so the fix was obvious. Last, we called upload_testflight with no API key on the Mac. It answered with a clear message saying where to put the key.
Set up the Xcode MCP server in Claude Code
First, SSH into your Mac once from your own computer. The address is in your portal. Tailscale signs you in, so you need no password and no key. Answer yes when SSH asks about the host key. Your computer saves it, and the agent can connect later without a prompt.
ssh runner@<your Mac's address>
Then add the server to Claude Code, on your own computer:
claude mcp add macrun -- ssh runner@<your Mac's address> /opt/macrun/bin/macrun-mcp
Start Claude Code and ask it to call check_setup on macrun. It should answer with the Xcode version and the list of simulators. If it cannot connect, run the plain SSH command again and check that Tailscale is on.
Set it up in Codex
Codex has the same kind of command:
codex mcp add macrun -- ssh runner@<your Mac's address> /opt/macrun/bin/macrun-mcp
Codex stops a tool call after 60 seconds by default. Most iOS builds take longer. So open ~/.codex/config.toml and raise the limit for this server:
[mcp_servers.macrun] command = "ssh" args = ["runner@<your Mac's address>", "/opt/macrun/bin/macrun-mcp"] tool_timeout_sec = 2700
Build an iOS app from Cursor without a Mac
Cursor reads MCP servers from ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project:
{
"mcpServers": {
"macrun": {
"type": "stdio",
"command": "ssh",
"args": ["runner@<your Mac's address>", "/opt/macrun/bin/macrun-mcp"]
}
}
}Other agents work too. The command is always ssh, and the arguments are your address and the server path. Check your agent's MCP docs for where the config goes and how to raise its tool timeout. This works from Windows, Linux or a Chromebook, as long as the agent can run ssh.
Get your code onto the Mac
For a public repository, just ask the agent to clone it. clone_repo runs git on the Mac and puts the code in ~/projects.
A private repository needs git access on the Mac first, because the clone runs there. SSH in and sign in with gh auth login, or add a deploy key for that repository. You can also copy a folder over with scp or rsync, then point the agent at it.
A normal working loop
A first prompt can be as plain as this:
Use the macrun tools. Clone github.com/you/myapp, run the tests, then run the app and tell me what the first screen shows.
From there, the agent edits code on your computer, pushes or copies it to the Mac, and builds again. When something fails, it reads the error lines. If it needs more, it calls read_log on the full log. After a UI change, run_app gives it a fresh screenshot to check its own work.
The first build of a big project is the slow one. A cold build can take several minutes while Xcode compiles every dependency. Later builds reuse that work. The server allows up to 45 minutes per build, so long builds finish instead of timing out.
Ship it to TestFlight
upload_testflight archives a Release build and uploads it with Apple's own xcodebuild export, using automatic signing. It needs two things from you:
- A paid Apple Developer Program membership, 99 USD a year.
- An App Store Connect API key. Create it in App Store Connect under Users and Access, then Integrations. Copy the file
AuthKey_<KEYID>.p8to~/private_keyson the Mac.
Then the agent calls upload_testflight with your team ID, key ID and issuer ID. Apple processes the build before it shows up in TestFlight. We have not yet done a real upload with this tool ourselves, so treat it as new. Not sure you need the paid account? Read whether you can publish without an Apple Developer account.
What it cannot do
- No physical iPhone over USB. Everything runs in the Simulator. To try the app on your own phone, send it through TestFlight.
- Your agent runs on your computer. If your laptop sleeps, the agent stops, even though the Mac stays on. To keep an agent working all night, run it on the Mac itself. See running Claude Code 24/7 on a Mac and why Claude Code stops when a Mac sleeps.
Which plan you need
The MCP server is on every MacRun Mac you can SSH into. That includes the runner plan at $139 a month, the agent plan at $169 a month, and the day pass at $15. The agent plan also has Claude Code and Codex installed on the Mac, for the day you want the agent to live there too. Compare them on the pricing page. If you would rather give your agent written instructions than tools, our AGENTS.md for building an iOS app with Codex does that.
Frequently asked questions
Can Claude Code build an iOS app without a Mac?
+
It can write the code anywhere, but building needs Xcode, which only runs on macOS. Connect Claude Code to a rented Mac with an MCP server. It then builds, runs tests and launches the app in the Simulator there.
Is there an MCP server for Xcode on MacRun Macs?
+
Yes. Every MacRun Mac has one at /opt/macrun/bin/macrun-mcp. Your agent starts it over SSH. It can build, run tests, launch the app in the Simulator with a screenshot, read logs and upload to TestFlight.
Does it work with Cursor and Codex?
+
Yes. Any agent that supports MCP servers over stdio can use it. The command is ssh, with your Mac's address and /opt/macrun/bin/macrun-mcp as the arguments. In Codex, raise tool_timeout_sec, because the default is 60 seconds.
Can the agent test on a real iPhone?
+
Not over USB. The agent works with the iOS Simulator on the Mac. To run the app on your own iPhone, upload a build to TestFlight and install it from there.
Does the MCP server open a port to the internet?
+
No. It is not a network service. Your agent starts it through SSH over Tailscale, the access you already have, and it stops when the agent disconnects.