|
| 1 | +# Install GitHub MCP Server in Xcode |
| 2 | + |
| 3 | +Xcode currently supports two built-in coding agents: **Codex** (powered by OpenAI) and **Claude Agent** (powered by Anthropic). Follow the standard installation guide for each agent, with one important difference: Xcode uses its own isolated configuration directories for each agent, separate from your global config. |
| 4 | + |
| 5 | +> Configurations placed in these directories only affect agents when launched from Xcode. See [Apple's documentation](https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence#Customize-the-Claude-Agent-and-Codex-environments) for more details. |
| 6 | +
|
| 7 | +## Configuration Directories |
| 8 | + |
| 9 | +| Agent | Configuration Directory | |
| 10 | +|-------|------------------------| |
| 11 | +| Codex | `~/Library/Developer/Xcode/CodingAssistant/codex/` | |
| 12 | +| Claude Agent | `~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/` | |
| 13 | + |
| 14 | +Place your MCP server configuration in the relevant directory above rather than the default location used by the standalone CLI. |
| 15 | + |
| 16 | +## Setup Guides |
| 17 | + |
| 18 | +- **[Codex](install-codex.md)** — configure `config.toml` inside `~/Library/Developer/Xcode/CodingAssistant/codex/` |
| 19 | +- **[Claude Agent](install-claude.md#claude-desktop)** — configure `.claude.json` inside `~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/` |
| 20 | + |
| 21 | +## macOS Path Note |
| 22 | + |
| 23 | +Xcode runs with a minimal `PATH` that typically excludes `/usr/local/bin`. If you are using a local STDIO server (e.g. Docker or a pre-built binary), use the **full path** to the command in your config: |
| 24 | + |
| 25 | +``` |
| 26 | +/usr/local/bin/docker |
| 27 | +/usr/local/bin/github-mcp-server |
| 28 | +``` |
| 29 | + |
| 30 | +## Troubleshooting |
| 31 | + |
| 32 | +| Issue | Possible Cause | Fix | |
| 33 | +|-------|----------------|-----| |
| 34 | +| Tools not loading | Config placed in wrong directory | Ensure config is in the Xcode-specific path above, not `~/.codex/` or `~/.claude.json` | |
| 35 | +| Command not found (STDIO) | Xcode's PATH excludes `/usr/local/bin` | Use the full path to the command | |
| 36 | +| Docker not found | Docker not running | Start Docker Desktop and restart Xcode | |
| 37 | +| Authentication failed | Invalid or expired PAT | Regenerate PAT and update config | |
| 38 | + |
| 39 | +## References |
| 40 | + |
| 41 | +- [Apple Developer Documentation — Setting up coding intelligence](https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence#Customize-the-Claude-Agent-and-Codex-environments) |
| 42 | +- [Codex MCP documentation](https://developers.openai.com/codex/mcp) |
| 43 | +- Main project README: [Advanced configuration options](../../README.md) |
0 commit comments