Skip to content
SwiftSkills

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?

GoalWhat to installSteps
Write Swift with Cursor, build in XcodeThe Swift extension1
Autocomplete, build, run and debug inside CursorSwift extension + SweetPad (extension and CLI)1–2
Cursor's agent builds, tests and reads errors itself+ Xcode's MCP server or MobileBuildMCP3–4
Agent taps through the app and checks the UI+ a simulator MCP server5
Agent follows your Swift conventions+ rules, AGENTS.md or skills6

Step 1: Swift extension and autocomplete (SourceKit-LSP)

  1. 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).

  2. Swift package? You're done. SourceKit-LSP reads Package.swift natively (SweetPad: autocomplete).

  3. 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.json at the workspace root, pointing at sweetpad 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 .xcodeproj or .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.json with a SweetPad configuration. With the SweetPad CLI installed, SweetPad uses sweetpad 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 booted runs 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).

  1. In Xcode: Settings → Intelligence → Model Context Protocol → Xcode Tools on.

  2. In Cursor, add the server to ~/.cursor/mcp.json, or run agent mcp add xcode-tools -- xcrun mcpbridge in 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 in AGENTS.md (Cursor: rules). How to scope rules to .swift files, 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/sweetpad installs skills that teach the agent to use the sweetpad CLI, 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.

ToolGroupWhat it does in CursorCursor setup (from README)License★ (21 Oct)Last push
SweetPad (sweetpad-dev)Editor / buildBuild, run, debug, test; SourceKit-LSP build server; agent skillsExtension + brew install sweetpad-dev/tap/sweetpadMIT1,91314 Oct 2026
MobileBuildMCP (getsentry)Build MCPBuild, test, run, debug, simulator and device.cursor/mcp.json: npx -y mobilebuildmcp@latest mcpMIT6,49721 Oct 2026
mcpbridge-wrapper (SoundBlaster)Build MCPWrapper around xcrun mcpbridge with a response fix and broker mode~/.cursor/mcp.json: uvx --from mcpbridge-wrapper==0.5.0 mcpbridge-wrapper --brokerMIT2025 Sep 2026
xcf (CodeFreezeAI)Build MCPSwift MCP server for Xcode project automation~/.cursor/mcp.json (per README)MIT1116 Oct 2026
mobile-mcp (mobile-next)SimulatorDrives apps on simulator, device and AndroidCommand npx -y @mobilenext/mobile-mcp@latestApache-2.09,85618 Oct 2026
agent-device (callstack)SimulatorAccessibility snapshots, taps, input, screenshotsnpm install -g agent-device@latest, MCP agent-device mcpMIT5,09321 Oct 2026
serve-sim (EvanBacon)SimulatorStreams the simulator to the browser at 60 fps, with an agent skillnpx serve-simApache-2.02,89117 Oct 2026
iosef (riwsky)SimulatorCLI + stdio MCP: tap, swipe, type, accessibility tree, logsuv tool install iosef, MCP iosef mcpMIT1927 Sep 2026
simfast (iamxicor)SimulatorScreen as compact text instead of screenshots, fast taps{"command":"npx","args":["-y","github:iamxicor/simfast","mcp"]}MIT113 Oct 2026
iOS Simulator MCP (simctl) (adborroto)Simulatorsimctl + AppleScript: devices, UI, apps, logs, video.cursor/mcp.json: uvx ios-simulator-mcpMIT024 Jul 2026
Apple Docs MCP (kimsungwhee) ⚠DocsApple documentation, WWDC videos, APIs~/.cursor/mcp.json: npx -y @kimsungwhee/apple-docs-mcpMIT1,38317 Mar 2026
apple-docs (g-cqd)DocsApple docs offline: API, HIG, WWDC, SF Symbolsapple-docs mcp install prints the client configMIT2619 Oct 2026
Instruments MCP (nemanjavlahovic)ProfilingInstruments traces as structured datanpx -y instrumentsmcp@latestMIT1911 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

ProblemCause / fixSource
No autocomplete in an Xcode projectNo buildServer.json → "SweetPad: Generate Build Server Config", then "SweetPad: Diagnose BSP (Doctor)"SweetPad docs
Autocomplete broken in a Swift packageA leftover buildServer.json overrides native package support → delete itSweetPad docs
Cursor can't find xcode-toolsXcode isn't running or has no project openCursor 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.