# XcodeMCP

> Control Xcode through MCP and analyze build and test results.

- **URL**: https://followmcp.com/en/servers/xcodemcp
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 60
- **FMRS Score**: 53/100 (Grade D)
- **Source**: https://github.com/lapfelix/XcodeMCP
- **Transports**: stdio (local process)
- **Runtimes**: Node.js 18+
- **Auth**: No credential needed

## Overview
XcodeMCP is an MCP server that controls Xcode directly through JavaScript for Automation (JXA), and it also provides a standalone CLI. It can open projects, build, run, test, and debug, and uses XCLogParser to parse build logs. It can also browse .xcresult test results, extract attachments, and inspect UI hierarchies. XCLogParser is optional but recommended.

## Best for
- Developers using Xcode on macOS who want to operate projects and analyze test results through an MCP client.
- Teams that need Xcode project management and XCResult analysis tools.

## Not for
- Environments without macOS or Xcode.
- Workflows that require xcodebuild CLI rather than direct Xcode automation.

## Required permissions
- Requires Xcode and JXA on macOS; automation operations also require working Xcode automation permissions.
- Depending on the tool used, it may open or change project state, run builds and tests, start debugging, or access project files and test results.

## Risks
- Build, clean, run, test, and debug operations act on local Xcode projects or runtime environments; confirm the project and target before invoking them.
- Without XCLogParser, the server can still operate, but build error parsing is limited.
- The server launches over stdio; its configuration runs npx to obtain the specified npm package.

## Client config (JSON)
```json
{"mcpServers":{"xcodemcp":{"command":"npx","args":["-y","xcodemcp@latest"],"env":{}}}}
```

## Tools (22)
- `xcode_open_project`: Open an Xcode project or workspace.
- `xcode_get_workspace_info`: Get workspace status and details.
- `xcode_get_projects`: List projects in the workspace.
- `xcode_open_file`: Open a file, optionally at a specified line.
- `xcode_build`: Build a project and parse detailed errors.
- `xcode_clean`: Clean build artifacts.
- `xcode_test`: Run tests with optional additional arguments.
- `xcode_build_and_run`: Build and run the active scheme.
- `xcode_debug`: Start a debugging session.
- `xcode_stop`: Stop the current operation.
- `xcode_get_schemes`: List available schemes.
- `xcode_set_active_scheme`: Switch the active scheme.
- `xcode_get_run_destinations`: List run destinations such as simulators and devices.
- `xcresult_browse`: Browse test results and analyze failures.
- `xcresult_browser_get_console`: Get console output for a specific test.
- `xcresult_summary`: Get a quick overview of test results.
- `xcresult_get_screenshot`: Extract screenshots from test failures.
- `xcresult_get_ui_hierarchy`: Get an AI-readable UI hierarchy for a selected timestamp.
- `xcresult_get_ui_element`: Get detailed properties of a UI element by index.
- `xcresult_list_attachments`: List attachments for a test.
- `xcresult_export_attachment`: Export selected test attachments.
- `xcode_health_check`: Check the environment and provide troubleshooting information.
