A Pi coding agent extension that connects Pi to the MCP tool service built into Xcode through Apple's xcrun mcpbridge.
- Automatically connects when Xcode is running
- Lists and invokes the tools exposed by the open Xcode project
- Adds a compact Xcode tool catalog to Pi's system prompt while connected
- Supports MCP text, image, resource, structured, and progress results
- Propagates cancellation and enforces bounded timeouts/output
- Cleans up the bridge on reload, session replacement, and shutdown
- Provides TUI status plus connection-management commands
- macOS with an Xcode version that includes
xcrun mcpbridge - A project open in Xcode
- Xcode > Settings > Intelligence > Model Context Protocol > Allow external agents to use Xcode tools enabled
- Pi coding agent
Xcode displays an alert when an external agent connects.
From GitHub:
pi install git:github.com/zbagley99/pi-xcode-mcpFor a temporary test checkout:
pi --no-extensions -e ./extensions/xcode-mcp.tsAfter installation, restart Pi or run /reload.
The extension registers one model-callable tool named xcode:
| Action | Purpose |
|---|---|
connect |
Connect or reconnect and refresh the tool catalog |
status |
Report bridge state and diagnostics |
list |
Return Xcode MCP tool names, descriptions, and input schemas |
call |
Invoke an Xcode MCP tool by exact name |
disconnect |
Close the bridge process |
Models should use list before calling an unfamiliar Xcode tool.
/xcode-connect/xcode-status/xcode-tools/xcode-disconnect
- Call
xcodewith{ "action": "list" }. - Select the appropriate Xcode MCP capability and inspect its
inputSchema. - Call
xcodewith:
{
"action": "call",
"tool": "<exact MCP tool name>",
"arguments": {
"<schema field>": "<value>"
}
}- Make sure a project is open in Xcode.
- Toggle Allow external agents to use Xcode tools off and on.
- Restart Xcode if necessary.
- Run
/xcode-connectin Pi.
Set MCP_XCODE_PID before starting Pi to select a specific Xcode instance:
MCP_XCODE_PID=12345 piOtherwise, mcpbridge uses Xcode's normal auto-detection.
npm install --ignore-scripts
PI_SKIP_VERSION_CHECK=1 pi --no-extensions \
-e ./extensions/xcode-mcp.ts \
--list-modelsRuntime dependencies belong in dependencies; Pi-provided extension APIs remain peer dependencies.
Pi extensions run with the user's full permissions. Xcode MCP tools may modify projects, build targets, run tests, or perform other IDE actions. Review the source and keep Xcode's external-agent permission disabled when not needed.
MIT