How to set up Claude Agent, Codex and Gemini inside Xcode 27, and extend them with MCP servers and plug-ins
To use Claude Agent or Codex inside Xcode, open Xcode › Settings › Intelligence, click Get next to the agent under Agents, install it and sign in. To add MCP servers, edit the agent's own folder under ~/Library/Developer/Xcode/CodingAssistant with absolute paths. On Xcode 27 you can also install plug-ins from a GitHub URL.
Last updated:
Xcode 26.3 added agentic coding in Xcode "powered by coding agents from Anthropic and OpenAI" (Xcode 26.3 release notes). Xcode 27 adds Google Gemini and Google Antigravity to the coding assistant, plug-ins that bundle "skills, MCP servers, and ACP agent configurations", support for the Agent Client Protocol and a filesystem security layer for agents (Xcode 27 release notes). These agents are separate from the Claude Code or Codex you run in Terminal. To connect those to Xcode, see Claude Code for iOS development or Codex for iOS development.
Inside Xcode or outside: which setup do you need?
| Agent inside Xcode (this guide) | External agent (Claude Code, Codex CLI, Cursor) | |
|---|---|---|
| Where you prompt | Xcode's coding assistant | Terminal, the agent's app or your editor |
| Access to Xcode's tools | Automatic: "it automatically has access to Xcode capabilities, such as building and testing" | Turn on "Allow external agents to use Xcode tools", then add xcrun mcpbridge |
| Configuration | ~/Library/Developer/Xcode/CodingAssistant/<agent> and plug-ins | ~/.claude.json, ~/.codex/config.toml, .cursor/mcp.json … |
| Guide | below | Best MCP servers for Xcode |
Sources: Apple, Setting up coding intelligence and Giving external agents access to Xcode.
Step 1: Turn on an agent and sign in
Per Apple:
Choose Xcode › Settings and select Intelligence.
Under Agents, click Get next to the agent you want (for example Claude Agent or Codex), then Install.
To sign in, click the More (…) button in the agent's Account row and follow the sheets and browser window.
Choose the agent in the coding assistant and prompt. Xcode keeps the downloaded agents up to date where possible.
Not listed? An agent that supports the Agent Client Protocol (ACP) can be added with Add an Agent under Agents. Agents are different from the Chat providers on the same screen (ChatGPT in Xcode, Claude Sonnet & Opus, or any provider with a Chat Completions API); those are models you chat with, not agents that run tools.
On managed Macs, Apple documents the MDM key CodingAssistantAllowExternalIntegrations (set to false) for turning the coding assistant off; if the Intelligence pane is missing options on a work Mac, check with your admin.
Step 2: Add MCP servers through the agent's config folder
Apple: "you can set a default model, add additional Model Context Protocol (MCP) servers, and create your own skills" with configuration files in agent-specific folders that "only affect agents when you launch them in Xcode" (Extending and customizing agents):
| Agent | Folder |
|---|---|
| Claude Agent | ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig |
| Codex | ~/Library/Developer/Xcode/CodingAssistant/codex |
| Gemini | ~/Library/Developer/Xcode/CodingAssistant/gemini |
Claude Agent. The folder acts as Claude Code's configuration directory, so the CLI can write into it (xcodeproj MCP Server README):
bash
CLAUDE_CONFIG_DIR=~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig \
claude mcp add <name> -s user -- /absolute/path/to/serverThat writes ClaudeAgentConfig/.claude.json. Editing it by hand works too; this is the documented block for MobileBuildMCP, which wraps npx in a login shell because the agent starts with a minimal PATH (MobileBuildMCP clients docs):
json
{
"mcpServers": {
"MobileBuildMCP": {
"command": "/bin/zsh",
"args": ["-lc", "PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; npx -y mobilebuildmcp@latest mcp"]
}
}
}(The docs' full version also loads nvm. Axiom documents the same file with a projects["*"].mcpServers block, an absolute npx path and a PATH in env (Axiom: Xcode integration).)
Codex. ~/Library/Developer/Xcode/CodingAssistant/codex acts as Codex's CODEX_HOME, so CODEX_HOME=… codex mcp add <name> -- /absolute/path writes codex/config.toml (giginet's README; Axiom documents the same folder). MobileBuildMCP's docs instead say that, "at the time of writing", Xcode's Codex agent only supports a project-scoped .codex/config.toml at the workspace root. If one location is ignored, try the other.
Three rules every vendor repeats:
Absolute paths. "A bare
npxwithout the full path fails silently" (Axiom). Runwhich npxand use that path, or wrap the command in/bin/zsh -lc(MobileBuildMCP).Set
PATHinenvso child processes findnode(Axiom).Restart after edits. "Xcode reads MCP configuration at launch" (Axiom); giginet's README says to restart the agent in Xcode.
Check the result with /context in the Claude Agent panel (Axiom). Logs: ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/debug/latest (Axiom).
Step 3: Install plug-ins (Xcode 27)
A plug-in packages skills, MCP servers, subagents and ACP agent configurations; skills become slash commands (Xcode 27 release notes). In WWDC26's Xcode session Apple calls the format "created by Anthropic" and says you "paste a GitHub URL" and Xcode "clones it, installs it, manages it" (WWDC26 session 382).
Settings › Intelligence, then the Plug-ins row under Agents.
Add Plug-in… › Add from URL › paste the repository URL › Continue.
Select the components you want and click Install (Apple).
Documented examples:
Heimdall (App Store Connect MCP): run
npx -y @erayendes/asc-mcp setuponce so the key lands in the Keychain, then addhttps://github.com/erayendes/app-store-connect-mcpand tick the profiles you need (Heimdall setup docs).Figma: add
https://github.com/figma/mcp-server-guide, then sign in next to the plug-in (Figma help). Not in our catalog: the repository has no license in the GitHub API.
Gotcha from Heimdall's docs: "Plug-ins go to agents, not to Xcode's own chat." Pick Claude Agent, Codex or Gemini in the model menu, not a built-in chat model. Mobile Builds' guide adds that after a plug-in is installed, editing a project's .mcp.json changes nothing, because "Xcode already has its own copy of the configuration"; edit the server under Settings › Intelligence instead (mobilebuilds.app).
Will any Claude Code plugin from our catalog work? Not guaranteed. Axiom, itself a Claude Code plugin, writes: "We haven't yet confirmed that Axiom installs this way", and its docs say Xcode's Claude Agent "doesn't support hooks, the /plugin menu, or session-start context". Treat a plug-in as supported only when its README documents Xcode.
Step 4: Built-in skills, permissions and safety
Built-in skills. Type
/in the message field to list Xcode's skills;/planenters plan mode (Apple). Xcode 27 adds editable plans with review UI and "Apple-built specialists" for localization, UIKit resizing and accessibility (release notes).What the agent can use. In Xcode 27 the agents can boot simulators, install and launch apps, tap and take screenshots, edit String Catalogs, use the debugger and build settings, and read project insights such as crashes and hangs (release notes). Xcode 27.2 adds a
GetCodeCoveragetool (27.2 release notes).Permissions. Settings › Intelligence › Permissions lists every command and tool you have allowed; add commands under Allowed Commands or remove tools (Apple).
Filesystem guard. Xcode 27 can monitor and control filesystem access by agents and "any processes they spawn"; turn it on in the Coding Intelligence settings (release notes).
Catalog tools that document Xcode's agents
Only entries whose README or docs describe Xcode's in-IDE agents or Xcode 27's MCP server. ★ = GitHub stars, 22 Oct 2026.
| Tool | What it adds | In-Xcode setup documented | License | ★ | Last push |
|---|---|---|---|---|---|
| MobileBuildMCP (getsentry) | Builds, simulators, devices, LLDB, UI automation | Claude Agent .claude.json and Codex .codex/config.toml blocks | MIT | 6,497 | 22 Oct 2026 |
| Axiom (CharlesWiltgen) | Apple-platform skill catalog served over MCP (axiom-mcp) | Claude Agent and Codex config folders; plug-in route "not yet confirmed" | MIT | 1,225 | 20 Oct 2026 |
| xcodeproj MCP Server (giginet) | Edits .xcodeproj files | CLAUDE_CONFIG_DIR / CODEX_HOME commands for the Xcode folders | MIT | 133 | 18 Sep 2026 |
| Heimdall (erayendes) | App Store Connect + App Store Server API | Xcode 27 plug-in via Add from URL | MIT | 53 | 21 Oct 2026 |
| xcode-mods (artemnovichkov) | Xcode build/test/preview panes in Claude Code | Uses Xcode 27's headless MCP server (sudo xcrun mcp-server enable) | MIT | 32 | 21 Oct 2026 |
| mcpbridge-wrapper (SoundBlaster) | Wrapper for xcrun mcpbridge | External agents; Xcode 27.0 handshake "verified" per README | MIT | 20 | 25 Sep 2026 |
| xcodeproj Skill (giginet) | Teaches agents xcrun xcodeproj (ships with Xcode 27.2) | Claude Code / Codex plugin; Xcode plug-in import not documented | MIT | 3 | 18 Sep 2026 |
Running agents outside Xcode instead?
Xcode 27 beta 5 added "a preview of a new MCP server experience that runs without requiring an open Xcode workspace", turned on with sudo xcrun mcp-server enable and checked with xcrun mcp-server status. Apple calls the --unsafe-always-allow-all-agents variant "not a recommended configuration for at-desk use" and says some parts of the preview "may not work in all configurations" (Xcode 27 release notes). The external setup itself is in Best MCP servers for Xcode.
Common problems
| Problem | Cause / fix | Source |
|---|---|---|
| MCP server never appears | Relative npx/node path → absolute path, PATH in env, restart Xcode | Axiom, MobileBuildMCP |
My ~/.claude.json servers are missing in Xcode | Xcode's agents read their own folder under CodingAssistant, not your global config | Apple, Axiom |
| Codex in Xcode ignores the config | Try the project-scoped .codex/config.toml (MobileBuildMCP) or CodingAssistant/codex/config.toml (giginet, Axiom) | MobileBuildMCP, giginet |
| Plug-in installed but no tools in chat | A built-in chat model is selected → pick an agent | Heimdall docs |
Edited .mcp.json has no effect after installing a plug-in | Xcode keeps its own copy → edit under Settings › Intelligence | Mobile Builds guide |
Hooks or /plugin don't work in Claude Agent | Not supported in Xcode's Claude Agent, per Axiom | Axiom |
FAQ
- Can I use Claude Code inside Xcode?
- Yes. Since Xcode 26.3 you can install Claude Agent from Anthropic under Xcode › Settings › Intelligence › Agents and sign in. It runs in Xcode's coding assistant with access to Xcode's build and test tools. It uses its own configuration folder, not your global ~/.claude settings.
- How do I add an MCP server to Claude Agent in Xcode?
- Add it to ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.claude.json, either by hand or with CLAUDE_CONFIG_DIR set to that folder and claude mcp add. Use absolute command paths, set PATH in env, and restart Xcode. On Xcode 27 you can install a plug-in that bundles the server instead.
- How do I install a plug-in in Xcode 27?
- Open Settings › Intelligence, click Plug-ins under Agents, then Add Plug-in, choose Add from URL and paste the GitHub repository URL. Select the components and click Install. Plug-ins work with agents such as Claude Agent, Codex or Gemini, not with the built-in chat models.
- Does Xcode's Codex use my ~/.codex/config.toml?
- No, according to Axiom's docs: Xcode's Codex reads its own folder, ~/Library/Developer/Xcode/CodingAssistant/codex, rather than your global Codex settings. MobileBuildMCP's docs report that Xcode's Codex agent read only a project-scoped .codex/config.toml when they were written.
- Can I use Gemini or another agent in Xcode?
- Yes. Xcode 27 added Google Gemini and Google Antigravity to the coding assistant. Any other agent that supports the Agent Client Protocol can be added with Add an Agent under Agents in the Intelligence settings.