avatar
Published on

How to Use Xcode's MCP Server to Build Xcode into Your AI Workflow

Authors
  • avatar
    Name
    Mick MacCallum
    Twitter
    @0x7fs

If you've been using AI coding assistants like Claude Code or Cursor for iOS development, you've probably hit the same wall I have. These tools can read and edit Swift files just fine, but they're blind to everything that makes Xcode projects different from a folder of source files. They don't know which files belong to which targets, can't trigger builds, and have no idea when something fails to compile. You end up copying error messages back and forth, which defeats the purpose.

Xcode 26.3 addresses this by shipping with a built-in Model Context Protocol (MCP) server. MCP is an open standard that gives AI tools a way to interact with external systems—in this case, your Xcode projects. Once enabled, your AI assistant can query your project structure, kick off builds, run tests, and get back structured diagnostics. No more screenshot-pasting compiler errors.

Enabling It

Open Xcode's Settings (⌘,), go to the Intelligence tab, and check "Enable Model Context Protocol." That's the whole setup on the Xcode side.

The server exposes your project's file hierarchy and scheme configurations, so the AI actually understands how your project is organized rather than treating it as a flat directory. It can trigger builds for specific schemes and destinations, then receive the compiler errors and warnings with file paths and line numbers. Same deal with tests—it can run your suite and get structured pass/fail results with failure messages.

Connecting External Tools

Use the xcrun mcpbridge command to wire up your AI tool to Xcode. For Claude Code:

claude mcp add --transport stdio xcode -- xcrun mcpbridge

For Codex:

codex mcp add xcode -- xcrun mcpbridge

You can verify it worked with claude mcp list or codex mcp list. Once configured, the tool will have access to your open project and Xcode's build/test capabilities.

It's also worth adding some context about your project to your CLAUDE.md or AGENTS.md file—things like your main scheme name, test targets, or any build quirks. The AI will use this when deciding how to interact with Xcode.

Customizing Xcode's Built-in Assistants

If you're using Codex or Claude Agent within Xcode itself (the Intelligence panel, not the external CLI tools), you can customize them beyond what the settings UI exposes. Xcode reads configuration files from:

~/Library/Developer/Xcode/CodingAssistant/codex
~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig

These let you set a default model, add other MCP servers the agent can access, and create custom skills. Useful if you want Xcode's built-in assistant to talk to your team's internal tools or a documentation server.

Why Bother

The real value shows up during iterative work. Say you're debugging a layout issue and you ask your AI to fix it. With MCP access, it can make the change, build to verify it compiles, run the relevant tests, and report back—all without you switching windows or copying anything. The feedback loop that used to require your manual involvement just happens.

For simpler stuff like writing docs or one-off questions about code, you don't need this. The AI can work with code as text. But for anything where you'd normally be bouncing between your editor and Xcode to check if changes work, having the AI handle that loop directly is a noticeable improvement.

One thing to keep in mind: enabling this means external processes can trigger builds and run code on your machine. The server only accepts local connections, so it's not exposed to the network, but if you're working on something sensitive you should think about which tools you're granting access to.

For full details, see Apple's documentation on giving agentic coding tools access to Xcode.