Xcode MCP Workflow
Overview
Use this skill for end-to-end Xcode MCP tasks that need more than one focused Xcode MCP skill. It is a workflow coordinator: route to the narrower skills for details, keep state across steps, and stop when the user goal is verified or the next required input is genuinely missing.
Tool Availability
Before calling MCP tools, confirm the mcp__xcode namespace is available. If needed tools are not visible, use tool_search with the relevant tool names from the focused skill. If Xcode MCP still is not connected, report that directly and do not fall back to non-MCP Xcode actions when the user explicitly requested Xcode MCP.
Skill Routing
- Use
$xcode-mcp-windowsto select the XcodetabIdentifier. - Use
$xcode-mcp-filesto inspect the active file, list project groups, glob files, grep source, and read files. - Use
$xcode-mcp-editfor Xcode-aware file writes, precise replacements, group creation, moves, copies, and removals. - Use
$xcode-mcp-buildto compile the active Xcode scheme. - Use
$xcode-mcp-diagnosticsto inspect build logs, Issue Navigator, and single-file compiler diagnostics. - Use
$xcode-mcp-teststo list or run tests from the active scheme's active test plan. - Use
$xcode-mcp-previewto render SwiftUI previews. - Use
$xcode-mcp-snippetto execute small Swift snippets in source-file context. - Use
$xcode-mcp-docsfor Apple Developer Documentation search when API behavior, migration, or framework usage is uncertain. - For full app launch, Simulator interaction, debugging, signing, packaging, or profiling, route to a separate simulator/debugging or platform-specific skill when available.
Core Loop
- Establish the Xcode tab with
$xcode-mcp-windows. - Clarify only if multiple Xcode tabs match equally or the requested target is ambiguous.
- Gather the narrowest evidence first: diagnostics, current file, grep results, tests, preview output, or documentation.
- Read relevant files through
$xcode-mcp-filesbefore editing. - Apply the smallest Xcode-aware edit through
$xcode-mcp-edit. - Verify with the narrowest relevant Xcode MCP action.
- If verification fails, inspect the new evidence and repeat the loop only for issues plausibly caused by the current task.
- Stop when the requested behavior is verified, or when further progress requires user input, unavailable tools, or an external state change.
Common Workflows
Fix Build Errors
- Run
$xcode-mcp-buildor inspect existing diagnostics with$xcode-mcp-diagnostics. - Use
$xcode-mcp-filesto read files referenced by the highest-signal errors. - If an Apple API detail is uncertain, use
$xcode-mcp-docs. - Patch with
$xcode-mcp-edit. - Rebuild with
$xcode-mcp-build.
Implement And Verify
- Use
$xcode-mcp-filesto locate the owning code and call sites. - Use
$xcode-mcp-docsonly when Apple API details are relevant. - Edit with
$xcode-mcp-edit. - Verify with
$xcode-mcp-build,$xcode-mcp-tests,$xcode-mcp-preview, or$xcode-mcp-snippet, choosing the narrowest meaningful check.
Repair Tests
- Use
$xcode-mcp-teststo list or run the relevant tests. - Inspect failing diagnostics/logs with
$xcode-mcp-diagnostics. - Read implementation and test files with
$xcode-mcp-files. - Patch with
$xcode-mcp-edit. - Re-run the selected tests before broadening to all tests.
Update SwiftUI Preview Or UI Code
- Use
$xcode-mcp-filesto locate the SwiftUI file and preview definition. - Search Apple docs with
$xcode-mcp-docsif framework behavior is unclear. - Edit with
$xcode-mcp-edit. - Render with
$xcode-mcp-preview. - If rendering fails because of compile errors, inspect diagnostics and loop once through the fix path.
Guardrails
- Do not edit files before reading the current Xcode project path and relevant content.
- Do not use
XcodeWritefor existing files whenXcodeUpdatecan make a precise replacement. - Do not use broad
replaceAll,XcodeRM, or project moves without a clear user request and checked matches. - Do not chase unrelated warnings, unrelated tests, or unrelated existing repository changes.
- Do not switch to shell
xcodebuild, filesystem edits, or simulator tooling when the user explicitly asked for Apple Xcode MCP unless they approve the fallback. - Do not present this package as covering full app launch, Simulator interaction, debugger sessions, signing, packaging, or profiling unless a separate skill/tool has been loaded for that work.
Reporting
- State the selected Xcode tab/workspace.
- Summarize the evidence gathered, the files changed, and the verification run.
- If work stops early, state the exact blocker: missing Xcode MCP tools, no open Xcode workspace, ambiguous tab, unavailable active scheme/test plan, or external user action needed.