Xcode MCP Broker
Provides a shared connection to Xcode via MCP bridge, enabling multiple clients to manage Xcode projects, build, and perform development tasks through a persistent local broker.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Xcode MCP Brokerlist the open Xcode windows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Xcode MCP Broker
A small localhost broker that lets multiple MCP clients share one persistent xcrun mcpbridge connection to Xcode.
With the broker, Xcode authorization normally happens once per Xcode launch. After allowing the broker connection, agents can delegate work to subagents, custom tools, and external scripts that reuse it instead of starting another bridge and requesting access again.
OpenCode ------------\
Custom MCP clients ----> localhost broker --> mcpbridge --> Xcode
Automation scripts ---/The broker exposes a Streamable HTTP endpoint, serializes calls to Xcode, forwards progress and cancellation, caches tool discovery, and reconnects when Xcode restarts. It binds to 127.0.0.1 by default.
Requirements
macOS with an Xcode version that provides
xcrun mcpbridgeNode.js 18 or later
Related MCP server: mcp-broker
Xcode compatibility
The broker does not hardcode Xcode's tools. It reads tools/list from mcpbridge and refreshes the cache when the bridge reconnects or Xcode sends a tools/list_changed notification. New, removed, or changed tools should therefore be picked up automatically after an Xcode update without requiring a broker release. Connected MCP clients are notified when the cached tool list changes.
This has been tested with the latest Xcode 27 beta available at the time of testing. Future Xcode versions should remain compatible as long as mcpbridge continues to implement the standard MCP lifecycle and tool APIs.
If XCODE_MCP_ALLOWED_TOOLS is set, newly added tools remain hidden until they are added to that allowlist. xcrun also uses the active developer directory, so make sure a newly installed Xcode is selected with xcode-select when necessary.
Installation
Clone the repository, install dependencies, and run the tests:
git clone https://github.com/grahammckee/XcodeMCPBroker.git
cd XcodeMCPBroker
npm install
npm testInstall the broker as a user LaunchAgent:
npm run service:installThe installer uses the current Node executable and repository path, starts the broker at login, and writes logs to ~/Library/Logs/xcode-mcp-broker.log.
Xcode does not need to be open when the service starts. The broker remains available and retries until Xcode launches. Xcode may show its normal Allow dialog when the connection is first established.
OpenCode
Point OpenCode at the broker in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"xcode": {
"type": "remote",
"url": "http://127.0.0.1:7341/mcp",
"oauth": false,
"enabled": true
}
}
}Restart OpenCode after changing its configuration.
Verification
curl --fail http://127.0.0.1:7341/healthz
npm run broker:smoke
launchctl print gui/$(id -u)/com.gmicc.opencode-xcode-mcp-brokerThe smoke command waits up to 60 seconds for initial Xcode discovery, then lists the available tools and calls the read-only XcodeListWindows tool.
To run the broker in the foreground instead:
npm run broker:startTo remove the LaunchAgent:
npm run service:uninstallConfiguration
Variable | Default | Purpose |
|
| HTTP bind address |
|
| HTTP port |
|
| Bridge executable |
| all tools | Comma-separated tool allowlist |
|
| Downstream request timeout |
|
| Idle upstream session timeout |
These variables are read directly when running in the foreground. To persist an override in the LaunchAgent, provide it while installing:
XCODE_MCP_ALLOWED_TOOLS="XcodeListWindows,BuildProject" npm run service:installThe broker does not provide authentication. Keep it bound to the loopback interface unless you add an appropriate access-control layer.
Contributing
Issues and pull requests are welcome. For code changes:
Create a focused branch from the current default branch.
Add or update tests for protocol, lifecycle, or concurrency behavior.
Run
npm test.If the change affects the live transport, run
npm run broker:smokewith Xcode open.Explain the behavior change and verification performed in the pull request.
Downstream calls are intentionally serialized. Changes to concurrency, cancellation, or retry behavior should account for Xcode operations whose outcome may be uncertain after a connection failure.
License
Licensed under the MIT License.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/grahammckee/XcodeMCPBroker'
If you have feedback or need assistance with the MCP directory API, please join our Discord server