developer-tools

Xcode

lapfelix

by lapfelix

Automate Xcode build, testing, and management using JavaScript scripts for efficient project workflows and smart error r

Automates Xcode build processes and project management through JavaScript for Automation scripts, enabling project opening, building with specific schemes and destinations, test execution, debugging, and intelligent build log analysis with error reporting.

github stars

52

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

macOS and Xcode requiredPath-based security controlsAppleScript automation integration

best for

  • / iOS/macOS developers automating build processes
  • / AI-assisted debugging of Xcode build failures
  • / Automated testing and project management workflows

capabilities

  • / Build Xcode projects and workspaces
  • / Retrieve build errors and console output
  • / Run iOS/macOS apps with interactive debugging
  • / Clean project build artifacts
  • / Browse project schemes and directory structures
  • / Find and list Xcode projects on your system

what it does

Controls Xcode IDE through AppleScript automation to build projects, run tests, retrieve errors, and manage iOS/macOS development workflows. Requires macOS and Xcode installation.

about

Xcode is a community-built MCP server published by lapfelix that provides AI assistants with tools and capabilities via the Model Context Protocol. Automate Xcode build, testing, and management using JavaScript scripts for efficient project workflows and smart error r It is categorized under developer tools.

how to install

You can install Xcode in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

license

Apache-2.0

Xcode is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

Using with Apple's Official Xcode MCP: Apple now provides an official Xcode MCP server. XcodeMCP can run alongside it in sidekick mode (--sidekick-only), providing complementary tools like project management and XCResult analysis. In a future version, XcodeMCP will transition to sidekick-only mode by default. See configuration below.

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

<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code"> <img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5"> <img src="https://cursor.com/deeplink/mcp-install-dark.svg" height=20 alt="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:

# Add Apple's official Xcode MCP
claude mcp add --transport stdio xcode -- xcrun mcpbridge

# Add XcodeMCP in sidekick mode (project management + XCResult analysis)
claude mcp add-json xcodemcp '{"command": "npx", "args": ["-y", "xcodemcp@latest", "--sidekick-only"]}'

JSON Configuration (Both Servers)

{
  "mcpServers": {
    "xcode": {
      "command": "xcrun",
      "args": ["mcpbridge"]
    },
    "xcodemcp": {
      "command": "npx",
      "args": ["-y", "xcodemcp@latest", "--sidekick-only"]
    }
  }
}

Future direction: In a future version, XcodeMCP will transition to sidekick-only mode by default, focusing exclusively on tools that complement Apple's official Xcode MCP rather than duplicating functionality.

Development Setup

For local development:

git clone https://github.com/lapfelix/XcodeMCP.git
cd XcodeMCP
npm install

# Run in development mode (TypeScript)
npm run dev:ts

# Or build and run compiled version
npm run build
npm start

CLI Usage

XcodeMCP includes a powerful CLI that provides 100% feature parity with the MCP server, allowing you to run any tool as a one-shot command:

Installation

Install globally to use the CLI:

npm install -g xcodemcp

Basic Usage

# Show help and available tools
xcodecontrol --help

# Run a tool with flags  
xcodecontrol build --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme

# Get help for a specific tool
xcodecontrol build --help

# Use JSON input instead of flags
xcodecontrol build --json-input '{"xcodeproj": "/path/to/Project.xcodeproj", "scheme": "MyScheme"}'

# Output results in JSON format
xcodecontrol --json health-check

Path Resolution

The CLI supports both absolute and relative paths for convenience:

# Absolute paths (traditional)
xcodecontrol build --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp

# Relative paths (NEW in v2.0.0)
xcodecontrol build --xcodeproj MyApp.xcodeproj --scheme MyApp
xcodecontrol build --xcodeproj ../OtherProject/OtherProject.xcodeproj --scheme OtherApp

# Works with file paths too
xcodecontrol open-file --filePath src/ViewController.swift --lineNumber 42

Relative paths are resolved from your current working directory, making the CLI much more convenient to use when working within project directories.

Verbosity Control

Control logging output with verbosity flags:

# Verbose mode (shows INFO and DEBUG logs)
xcodecontrol -v build --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme

# Quiet mode (only errors)
xcodecontrol -q test --xcodeproj /path/to/Project.xcodeproj

# Default mode (warnings and errors only)
xcodecontrol run --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme

Quick Examples

# Check system health
xcodecontrol health-check

# Build a project
xcodecontrol build --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp

# Run the app
xcodecontrol run --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp

# Run tests
xcodecontrol test --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj

# Clean build directory
xcodecontrol clean --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj

# Browse XCResult files
xcodecontrol xcresult-browse --xcresult-path /path/to/result.xcresult

# Get UI hierarchy from test failure
xcodecontrol xcresult-get-ui-hierarchy --xcresult-path /path/to/result.xcresult --test-id "MyTest/testMethod()" --timestamp 30.5

Tool Name Mapping

CLI commands use kebab-case instead of underscores:

  • xcode_buildbuild
  • xcode_testtest
  • xcode_build_and_runbuild-and-run
  • xcode_health_checkhealth-check
  • xcresult_browsexcresult-browse
  • find_xcresultsfind-xcresults

Available Tools

Project Management:

  • xcode_open_project - Open projects and workspaces
  • xcode_get_workspace_info - Get workspace status and details
  • xcode_get_projects - List projects in workspace
  • xcode_open_file - Open files with optional line number

Build Operations:

  • xcode_build - Build with detailed error parsing
  • xcode_clean - Clean build artifacts
  • xcode_test - Run tests with optional arguments
  • xcode_build_and_run - Build and run the active scheme
  • xcode_debug - Start debugging session
  • xcode_stop - Stop current operation

Configuration:

  • xcode_get_schemes - List available schemes
  • xcode_set_active_scheme - Switch active scheme
  • xcode_get_run_destinations - List simulators and devices

XCResult Analysis:

  • xcresult_browse - Browse test results and analyze failures
  • xcresult_browser_get_console - Get console output for specific tests
  • xcresult_summary - Quick overview of test results
  • xcresult_get_screenshot - Extract screenshots from test failures
  • xcresult_get_ui_hierarchy - Get UI hierarchy as AI-readable JSON with timestamp selection
  • xcresult_get_ui_element - Get detailed properties of specific UI elements by index
  • xcresult_list_attachments - List all attachments for a te

FAQ

What is the Xcode MCP server?
Xcode is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for Xcode?
This profile displays 53 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.4 out of 5—verify behavior in your own environment before production use.

Use Cases

Extended AI Capabilities

Add new capabilities to Claude beyond text generation

Example

Access external data sources, execute code, interact with tools and services

Transform Claude from chatbot to action-taking agent

Context Enhancement

Provide Claude with access to relevant context and data

Example

Load project documentation, access knowledge bases, query databases

Get more accurate, context-aware responses

Workflow Automation

Automate multi-step workflows combining AI and external tools

Example

Research → Summarize → Create document → Send notification

Complete complex tasks end-to-end without manual steps

Implementation Guide

Prerequisites

  • Claude Desktop 0.7.0+ or Cursor IDE with MCP support
  • Basic understanding of MCP architecture and capabilities
  • Access credentials for integrated services (if required)
  • Willingness to experiment and iterate on configuration

Time Estimate

15-60 minutes depending on server complexity

Installation Steps

  1. 1.Install MCP server: npm install -g [package-name] or via GitHub
  2. 2.Add server configuration to ~/.claude/mcp.json
  3. 3.Provide required credentials and configuration
  4. 4.Restart Claude Desktop to load new server
  5. 5.Test basic functionality with simple prompts
  6. 6.Explore capabilities and experiment with use cases
  7. 7.Document successful patterns for reuse

Troubleshooting

  • MCP server not loading: Check config syntax, verify installation
  • Connection errors: Check network, firewall, credentials
  • Feature not working: Read server docs, check required parameters
  • Performance issues: Monitor resource usage, check for network latency
  • Conflicts with other servers: Check port assignments, namespace collisions

Best Practices

✓ Do

  • +Read server documentation thoroughly before setup
  • +Start with simple use cases to validate functionality
  • +Test in non-production environment first
  • +Monitor resource usage and performance
  • +Keep servers updated for bug fixes and new features
  • +Document configuration for team members
  • +Use environment variables for sensitive configuration

✗ Don't

  • Don't grant overly permissive access to MCP servers
  • Don't skip reading security considerations in docs
  • Don't expose sensitive data without proper controls
  • Don't run untrusted MCP servers without code review
  • Don't ignore error messages—investigate root cause

💡 Pro Tips

  • Combine multiple MCP servers for powerful workflows
  • Create custom MCP servers for your specific needs
  • Share successful configurations with team
  • Use MCP inspector for debugging
  • Join MCP community for tips and troubleshooting

Technical Details

Architecture

Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.

Protocols

  • Model Context Protocol (MCP)
  • JSON-RPC 2.0
  • stdio or HTTP transport

Compatibility

  • Claude Desktop
  • Cursor IDE
  • Custom MCP clients

When to Use This

✓ Use When

Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.

✗ Avoid When

Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.

Integration

  • Tool composition: Chain multiple MCP tools in workflows
  • Context augmentation: Provide AI with relevant external data
  • Action delegation: Let AI execute tasks on external systems
  • Bidirectional sync: Keep AI context and external systems in sync

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.453 reviews
  • Ava Reddy· Dec 28, 2024

    We evaluated Xcode against two servers with overlapping tools; this profile had the clearer scope statement.

  • Hassan Agarwal· Dec 12, 2024

    We wired Xcode into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Sophia Wang· Dec 8, 2024

    We evaluated Xcode against two servers with overlapping tools; this profile had the clearer scope statement.

  • Amelia Choi· Nov 19, 2024

    Xcode has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Luis Sharma· Nov 3, 2024

    Xcode is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Arjun Jackson· Oct 22, 2024

    Xcode has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Ava Khanna· Oct 18, 2024

    Xcode is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Daniel Chawla· Oct 10, 2024

    Xcode is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Sakura Abbas· Sep 17, 2024

    I recommend Xcode for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Dhruvi Jain· Sep 5, 2024

    Xcode is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

showing 1-10 of 53

1 / 6