| [ Web Proxy ] |
| Viewing: https://cursor.com/docs/integrations/xcode | [Back] [Original] |
Search for a command to run...
Xcode 26.3+ exposes a built-in MCP server that gives Cursor direct access to your Xcode projects. Cursor's agent can read and edit files, trigger builds, run tests, capture SwiftUI previews, and search Apple's documentation; all without leaving your editor.
This works through xcrun mcpbridge, a binary Apple ships with Xcode that translates MCP protocol messages into Xcode's internal XPC layer. You configure it once, and Cursor treats Xcode's 20 built-in tools like any other MCP server.
Before Cursor can connect, turn on Xcode's MCP bridge:
Go to Xcode > Settings > Intelligence.
Under Model Context Protocol, toggle Xcode Tools on.
Pick whichever method suits your workflow.
Go to Customize > MCPs.
Click Add New MCP Server. Set the transport to stdio, name it xcode-tools, and enter xcrun mcpbridge as the command.
mcp.jsonAdd an entry to your MCP config file:
{ "mcpServers": { "xcode-tools": { "command": "xcrun", "args": ["mcpbridge"] } }}If you use the Cursor CLI, register the server from your terminal:
agent mcp add xcode-tools -- xcrun mcpbridgeThe CLI shares the same MCP config as the editor, so the server appears in both.
Xcode exposes 20 MCP tools across five categories:
A typical Cursor + Xcode workflow looks like this:
You stay in Cursor the whole time. Xcode handles compilation, testing, and previews in the background.
The Cursor CLI also works with Xcode's MCP tools. This is useful for headless workflows, CI pipelines, or terminal-first developers.
# Run agent with Xcode tools availableagent "Add unit tests for the NetworkManager class"The agent picks up the xcode-tools MCP server from your config and uses the same tools available in the editor.
Make sure Xcode is running with a project open. The xcrun mcpbridge process needs an active Xcode session to communicate with.
Some Xcode MCP tools need a workspace context. Confirm you have a project or workspace open in Xcode, not an empty window.
Large projects take longer to build. Check Xcode's build progress directly. The MCP bridge waits for Xcode's response, so timeouts usually mean the underlying operation is still running.
You need Xcode 26.3 or later. Check your version under Xcode > About Xcode and update through the Mac App Store or Apple Developer downloads.
Your system is pointed at Command Line Tools instead of the full Xcode installation. Fix this by running:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developersudo xcodebuild -runFirstLaunchThen confirm the bridge is available:
xcrun --find mcpbridgeThis should return a file path, not an error. Once it does, open Xcode with your project, go to Settings > Intelligence > Model Context Protocol, and enable Allow external agents. Then toggle the Xcode MCP server back on in Cursor settings. You should see a permission dialog in Xcode confirming the connection.
Search for a command to run...
Xcode 26.3+ exposes a built-in MCP server that gives Cursor direct access to your Xcode projects. Cursor's agent can read and edit files, trigger builds, run tests, capture SwiftUI previews, and search Apple's documentation; all without leaving your editor.
This works through xcrun mcpbridge, a binary Apple ships with Xcode that translates MCP protocol messages into Xcode's internal XPC layer. You configure it once, and Cursor treats Xcode's 20 built-in tools like any other MCP server.
Before Cursor can connect, turn on Xcode's MCP bridge:
Go to Xcode > Settings > Intelligence.
Under Model Context Protocol, toggle Xcode Tools on.
Pick whichever method suits your workflow.
Go to Customize > MCPs.
Click Add New MCP Server. Set the transport to stdio, name it xcode-tools, and enter xcrun mcpbridge as the command.
mcp.jsonAdd an entry to your MCP config file:
{ "mcpServers": { "xcode-tools": { "command": "xcrun", "args": ["mcpbridge"] } }}If you use the Cursor CLI, register the server from your terminal:
agent mcp add xcode-tools -- xcrun mcpbridgeThe CLI shares the same MCP config as the editor, so the server appears in both.
Xcode exposes 20 MCP tools across five categories:
A typical Cursor + Xcode workflow looks like this:
You stay in Cursor the whole time. Xcode handles compilation, testing, and previews in the background.
The Cursor CLI also works with Xcode's MCP tools. This is useful for headless workflows, CI pipelines, or terminal-first developers.
# Run agent with Xcode tools availableagent "Add unit tests for the NetworkManager class"The agent picks up the xcode-tools MCP server from your config and uses the same tools available in the editor.
Make sure Xcode is running with a project open. The xcrun mcpbridge process needs an active Xcode session to communicate with.
Some Xcode MCP tools need a workspace context. Confirm you have a project or workspace open in Xcode, not an empty window.
Large projects take longer to build. Check Xcode's build progress directly. The MCP bridge waits for Xcode's response, so timeouts usually mean the underlying operation is still running.
You need Xcode 26.3 or later. Check your version under Xcode > About Xcode and update through the Mac App Store or Apple Developer downloads.
Your system is pointed at Command Line Tools instead of the full Xcode installation. Fix this by running:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developersudo xcodebuild -runFirstLaunchThen confirm the bridge is available:
xcrun --find mcpbridgeThis should return a file path, not an error. Once it does, open Xcode with your project, go to Settings > Intelligence > Model Context Protocol, and enable Allow external agents. Then toggle the Xcode MCP server back on in Cursor settings. You should see a permission dialog in Xcode confirming the connection.
| Web Proxy Viewer | New URL | Original Page |