XcodeMCP

by lapfelix

57 stars
234 downloads
Not rated
GitHub

About

MCP server for Xcode that wraps its AppleScript interface & uses XCLogParser to return clear build results

Details

Author
lapfelix
GitHub stars
57
Downloads
234
Categories
Other, Developer Tools

- Controls Xcode directly through JXA (not xcodebuild CLI)
- XCResult analysis with screenshot extraction and UI hierarchy
- Build log parsing with XCLogParser for precise error locations
- Comprehensive health checks and environment validation
- Sidekick mode to complement Apple’s official Xcode MCP
- Full‑featured CLI with 100% MCP server feature parity

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name XcodeMCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npx -y xcodemcp@latest or globally with npm install -g xcodemcp. Use it as an MCP server by adding a JSON configuration to MCP clients (Claude Desktop, VS Code, etc.) or as a CLI tool with the xcodecontrol command. For side-by-side use with Apple’s official Xcode MCP, start with --sidekick-only to exclude build/run/test/debug tools. Optional but recommended: install XCLogParser via brew install xclogparser. Requirements: macOS with Xcode and Node.js 18+.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "xcodemcp": {
            "XcodeMCP": {
                "command": "npx",
                "args": [
                    "-y",
                    "xcodemcp@latest"
                ]
            }
        }
    }
}

McpServers

{
    "XcodeMCP": {
        "command": "npx",
        "args": [
            "-y",
            "xcodemcp@latest"
        ]
    }
}

XcodeMCP

npm version
Test Status

Model Context Protocol (MCP) server that controls Xcode directly through JavaScript for Automation (JXA). Available as both an MCP server and a standalone CLI.

What it does

- Controls Xcode directly through JavaScript for Automation (not xcodebuild CLI)
- Opens projects, builds, runs, tests, and debugs from within Xcode
- Parses build logs with precise error locations using XCLogParser
- Provides comprehensive environment validation and health checks
- Supports graceful degradation when optional dependencies are missing
- NEW: Includes a full-featured CLI with 100% MCP server feature parity

Requirements

- macOS with Xcode installed
- Node.js 18+
- XCLogParser (recommended): brew install xclogparser

Usage

XcodeMCP can be used in two ways:
1. MCP Server: Integrate with Claude Desktop, VS Code, or other MCP clients
2. CLI Tool: Run commands directly from the terminal with xcodecontrol

Quick Install

Install in VS Code
Install in VS Code Insiders
Install MCP Server

XCLogParser is recommended but optional:

brew install xclogparser

Install from npm

Run directly with npx:

npx -y xcodemcp@latest

Or install globally:

npm install -g xcodemcp

MCP Configuration

Add to your MCP configuration:

{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
}
}
}
}

Claude Code CLI Setup

To add XcodeMCP to Claude Code using the command line:

claude mcp add-json XcodeMCP '{
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
}
}'

Without the clean build folder tool

To add XcodeMCP to Claude Code using the command line:

claude mcp add-json XcodeMCP '{
"command": "npx",
"args": ["-y", "xcodemcp@latest", "--no-clean"],
"env": {
}
}'

Using Preferred Values for Single Project Workflows

For projects where you're working with a single xcodeproj and scheme, you can configure preferred values to make tool parameters optional:

claude mcp add-json XcodeMCP '{
  "command": "npx",
  "args": ["-y", "xcodemcp@latest"],
  "env": {
    "XCODE_MCP_PREFERRED_SCHEME": "MyApp",
    "XCODE_MCP_PREFERRED_XCODEPROJ": "MyApp.xcodeproj"
  }
}'

With preferred values configured:
- Tool parameters become optional instead of required
- Tool descriptions show default values (e.g., "defaults to MyApp.xcodeproj")
- You can still override defaults by providing explicit parameters
- Reduces repetition when working with a single project

Troubleshooting

If /mcp in Claude Code indicates the MCP failed, try running it from the project folder manually to see what the output is: npx -y xcodemcp@latest

Sidekick Mode

When using XcodeMCP alongside Apple's official Xcode MCP server, enable sidekick mode to only include complementary tools:

- Project management: Open/close projects, manage schemes, workspace info
- XCResult analysis: Browse test results, extract screenshots, inspect UI hierarchies

This excludes build/run/test/debug tools that Apple's MCP handles natively.

Claude Code CLI Setup (Both Servers)

First, enable Xcode Tools in Xcode > Settings > Intelligence > Model Context Protocol.

Then add both Apple's Xcode MCP and XcodeMCP in sidekick mode:
```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.