Skip to content

Commit 372283a

Browse files
authored
Add MCP setup instructions for Xcode's integrated Claude Code and Codex agents (#200)
1 parent 2e4734e commit 372283a

1 file changed

Lines changed: 56 additions & 1 deletion

File tree

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Add XcodeBuildMCP to your MCP client configuration. Most clients use JSON config
112112

113113
Or use the quick install links:
114114

115-
[![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/en-US/install-mcp?name=XcodeBuildMCP&config=eyJjb21tYW5kIjoibnB4IC15IHhjb2RlYnVpbGRtY3BAYmV0YSBtY3AifQ%3D%3D)
115+
[![Install in VS Code](https://img.shields.io/badge/VS_Code-XcodeBuildMCP-0098FF?style=flat&logo=visualstudiocode&logoColor=ffffff)](vscode:mcp/install?%7B%22name%22%3A%22XcodeBuildMCP%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22xcodebuildmcp%40beta%22%2C%22mcp%22%5D%7D)
116116
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-XcodeBuildMCP-24bfa5?style=flat&logo=visualstudiocode&logoColor=ffffff)](vscode-insiders:mcp/install?%7B%22name%22%3A%22XcodeBuildMCP%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22xcodebuildmcp%40beta%22%2C%22mcp%22%5D%7D)
117117
<br />
118118
</details>
@@ -153,6 +153,61 @@ Add XcodeBuildMCP to your MCP client configuration. Most clients use JSON config
153153
<br />
154154
</details>
155155

156+
<details>
157+
<summary>Xcode (Codex Agent)</summary>
158+
<br />
159+
160+
Requires Xcode 26.3 or later. Codex agent must be installed and configured in Xcode Settings -> Intelligence -> Open AI.
161+
162+
The only way at the time of writing to add an MCP server is to use a project scoped `.codex/config.toml` file in the root of your project workspace:
163+
`/path/to/your/project/.codex/config.toml`
164+
165+
```toml
166+
[mcp_servers.XcodeBuildMCP]
167+
args = [
168+
"-lc",
169+
"PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; export NVM_DIR=\"$HOME/.nvm\"; [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"; nvm use --silent >/dev/null 2>&1 || true; npx -y xcodebuildmcp@beta mcp"
170+
]
171+
command = "/bin/zsh"
172+
enabled = true
173+
tool_timeout_sec = 10000
174+
```
175+
176+
> [!NOTE]
177+
> Codex Agent when running in Xcode has a limited PATH by default. The above example should work for most users but if you find the server doesn't start or is not available, it's likely because npx is not found so you might have to adjust the above configuration accordingly.
178+
179+
<br />
180+
</details>
181+
182+
<details>
183+
<summary>Xcode (Claude Code Agent)</summary>
184+
<br />
185+
186+
Requires Xcode 26.3 or later. Claude Code agent must be installed and configured in Xcode Settings -> Intelligence -> Anthropic.
187+
188+
Add to the end or replace the existing `mcpServers` object in Xcode's Claude Code agent config at:
189+
`~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.claude.json`
190+
191+
```json
192+
// ... rest of file ...
193+
"mcpServers": {
194+
"XcodeBuildMCP": {
195+
"command": "/bin/zsh",
196+
"args": [
197+
"-lc",
198+
"PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; export NVM_DIR=\"$HOME/.nvm\"; [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"; nvm use --silent >/dev/null 2>&1 || true; npx -y xcodebuildmcp@beta mcp"
199+
]
200+
}
201+
}
202+
}
203+
```
204+
205+
> [!NOTE]
206+
> Claude Code Agent when running in Xcode has a limited PATH by default. The above example should work for most users but if you find the server doesn't start or is not available, it's likely because npx is not found so you might have to adjust the above configuration accordingly.
207+
208+
<br />
209+
</details>
210+
156211
<br />
157212

158213
For other installation options see [Getting Started](docs/GETTING_STARTED.md)

0 commit comments

Comments
 (0)