Cursor for iOS development: set up build, autocomplete, Xcode MCP and the simulator
To develop iOS apps in Cursor, install the Swift extension and SweetPad. SweetPad's build server gives SourceKit-LSP autocomplete for Xcode projects and lets you build, run and debug. Then add Xcode's MCP server (xcrun mcpbridge, Xcode 26.3+) or MobileBuildMCP so the agent can build, plus a simulator MCP server.
Last updated:
Cursor is a fork of VS Code, so iOS development in Cursor works through the same pieces as in VS Code. The SweetPad docs say so directly: "Everything here works in Cursor too" (SweetPad: Get started). You still need a Mac with Xcode installed, because builds, the simulator and the Swift toolchain come from Xcode. This guide covers the editor setup and the agent setup. For project rules (.cursor/rules, .mdc), see Cursor rules for SwiftUI.
Which setup do you need?
| Goal | What to install | Steps |
|---|---|---|
| Write Swift with Cursor, build in Xcode | The Swift extension | 1 |
| Autocomplete, build, run and debug inside Cursor | Swift extension + SweetPad (extension and CLI) | 1–2 |
| Cursor's agent builds, tests and reads errors itself | + Xcode's MCP server or MobileBuildMCP | 3–4 |
| Agent taps through the app and checks the UI | + a simulator MCP server | 5 |
| Agent follows your Swift conventions | + rules, AGENTS.md or skills | 6 |
Step 1: Swift extension and autocomplete (SourceKit-LSP)
Install the Swift extension (
swiftlang.swift-vscode) from Cursor's Extensions view. It uses SourceKit-LSP, which ships with Xcode, for code completion. Its README warns that most features only work for Swift Package Manager projects and that "support for Xcode projects (.xcodeproj) is limited" (vscode-swift).Swift package? You're done. SourceKit-LSP reads
Package.swiftnatively (SweetPad: autocomplete).Xcode project or workspace? SourceKit-LSP needs a build server that tells it how each file compiles. Install SweetPad:
The SweetPad extension from the Extensions view.
The SweetPad CLI, which contains the build server:
brew install sweetpad-dev/tap/sweetpad.Then run "SweetPad: Generate Build Server Config" from the command palette. It writes
buildServer.jsonat the workspace root, pointing atsweetpad bsp serve. The built-in server reads compiler arguments from the project, so autocomplete works without building first. If it doesn't, run "SweetPad: Diagnose BSP (Doctor)" (SweetPad: autocomplete).
xcode-build-server instead? Cursor's own Swift page still recommends brew install xcode-build-server and says you have to build once before autocomplete works (cursor.com/for/ios-macos-swift). SweetPad still supports that route as an option: set "sweetpad.buildServer.provider": "xcode-build-server" in .vscode/settings.json and install it with brew install xcode-build-server --head. A workspace with an existing buildServer.json from xcode-build-server keeps that tool. For reference, xcode-build-server (MIT, 1,012★) last had a push on 31 Jan 2026.
Step 2: Build, run and debug with SweetPad
Build and run. Open the folder that contains the
.xcodeprojor.xcworkspace, not the project file itself. In the SweetPad sidebar (🍭), click ▶️ next to a scheme and pick a simulator or device (SweetPad: Get started).Debug (F5). Create
.vscode/launch.jsonwith a SweetPad configuration. With the SweetPad CLI installed, SweetPad usessweetpad dap(Xcode's lldb-dap) and needs no further setup; without the CLI it falls back to CodeLLDB (SweetPad: debugging):
json
{
"version": "0.2.0",
"configurations": [
{ "type": "sweetpad-lldb", "request": "launch", "name": "SweetPad: Build and Run" }
]
}In the terminal / for the agent. The same CLI works without the extension:
sweetpad run --on "iPhone 16 Pro"builds, installs, launches and streams logs;sweetpad test --on bootedruns tests (SweetPad README). The device name is the README's example; use one of your simulators.
Step 3: Xcode's built-in MCP server (Xcode 26.3+)
Xcode 26.3 and later ship an MCP server, reached through xcrun mcpbridge. Cursor's docs list 20 tools: file operations, BuildProject, GetBuildLog, tests, the Issue Navigator, RenderPreview (SwiftUI preview screenshots) and DocumentationSearch (Cursor: Xcode).
In Xcode: Settings → Intelligence → Model Context Protocol → Xcode Tools on.
In Cursor, add the server to
~/.cursor/mcp.json, or runagent mcp add xcode-tools -- xcrun mcpbridgein the Cursor CLI:
json
{ "mcpServers": { "xcode-tools": { "command": "xcrun", "args": ["mcpbridge"] } } }Cursor's docs list three prerequisites: Xcode 26.3+, a paid Cursor plan, and Xcode running with the project open. If you get unable to find utility "mcpbridge", run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer (Cursor: Xcode).
The community mcpbridge-wrapper addresses one problem: its README says it repairs Xcode tool responses that declare an outputSchema but omit structuredContent, and that its broker mode shares one Xcode connection between clients, so you get fewer connection prompts.
Step 4: MobileBuildMCP (formerly XcodeBuildMCP)
MobileBuildMCP is a separate MCP server and CLI for building, testing, running and debugging iOS and macOS apps. Its docs list up to 82 tools across 15 workflows (mobilebuildmcp.com/docs). GitHub redirects getsentry/XcodeBuildMCP to getsentry/MobileBuildMCP. For Cursor, the docs recommend a project-scoped .cursor/mcp.json (MobileBuildMCP: clients):
json
{ "mcpServers": { "MobileBuildMCP": { "command": "npx", "args": ["-y", "mobilebuildmcp@latest", "mcp"] } } }Using the global ~/.cursor/mcp.json instead? Add "env": { "MOBILEBUILDMCP_CWD": "${workspaceFolder}" }. Workflows, setup and errors: XcodeBuildMCP setup.
Xcode MCP or MobileBuildMCP? Xcode's server requires Xcode to be running with the project open, and adds SwiftUI previews and Apple's documentation search. MobileBuildMCP doesn't go through Xcode's MCP bridge. It brings its own simulator and device tools, and device tools need code signing configured in Xcode (README). The two don't exclude each other. More options: best MCP servers for Xcode.
Step 5: A simulator MCP server
For the agent to tap through your app, read the screen and take screenshots, add a simulator server to the same mcp.json. Example from the mobile-mcp README (Cursor Settings → MCP → Add new MCP Server, command type):
json
{ "mcpServers": { "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] } } }By default, Cursor asks for approval before every MCP tool call. You enable or disable servers under Customize (Cursor: MCP). Full comparison: iOS simulator MCP servers compared.
Step 6: Rules, AGENTS.md and skills
Rules: project rules go in
.cursor/rules/*.mdc; plain markdown goes inAGENTS.md(Cursor: rules). How to scope rules to.swiftfiles, and which ready-made rule files exist: Cursor rules for SwiftUI.Skills: Cursor loads skills from
.agents/skills/,.cursor/skills/,~/.agents/skills/and~/.cursor/skills/, and for compatibility also from.claude/skills/and~/.claude/skills/(Cursor: skills). So the SwiftUI skills for Claude Code work in Cursor too: SwiftUI agent skills.SweetPad skills:
npx skills add sweetpad-dev/sweetpadinstalls skills that teach the agent to use thesweetpadCLI, with JSON output and destination selection (SweetPad: agent skills).
Tools for iOS in Cursor, compared
Only catalog entries whose README documents Cursor (or any MCP client), sorted by group and then by stars. ⚠ = last push more than 6 months ago.
| Tool | Group | What it does in Cursor | Cursor setup (from README) | License | ★ (21 Oct) | Last push |
|---|---|---|---|---|---|---|
| SweetPad (sweetpad-dev) | Editor / build | Build, run, debug, test; SourceKit-LSP build server; agent skills | Extension + brew install sweetpad-dev/tap/sweetpad | MIT | 1,913 | 14 Oct 2026 |
| MobileBuildMCP (getsentry) | Build MCP | Build, test, run, debug, simulator and device | .cursor/mcp.json: npx -y mobilebuildmcp@latest mcp | MIT | 6,497 | 21 Oct 2026 |
| mcpbridge-wrapper (SoundBlaster) | Build MCP | Wrapper around xcrun mcpbridge with a response fix and broker mode | ~/.cursor/mcp.json: uvx --from mcpbridge-wrapper==0.5.0 mcpbridge-wrapper --broker | MIT | 20 | 25 Sep 2026 |
| xcf (CodeFreezeAI) | Build MCP | Swift MCP server for Xcode project automation | ~/.cursor/mcp.json (per README) | MIT | 11 | 16 Oct 2026 |
| mobile-mcp (mobile-next) | Simulator | Drives apps on simulator, device and Android | Command npx -y @mobilenext/mobile-mcp@latest | Apache-2.0 | 9,856 | 18 Oct 2026 |
| agent-device (callstack) | Simulator | Accessibility snapshots, taps, input, screenshots | npm install -g agent-device@latest, MCP agent-device mcp | MIT | 5,093 | 21 Oct 2026 |
| serve-sim (EvanBacon) | Simulator | Streams the simulator to the browser at 60 fps, with an agent skill | npx serve-sim | Apache-2.0 | 2,891 | 17 Oct 2026 |
| iosef (riwsky) | Simulator | CLI + stdio MCP: tap, swipe, type, accessibility tree, logs | uv tool install iosef, MCP iosef mcp | MIT | 19 | 27 Sep 2026 |
| simfast (iamxicor) | Simulator | Screen as compact text instead of screenshots, fast taps | {"command":"npx","args":["-y","github:iamxicor/simfast","mcp"]} | MIT | 11 | 3 Oct 2026 |
| iOS Simulator MCP (simctl) (adborroto) | Simulator | simctl + AppleScript: devices, UI, apps, logs, video | .cursor/mcp.json: uvx ios-simulator-mcp | MIT | 0 | 24 Jul 2026 |
| Apple Docs MCP (kimsungwhee) ⚠ | Docs | Apple documentation, WWDC videos, APIs | ~/.cursor/mcp.json: npx -y @kimsungwhee/apple-docs-mcp | MIT | 1,383 | 17 Mar 2026 |
| apple-docs (g-cqd) | Docs | Apple docs offline: API, HIG, WWDC, SF Symbols | apple-docs mcp install prints the client config | MIT | 26 | 19 Oct 2026 |
| Instruments MCP (nemanjavlahovic) | Profiling | Instruments traces as structured data | npx -y instrumentsmcp@latest | MIT | 19 | 11 Sep 2026 |
Not in the table: Xcode's own MCP server (part of Xcode, no repository; see step 3) and xcode-build-server (last push older than 6 months, so not in the catalog; see step 1).
Common problems
| Problem | Cause / fix | Source |
|---|---|---|
| No autocomplete in an Xcode project | No buildServer.json → "SweetPad: Generate Build Server Config", then "SweetPad: Diagnose BSP (Doctor)" | SweetPad docs |
| Autocomplete broken in a Swift package | A leftover buildServer.json overrides native package support → delete it | SweetPad docs |
Cursor can't find xcode-tools | Xcode isn't running or has no project open | Cursor docs |
unable to find utility "mcpbridge" | Command Line Tools selected instead of Xcode → xcode-select -s (step 3) | Cursor docs |
| MobileBuildMCP builds the wrong folder (global config) | Set MOBILEBUILDMCP_CWD to ${workspaceFolder} | MobileBuildMCP docs |
FAQ
- Can you develop iOS apps in Cursor?
- Yes, on a Mac with Xcode installed. Cursor edits the code; Xcode's toolchain builds it. With the Swift extension and SweetPad you get autocomplete, build, run and debugging inside Cursor, and MCP servers let Cursor's agent build, test and drive the simulator.
- How do I get Swift autocomplete for an Xcode project in Cursor?
- Install the Swift extension and SweetPad, plus the SweetPad CLI with brew install sweetpad-dev/tap/sweetpad. Then run "SweetPad: Generate Build Server Config". It writes buildServer.json so SourceKit-LSP knows how each file compiles. Swift packages work without this step.
- Do I still need xcode-build-server for Cursor?
- Not necessarily. SweetPad now has its own build server that reads compiler arguments from the project without a build. xcode-build-server is still supported as an option via the sweetpad.buildServer.provider setting, and existing setups keep working.
- How do I connect Cursor to Xcode's MCP server?
- Use Xcode 26.3 or later and turn on Settings > Intelligence > Model Context Protocol > Xcode Tools. Then add {"command":"xcrun","args":["mcpbridge"]} as xcode-tools in ~/.cursor/mcp.json. Cursor's docs require a paid Cursor plan and Xcode running with the project open.
- Can Cursor run my app in the iOS Simulator?
- Yes. SweetPad builds and launches the app on a simulator from the sidebar or with sweetpad run. For the agent, MobileBuildMCP can build and run, and a simulator MCP server such as mobile-mcp lets it tap, type and take screenshots.