Skip to main content
Glama

Xcode MCP Server

The Xcode MCP Server provides a Model Context Protocol interface for building and testing Xcode projects. It enables AI assistants to directly trigger builds, run tests, monitor progress, and access logs through a standardized interface.

Features

  • Build Xcode projects with custom schemes and configurations

  • Run unit tests with granular control (run specific tests or skip tests)

  • Generate code coverage reports

  • Stream build and test logs in real-time

  • Access detailed build and test reports

  • JSON-formatted output

  • Automatic log persistence

Related MCP server: sl-test

Requirements

  • Node.js 16+

  • Xcode Command Line Tools

  • TypeScript

  • MCP-compatible client (e.g., Claude Desktop)

Installation

# Clone the repository
git clone https://github.com/PolarVista/Xcode-mcp-server.git
cd xcode-mcp-server

# Install dependencies
npm install

# Build the server
npm run build

Usage with Claude Desktop

  1. Start the server:

    npm run start /path/to/build/logs/directory
  2. In Claude Desktop settings:

           "command": "node",
           "args": ["/path/to/the/xcode-mcp-server/build/index.js",
                    "/path/to/your/project/folder"],
           "env": {
             "PATH": "/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin"
       }

Available Tools

build_project

Builds an Xcode project with specified parameters.

Parameters:

  • projectPath (required): Path to the .xcodeproj or .xcworkspace

  • scheme (required): Build scheme name

  • configuration (optional): Build configuration (Debug/Release, defaults to Debug)

  • destination (optional): Build destination (defaults to "platform=iOS Simulator,name=iPhone 15 Pro")

Example usage in Claude:

build_project({
  projectPath: "/path/to/Project.xcodeproj",
  scheme: "MyApp",
  configuration: "Debug"
})

run_tests

Runs unit tests with optional filtering.

Parameters:

  • projectPath (required): Path to the .xcodeproj or .xcworkspace

  • scheme (required): Test scheme name

  • testIdentifier (optional): Specific test to run (e.g., 'MyTests/testExample')

  • skipTests (optional): Array of test identifiers to skip

  • configuration (optional): Build configuration (Debug/Release, defaults to Debug)

  • destination (optional): Test destination (defaults to "platform=iOS Simulator,name=iPhone 15 Pro")

Example usage in Claude:

run_tests({
  projectPath: "/path/to/Project.xcodeproj",
  scheme: "MyAppTests",
  testIdentifier: "LoginTests/testSuccessfulLogin",
  skipTests: ["PerformanceTests/testLargeDataLoad"],
  configuration: "Debug"
})

Logs

  • All logs are stored in the specified base directory under build-logs/

  • Build operations create:

    • Plain text log (build-[timestamp].log)

    • JSON-formatted log (build-[timestamp].log.json)

    • Xcode report (report-[timestamp].txt)

  • Test operations create:

    • Test log (test-[timestamp].log)

    • JSON-formatted log (test-[timestamp].log.json)

    • Test report (test-report-[timestamp].txt)

    • Code coverage report (coverage-[timestamp].txt)

  • Latest log (build or test) is accessible via the xcode-build://latest-log resource

Available Tools

18 tools
analyze_fileB

Analyzes a source file for potential issues using Xcode's static analyzer.

Inputs: filePath (required).

boot_simulatorC

Boots an iOS simulator identified by its UDID.

Inputs: udid (required).

build_projectC

Builds the active Xcode project using the specified configuration and scheme.

Inputs: configuration (required), scheme (required).

compile_asset_catalogC

Compiles an asset catalog using 'actool'.

Inputs: catalogPath (required), outputDir (required).

get_active_projectB

Retrieves detailed information about the currently active Xcode project.

Inputs: no named parameters.

list_directoryC

Lists the contents of a directory, showing both files and subdirectories.

Inputs: path (required).

list_project_filesC

Lists all files within an Xcode project.

Inputs: projectPath (required), fileType.

list_simulatorsA

Lists all available iOS simulators with their details by invoking 'xcrun simctl list --json'.

Inputs: no named parameters.

read_fileC

Reads the contents of a file within the active Xcode project.

Inputs: filePath (required).

run_lldbC

Launches the LLDB debugger with custom arguments.

Inputs: lldbArgs.

run_testsC

Executes tests for the active Xcode project.

Inputs: testPlan.

run_xcrunC

Executes a specified Xcode tool via 'xcrun'.

Inputs: tool (required), arguments.

set_project_pathC

Sets the active Xcode project by specifying the path to its .xcodeproj directory.

Inputs: projectPath (required).

set_projects_base_dirC

Sets the base directory where your Xcode projects are stored.

Inputs: baseDir (required).

shutdown_simulatorA

Shuts down an active iOS simulator using its UDID.

Inputs: udid (required).

swift_package_updateA

Updates the dependencies of your Swift project using Swift Package Manager by invoking 'swift package update'.

Inputs: no named parameters.

trace_appC

Captures a performance trace of an application using 'xctrace'.

Inputs: appPath (required), duration.

write_fileB

Writes or updates the content of a file in the active Xcode project.

Inputs: filePath (required), content (required), createIfMissing.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between list_directory and list_project_files, as both list files, though one is general and the other project-specific. Tools like analyze_file and trace_app are clearly differentiated for static analysis vs. performance tracing.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as analyze_file, boot_simulator, and build_project. There are no deviations in naming style, making the set predictable and easy to parse.

    Tool Count4/5

    With 18 tools, the count is slightly high but reasonable for an Xcode server covering project management, building, testing, debugging, and simulator operations. It might feel a bit heavy, but each tool appears to serve a specific function in the domain.

    Completeness4/5

    The toolset provides good coverage for Xcode workflows, including project setup, building, testing, debugging, and simulator control. Minor gaps might include tools for code signing or managing provisioning profiles, but core operations are well-represented.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      D
      quality
      D
      maintenance
      A Model Context Protocol server that provides tools for Xcode-related operations, making it easier to work with iOS project management, building, testing, archiving, and deploying apps to both simulators and physical devices.
      9
      12 npm
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to parse Xcode and Swift build outputs into structured, token-efficient formats like JSON or TOON. It provides tools for executing build commands and extracting detailed diagnostic information such as errors, warnings, and test failures.
      8
      MIT