Skip to content

GyroJoe/xcode-ui-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xcode UI MCP

An MCP (Model Context Protocol) server that provides Xcode UI integration via AppleScript. Works with VS Code, GitHub Copilot, and other MCP clients.

Note: This code was generated by GitHub Copilot.

Features

  • Build Integration: Trigger builds via AppleScript with real-time progress updates, monitor status, and get errors/warnings
  • Scheme Management: List and switch between Xcode schemes
  • Build Diagnostics: Retrieve structured error and warning information from builds

Installation

uv sync

Usage

Configure in .vscode/mcp.json:

{
  "mcpServers": {
    "xcode-ui": {
      "command": "/opt/homebrew/bin/uv",
      "args": [
        "run",
        "mcp",
        "run",
        "src/server.py"
      ],
      "cwd": "/path/to/xcode-ui-mcp"
    }
  }
}

Development

Run the server in development mode:

uv run mcp dev src/server.py

Available Tools

Scheme Management

  • list_schemes() - Get all available Xcode schemes in the workspace
  • get_active_scheme() - Get the currently active scheme name
  • set_active_scheme(scheme_name: str) - Switch to a different scheme

Build Operations

  • build_scheme() - Trigger a build and monitor progress with real-time updates
    • Reports build status changes
    • Shows new errors as they occur
    • Updates warning counts periodically
    • Returns final build result

Build Diagnostics

  • get_build_status() - Check build completion and get counts
    • Returns: {completed: bool, status: str, errors: int, warnings: int}
  • get_build_errors(max_errors: int = None) - Get structured error information
    • Each error includes: file path, line, column, message
  • get_build_warnings(max_warnings: int = 20) - Get structured warning information
    • Each warning includes: file path, line, column, message

Implementation Details

  • Uses AppleScript to communicate with Xcode
  • Non-blocking build execution with status polling
  • Custom delimiter parsing to handle commas in error/warning messages
  • Graceful handling of missing file paths and line numbers

About

An MCP (Model Context Protocol) server that provides Xcode UI integration via AppleScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages