From xcode-mcp
This skill should be used when the user asks to "use xcode", "open in xcode", "do something in xcode", "use the xcode mcp", or whenever working in a directory containing .xcodeproj, .xcworkspace, or Package.swift files and an Xcode-specific action is needed. Also activates when user asks generally "what can the Xcode MCP do?" or "how do I use xcode from Claude?".
How this skill is triggered — by the user, by Claude, or both
Slash command
/xcode-mcp:xcode-mcp-coreThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Xcode MCP bridge (`xcrun mcpbridge`) connects Claude Code to a running Xcode instance via the Model Context Protocol. It exposes a **single natural-language tool** — request any Xcode action by describing it in plain English, and Xcode performs it.
The Xcode MCP bridge (xcrun mcpbridge) connects Claude Code to a running Xcode instance via the Model Context Protocol. It exposes a single natural-language tool — request any Xcode action by describing it in plain English, and Xcode performs it.
Before using any Xcode MCP request:
/Users/matthewwagner — it is available in any Claude Code session started in or under that directoryclaude mcp add --transport stdio xcode -- xcrun mcpbridgeXcode's Intelligence settings (Xcode → Settings → Intelligence) organize coding tools into three sections:
/v1/models and /v1/chat/completions)Agent permissions: Click the Permissions row under Agents to manage Allowed Commands (CLI tools) and Allowed Tools (MCP tools) that all agents can use.
Claude Agent config: ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig — set default model, add MCP servers, create skills for the in-Xcode Claude Agent.
MDM restriction: Set CodingAssistantAllowExternalIntegrations to false in an MDM profile to disable the coding assistant on managed devices.
The tool accepts a plain English description of the desired action. Structure requests as imperative commands directed at Xcode:
"Build the [scheme name] scheme for [platform]"
"Run all unit tests in the [target] test target"
"Add the [capability name] capability to the main app target"
"Search Apple documentation for [topic]"
"Fix the build error in [file]"
Key behaviors:
| Category | What Xcode MCP Can Do |
|---|---|
| Build | Build schemes, clean build folder, run on simulator/device, resolve build errors |
| Test | Run test suites, individual test methods, test plans; report pass/fail/coverage |
| Project Structure | Add files/groups to project, create new targets, manage build phases |
| Entitlements & Capabilities | Add entitlements, enable capabilities (Push, iCloud, HealthKit, etc.) |
| SPM | Add, update, or remove Swift Package Manager dependencies |
| Documentation | Generate DocC comments for symbols, build documentation catalog |
| Apple Docs | Search Apple developer documentation by topic, API, or framework |
| Code | Generate/modify code in open files, apply proposed changes |
| Diagnostics | Read compiler errors/warnings with precise file+line context |
| Playgrounds | Generate playground macros for code exploration |
Use this to choose the right approach:
Need to EDIT a Swift file?
→ Use Edit/Write tools directly (faster, no Xcode required)
Need to BUILD or get compiler diagnostics?
→ Use Xcode MCP ("Build the [scheme] scheme")
Need to ADD a file to the Xcode PROJECT (not just create it)?
→ Use Xcode MCP ("Add [filename] to the Xcode project")
(Creating the file: Write tool. Registering it with Xcode: MCP)
Need to run TESTS?
→ Use Xcode MCP ("Run tests in [target]")
(Alternative: xcodebuild test via Bash — slower, no live IDE feedback)
Need to search APPLE DOCUMENTATION?
→ Use Xcode MCP ("Search Apple docs for...")
(Alternative: WebFetch on developer.apple.com — works when Xcode is closed)
Need to add ENTITLEMENTS or CAPABILITIES?
→ Use Xcode MCP (editing .entitlements XML manually risks Xcode ignoring it)
Need to add an SPM DEPENDENCY?
→ Use Xcode MCP ("Add the Swift package at [URL]")
(Editing Package.swift directly works for package targets; for app targets use MCP)
Running a non-Xcode CLI task (e.g., swiftformat, fastlane)?
→ Use Bash tool directly
Be specific about targets and schemes:
✅ "Build the MyApp scheme for iOS Simulator"
✅ "Run the MyAppTests test target"
❌ "Build the app" (ambiguous if multiple schemes exist)
Name files and symbols explicitly:
✅ "Add the NetworkService.swift file to the Sources group in the MyApp target"
✅ "Generate DocC documentation for the UserRepository class"
For error fixing, provide context:
✅ "Fix the build errors — the compiler is reporting a type mismatch in ContentView.swift line 42"
For Apple docs, use framework + symbol:
✅ "Search Apple docs for URLSession data task async await"
✅ "Look up the SwiftData @Model macro documentation"
The Xcode MCP is most powerful when combined with Claude's direct file tools:
This hybrid approach — Claude edits files, Xcode compiles and reports — is faster than xcodebuild CLI because it uses Xcode's incremental build system and gives richer diagnostics.
The coding assistant is Xcode's sidebar UI for interacting with agents and chat models (open with Cmd-0). Key features relevant to external agent workflow:
@ in message field to reference specific symbols/files; "Upload files" for external files#Playground macros rendered in canvasWhen Claude Code acts as an external agent via MCP, Xcode tracks all MCP-initiated changes in the conversation history and supports rollback.
More detailed guidance in companion skills:
xcode-build-and-fix — Build workflows, error diagnosis, iterative fix cyclesxcode-project-management — Files, targets, entitlements, capabilities, SPMxcode-testing — Test suites, test plans, coverage reportingxcode-docs-and-search — DocC generation, Apple documentation searchnpx claudepluginhub mattwag05/mw-plugins --plugin xcode-mcpProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.