Skip to main content

Drew's Xcode MCP Server (drews-xcode-mcp)

PyPI Python Versions Downloads MCP macOS Only Xcode License: MIT

GitHub last commit

An MCP (Model Context Protocol) server that enables AI assistants to control and interact with Xcode for Apple platform development.

Renamed from xcode-mcp-server. With several unrelated projects sharing that name — and Xcode itself now shipping a built-in MCP server — this project is now drews-xcode-mcp. Existing setups keep working: the old PyPI name is a compatibility package that forwards to this one, and all settings carry over. When convenient, update your MCP configuration to run drews-xcode-mcp. If your server key/name is the old default xcode-mcp-server, we recommend renaming it to drews-xcode-mcp too — just remember to update any tool permission allowlists referencing the old tool names (mcp__xcode-mcp-server__* becomes mcp__drews-xcode-mcp__*). If you chose a custom key, keep it and tool permissions are unaffected.

What It Does

This server allows AI assistants (like Claude, Cursor, or other MCP clients) to:

  • Discover and navigate your Xcode projects and source files
  • Build and run iOS, macOS, tvOS, and watchOS applications
  • Execute and monitor tests with detailed results
  • Debug build failures by retrieving errors and warnings
  • Capture console output from running applications
  • Take screenshots of Xcode windows and iOS simulators
  • Manage simulators and view their status

The AI can perform complete development workflows - from finding a project, to building it, running tests, debugging failures, and capturing results.

Requirements

  • macOS - This server only works on macOS
  • Xcode - Xcode must be installed
  • Python 3.10+ - For running the server (uvx will fetch a compatible Python automatically if your system Python is older)

Security

The server implements path-based security to control which directories are accessible:

  • With restrictions: Set XCODEMCP_ALLOWED_FOLDERS=/path1:/path2:/path3 to limit access to specific directories
  • Default: If not specified, allows access to your home directory ($HOME)

Security requirements:

  • All paths must be absolute (starting with /)
  • No .. path components allowed
  • All paths must exist and be directories

Setup

First, ensure uv is installed (required for all methods below):

which uv || brew install uv

1. Claude Code (Recommended)

claude mcp add --scope user --transport stdio -- drews-xcode-mcp `which uvx` drews-xcode-mcp

To run a specific version, use:

# Example: How to run v1.3.0b6
claude mcp add --scope user --transport stdio -- drews-xcode-mcp `which uvx` drews-xcode-mcp==1.3.0b6

That's it! Claude Code handles the rest automatically.

2. Claude Desktop

Edit your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json):

{
    "mcpServers": {
        "drews-xcode-mcp": {
            "command": "uvx",
            "args": [
                "drews-xcode-mcp"
            ]
        }
    }
}

If you'd like to allow only certain projects or folders to be accessible by drews-xcode-mcp, add the env option, with a colon-separated list of absolute folder paths, like this:

{
    "mcpServers": {
        "drews-xcode-mcp": {
            "command": "uvx",
            "args": [
                "drews-xcode-mcp"
            ],
            "env": {
                "XCODEMCP_ALLOWED_FOLDERS": "/Users/andrew/my_project:/Users/andrew/Documents/source"
            }
        }
    }
}

3. Cursor AI

In Cursor: Settings → Tools & Integrations → + New MCP Server

Or edit ~/.cursor/mcp.json directly:

{
    "mcpServers": {
        "drews-xcode-mcp": {
            "command": "uvx",
            "args": ["drews-xcode-mcp"]
        }
    }
}

Optional: Add folder restrictions with an env section (same format as Claude Desktop above).

Usage

Once configured, simply ask your AI assistant to help with Xcode tasks:

  • "Find all Xcode projects in my home directory"
  • "Build the project at /path/to/MyProject.xcodeproj"
  • "Run tests for this project and show me any failures"
  • "What are the build errors in this project?"
  • "Show me the directory structure of this project"
  • "Take a screenshot of the Xcode window"

Most tools work with paths to .xcodeproj or .xcworkspace files, or with regular directory paths for browsing and navigation.

Advanced Configuration

Command Line Arguments

When running the server directly (for development or custom setups), these options are available:

Build output control:

  • --no-build-warnings - Show only errors, exclude warnings
  • --always-include-build-warnings - Always show warnings (default)

Notifications:

  • --show-notifications - Enable macOS notifications for operations
  • --hide-notifications - Disable notifications (default)

Access control:

  • --allowed /path - Add allowed folder (can be repeated)

Example:

drews-xcode-mcp --no-build-warnings --show-notifications --allowed ~/Projects

Note: When using MCP clients (Claude, Cursor), configure these via the env section in your client's config file instead.

Development

The server is built with FastMCP and uses AppleScript to communicate with Xcode.

Local Testing

Test with MCP Inspector:

export XCODEMCP_ALLOWED_FOLDERS=~/Projects
mcp dev drews_xcode_mcp/__main__.py

This opens an inspector interface where you can test tools directly. Provide paths as quoted strings: "/Users/you/Projects/MyApp.xcodeproj"

Limitations

  • AppleScript syntax may need adjustments for specific Xcode versions
  • Some operations require the project to be open in Xcode first

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drews_xcode_mcp-1.3.22.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drews_xcode_mcp-1.3.22-py3-none-any.whl (154.9 kB view details)

Uploaded Python 3

File details

Details for the file drews_xcode_mcp-1.3.22.tar.gz.

File metadata

  • Download URL: drews_xcode_mcp-1.3.22.tar.gz
  • Upload date:
  • Size: 117.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for drews_xcode_mcp-1.3.22.tar.gz
Algorithm Hash digest
SHA256 d4d7a094720b765da39619594d360fa05bdf47725c1817b5cf3d574069765c87
MD5 ccd4a5fb743e508bfd9fab7b4bacc1b8
BLAKE2b-256 41cdd737c4ee458b14b314d3491f3a16ffe672cbf86bb1f035432342a777ccd4

See more details on using hashes here.

File details

Details for the file drews_xcode_mcp-1.3.22-py3-none-any.whl.

File metadata

File hashes

Hashes for drews_xcode_mcp-1.3.22-py3-none-any.whl
Algorithm Hash digest
SHA256 07a2e1e3fe847c5fa942fa9b21a44f83323ee6850a70239e170f1c5e13aa3e80
MD5 54bc94ca8ddf652a2b6cd5be2595f9ab
BLAKE2b-256 d7800821a12d7cad40ba44462e02092552d878d4b613c97ff22d91264e81baca

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.23

2 files

This release

1.3.22 This release

2 files

1.3.21

2 files

1.3.20

2 files

1.3.19

2 files

1.3.18

2 files

1.3.17

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page