Xcode MCP Tests
Overview
Run tests through Xcode itself, using the active scheme and test plan from the selected Xcode tab.
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 running tests through another path.
Workflow
- Discover Xcode tabs with
mcp__xcode.XcodeListWindows. - Select the
tabIdentifierfor the requested workspace/project. - If the user asks to list tests or run a named subset, call
mcp__xcode.GetTestListfirst. - For the full active test plan, call
mcp__xcode.RunAllTests. - For selected tests, call
mcp__xcode.RunSomeTestswith exacttargetNameandtestIdentifiervalues fromGetTestList. - After a test run, inspect failures with
mcp__xcode.GetBuildLogandmcp__xcode.XcodeListNavigatorIssueswhen needed.
Test Selection
- Use
GetTestListoutput fields directly; do not guess XCTest identifiers from display names. - If
GetTestListreturns afullTestListPath, use shell search tools on that file only when the returned list is truncated or the requested test is not in the first page. - If the user gives a file or class name, map it to matching
TEST_TARGETandTEST_IDENTIFIERentries before callingRunSomeTests.
Reporting
- State whether all requested tests ran, passed, failed, or could not be started.
- Include failed test identifiers and the highest-signal assertion or compile errors.
- If no tests are available from the active scheme/test plan, report that Xcode MCP found no tests for the selected tab.
Constraints
- Do not infer a different scheme, destination, or test plan; this MCP runs the active Xcode configuration.
- If a specific test cannot be mapped exactly, ask for clarification or list close matches rather than running a broad suite unexpectedly.