Xcode MCP Build
Overview
Use Xcode MCP as the primary build path for the Xcode window the user has open. Do not fall back to command-line xcodebuild when the user explicitly asks to use Xcode MCP unless they later approve a fallback.
Tool Availability
Before calling MCP tools, confirm the mcp__xcode namespace is available. If it is not available, use tool_search to expose Xcode MCP tools; if the tools still are not available, tell the user Xcode MCP is not connected and stop rather than using xcodebuild for an MCP-requested build.
Workflow
- Discover Xcode windows with
mcp__xcode.XcodeListWindows. - Select the
tabIdentifierthat matches the requested workspace/project. If there is only one Xcode tab, use it. - Call
mcp__xcode.BuildProjectwith the selectedtabIdentifier. - If
BuildProjectreturns normally, callmcp__xcode.GetBuildLogwithseverity: "error"andmcp__xcode.XcodeListNavigatorIssueswithseverity: "error"to confirm the result. - If
BuildProjectreports that the build started but the resulting build log could not be located, treat the outcome as indeterminate, then pollGetBuildLogandXcodeListNavigatorIssues. - If
BuildProjecttimes out, do not treat the build as failed. PollGetBuildLogandXcodeListNavigatorIssues; Xcode may still be building while MCP waits. - Report the build result, whether
buildIsRunningis false, the workspace path, thetabIdentifier, and any log path returned byGetBuildLog.
Result Handling
- Success: say that the Xcode MCP build succeeded and include the active workspace/project.
- Build failure: list the highest-signal errors from
GetBuildLogor Issue Navigator with file paths and messages. - Build started but log missing: say the initial MCP build response was non-terminal, then report the later polled build result or say the outcome remains indeterminate.
- MCP timeout: say that the MCP call timed out, then continue checking
GetBuildLog/Issue Navigator before deciding whether the outcome is inconclusive. - No open Xcode window: ask the user to open the workspace/project in Xcode, because this MCP operates on Xcode tabs.
Constraints
- The MCP build uses Xcode's currently active scheme and run destination for the tab.
- Do not modify project files or run dependency installers just to trigger a build.
- If multiple Xcode windows are open and the requested project is ambiguous, ask which tab/workspace to use.