Get the FREE Ultimate OpenClaw Setup Guide →

xcode

MCP Server for interacting with Xcode

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio drewster99-xcode-mcp-server uvx xcode-mcp-server \
  --env XCODEMCP_ALLOWED_FOLDERS="Optional: colon-separated absolute folders to restrict access (e.g., /Users/you/projects:/Users/you/Documents)"

How to use

The Xcode MCP Server enables an AI assistant to interact with Xcode and Apple platform projects through the MCP (Model Context Protocol) interface. Once configured with uvx, you can ask the AI to discover Xcode projects, navigate source files, build and run apps for iOS/macOS/tvOS/watchOS, execute and monitor tests, retrieve build and runtime errors, capture console output, take screenshots of Xcode windows or simulators, and manage simulators. This server relies on AppleScript under the hood to communicate with Xcode and is intended to run on macOS with Xcode installed.

To use it, add the MCP server to your preferred client (Claude Desktop, Claude Code, Cursor, etc.) using the uvx command and point the client to the xcode-mcp-server executable. For example, you can configure Claude Code or Claude Desktop to run uvx xcode-mcp-server so the AI can load the server and start issuing Xcode-related commands. You can optionally constrain filesystem access with the XCODEMCP_ALLOWED_FOLDERS environment variable to limit which directories the AI can browse.

How to install

Prerequisites:

  • macOS
  • Xcode installed
  • Python 3.8+ (for running the server)
  • uv (the Unicode Virtual Machine) or uvx (the MCP transport) available on your PATH

Installation steps:

  1. Install uv (if not already installed):
    • macOS: brew install libuv
    • Ensure uvx is accessible: which uvx
  2. Install the xcode-mcp-server package (Python package name inferred from project):
    • pip install xcode-mcp-server
  3. Verify installation by running the server directly (optional for development):
    • uvx xcode-mcp-server
  4. Configure your MCP client (Claude Desktop/Code or Cursor) to load the server from the command above, using the provided command and arguments. Example client config: Claude Desktop / Cursor:
    • command: uvx
    • args: ["xcode-mcp-server"]
    • Optional env: XCODEMCP_ALLOWED_FOLDERS to restrict access
  5. If you prefer local testing without a client, you can run the server in development mode via MCP Inspector or equivalent tooling provided by MCP frameworks.

Additional notes

Tips and notes:

  • This server is macOS-only and requires Xcode to be installed on the host machine.
  • Security: Use XCODEMCP_ALLOWED_FOLDERS to restrict the paths the AI can access. All paths must be absolute directories.
  • If you encounter AppleScript compatibility issues with a newer Xcode, you may need to adjust the script or version compatibility within your environment.
  • When using MCP clients, the environment variable approach for access control is preferred (env in the client config) rather than altering the server startup parameters.
  • For debugging, you can run the server directly and use MCP Inspector or internal tools to validate commands before enabling client integration.

Related MCP Servers

Sponsor this space

Reach thousands of developers