# Xcode MCP Edit

> Modify Xcode project files and groups through Apple Xcode MCP. Use when the user explicitly asks to edit through Xcode MCP, create or overwrite files in the Xcode project, apply exact text replacements, create project groups/directories, rename/move/copy project items, or remove files from the Xcode project structure.

- Skill: `ai-x-builder/xcode-mcp-edit` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add ai-x-builder/xcode-mcp-edit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ai-x-builder/xcode-mcp-edit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ai-x-builder (https://skillmd.com/u/ai-x-builder)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/ai-x-builder/xcode-mcp-edit

---


# Xcode MCP Edit

## Overview

Use this skill for Xcode-aware file modifications. These tools operate on Xcode project navigator paths and may update project structure or target membership; prefer them when the user explicitly asks for Xcode MCP edits or when project navigator integration is required.

## Tool Availability

Before calling MCP tools, confirm the `mcp__xcode` namespace is available. If edit tools such as `XcodeUpdate`, `XcodeWrite`, `XcodeMakeDir`, `XcodeMV`, or `XcodeRM` are not visible, use `tool_search` with those names to expose Apple Xcode MCP edit tools. If the tools still are not available, tell the user Xcode MCP is not connected and stop rather than falling back to filesystem edits.

## Safety Workflow

1. Call `mcp__xcode.XcodeListWindows` and select the relevant `tabIdentifier`.
2. Locate the project path with read-only tools from `$xcode-mcp-files`. If only this skill is loaded, follow the read-only discovery steps from that skill before editing.
3. For text, symbol, or broad replacement requests, search with `mcp__xcode.XcodeGrep` before editing so the match set is based on Xcode project structure.
4. Read the current file with `mcp__xcode.XcodeRead` before modifying existing content.
5. Prefer `mcp__xcode.XcodeUpdate` for precise edits to existing files.
6. Use `mcp__xcode.XcodeWrite` only to create a new file or intentionally overwrite a whole file.
7. After each edit, read back the changed file or list the changed project group to verify the Xcode project structure.
8. Run the narrowest relevant Xcode MCP validation, such as diagnostics, build, preview, snippet, or tests.

## Tool Selection

- `XcodeUpdate`: use for exact text replacement. Provide `oldString` copied from `XcodeRead`, a different `newString`, and `replaceAll: true` only when every occurrence is intended.
- `XcodeWrite`: use for new files or intentional full-file overwrite. It automatically adds new files to the Xcode project structure.
- `XcodeGrep`: use before broad replacements, symbol renames, or multi-file edits to enumerate matches through Xcode MCP; do not substitute shell `rg`/`grep` as the primary safety check.
- `XcodeMakeDir`: use to create Xcode project groups/directories before writing grouped files.
- `XcodeMV`: use to rename, move, or copy project items; set `overwriteExisting` only when replacement is intended.
- `XcodeRM`: use to remove files or directories from the project. Be explicit about `deleteFiles`; the default moves underlying files to Trash.

## Guardrails

- Do not use Xcode MCP edit tools for non-Xcode repository files unless the user explicitly asks and the path is visible in Xcode.
- Do not edit generated directories such as `Pods/`, `build/`, or other project-specific generated output unless the user explicitly requests it.
- Do not use `XcodeWrite` to overwrite an existing file when a targeted `XcodeUpdate` will do.
- Do not use `replaceAll` for broad refactors without first showing or checking all matches.
- Do not delete files with `XcodeRM` unless the request clearly requires removal; prefer `deleteFiles: false` when only project membership should change.
- Do not assume a filesystem path is a valid Xcode project path; resolve it through Xcode read-only tools first.

## Reporting

- Report the exact Xcode project paths changed.
- State which edit tool was used.
- Include verification performed after the edit.

