xcode-mcli exposes Xcode MCP through command groups that map to the current Xcode MCP tool surface.
Text mode is the default.
--json returns a stable wrapper envelope:
{
"ok": true,
"command": "windows list",
"tool": "XcodeListWindows",
"data": {
"windows": []
}
}Failure shape:
{
"ok": false,
"command": "files read",
"tool": "XcodeRead",
"error": {
"kind": "runtime",
"message": "...",
"details": {}
}
}For tool-backed commands, --verbose prints Xcode MCP tool: <ToolName> to stderr.
--jsonPrints the stable JSON wrapper envelope.--verbosePrints the exact Xcode MCP tool name tostderrfor tool-backed commands.--tab-identifier <id>Provides the active Xcode tab identifier for tab-aware commands.
Shared flags can be passed before the command path or after the specific command.
Prepares the local state root and verifies xcrun mcpbridge.
Flags:
--json--verbose
Discovers the live Xcode MCP surface through initialize, tools/list, prompts/list, and resources/list.
Flags:
--output-file <path>optional--json--verbose
Without --output-file, text mode prints the canonical snapshot JSON.
With --output-file, the command writes the normalized snapshot to disk and prints the resolved path.
Compares the live discovered Xcode MCP surface against a baseline snapshot file.
Flags:
--baseline-file <path>required--json--verbose
Success data includes:
baselineFilecompatiblediff
Failure JSON includes categorized diff details in error.details.
Starts the daemon.
Shows whether the daemon is running and prints its PID when available.
Stops the daemon.
Restarts the daemon.
Daemon commands support:
--json--verbose
Calls XcodeListWindows.
Flags:
--json--verbose
Stores the active tab identifier in daemon state.
Flags:
--tab-identifier <id>required--json--verbose
Calls BuildProject.
Flags:
--tab-identifier <id>optional--json--verbose
If --tab-identifier is omitted, the CLI resolves it from the cached active tab or a single open Xcode window.
Calls DocumentationSearch.
Flags:
--query <text>required--framework <name>repeatable--tab-identifier <id>optional and ignored by the v1 resolver--json--verbose
xcode-mcli snippet execute --code-snippet <swift> --source-file-path <path> [--timeout <seconds>] [--tab-identifier <id>]
Calls ExecuteSnippet.
Flags:
--code-snippet <swift>required--source-file-path <path>required--timeout <seconds>optional--tab-identifier <id>optional--json--verbose
xcode-mcli build log [--glob <glob>] [--pattern <regex>] [--severity <level>] [--tab-identifier <id>]
Calls GetBuildLog.
Flags:
--glob <glob>optional--pattern <regex>optional--severity <level>optional Allowed values:error,warning,remark--tab-identifier <id>optional--json--verbose
xcode-mcli issues list [--glob <glob>] [--pattern <regex>] [--severity <level>] [--tab-identifier <id>]
Calls XcodeListNavigatorIssues.
Flags:
--glob <glob>optional--pattern <regex>optional--severity <level>optional Allowed values:error,warning,remark--tab-identifier <id>optional--json--verbose
Calls XcodeRefreshCodeIssuesInFile.
Flags:
--file-path <path>required--tab-identifier <id>optional--json--verbose
Calls GetTestList.
Flags:
--tab-identifier <id>optional--json--verbose
Calls RunAllTests.
Flags:
--tab-identifier <id>optional--json--verbose
Calls RunSomeTests.
Each selected test needs both fields:
targetName=<target>testIdentifier=<identifier>
Flags:
--test <key=value>repeatable--tab-identifier <id>optional--json--verbose
xcode-mcli preview render --source-file-path <path> [--preview-definition-index-in-file <n>] [--timeout <seconds>] [--tab-identifier <id>]
Calls RenderPreview.
Flags:
--source-file-path <path>required--preview-definition-index-in-file <n>optional--timeout <seconds>optional--tab-identifier <id>optional--json--verbose
Calls XcodeGlob.
Flags:
--path <path>optional--pattern <glob>optional--tab-identifier <id>optional--json--verbose
xcode-mcli files grep --pattern <regex> [--glob <glob>] [--head-limit <n>] [--ignore-case] [--lines-after <n>] [--lines-before <n>] [--lines-context <n>] [--multiline] [--output-mode <mode>] [--path <path>] [--show-line-numbers] [--type <type>] [--tab-identifier <id>]
Calls XcodeGrep.
Flags:
--pattern <regex>required--glob <glob>optional--head-limit <n>optional--ignore-caseoptional--lines-after <n>optional--lines-before <n>optional--lines-context <n>optional--multilineoptional--output-mode <mode>optional Allowed values:content,files_with_matches,count--path <path>optional--show-line-numbersoptional--type <type>optional--tab-identifier <id>optional--json--verbose
Calls XcodeLS.
Flags:
--path <path>required--ignore <pattern>repeatable--recursiveoptional--tab-identifier <id>optional--json--verbose
xcode-mcli files mv --source-path <path> --destination-path <path> [--operation <operation>] [--overwrite-existing] [--yes] [--tab-identifier <id>]
Calls XcodeMV.
Flags:
--source-path <path>required--destination-path <path>required--operation <operation>optional--overwrite-existingoptional--yesrequired when--overwrite-existingis set--tab-identifier <id>optional--json--verbose
Calls XcodeMakeDir.
Flags:
--directory-path <path>required--tab-identifier <id>optional--json--verbose
Calls XcodeRM.
Flags:
--path <path>required--delete-filesoptional--recursiveoptional--yesrequired--tab-identifier <id>optional--json--verbose
Calls XcodeRead.
Flags:
--file-path <path>required--offset <line>optional--limit <n>optional--tab-identifier <id>optional--json--verbose
xcode-mcli files update --file-path <path> --old-string <text> --new-string <text> [--replace-all] --yes [--tab-identifier <id>]
Calls XcodeUpdate.
Flags:
--file-path <path>required--old-string <text>required--new-string <text>required--replace-alloptional--yesrequired--tab-identifier <id>optional--json--verbose
xcode-mcli files write --file-path <path> (--content <text> | --content-file <path>) --yes [--tab-identifier <id>]
Calls XcodeWrite.
Flags:
--file-path <path>required--content <text>optional--content-file <path>optional- one of
--contentor--content-fileis required --yesrequired--tab-identifier <id>optional--json--verbose