MCP Directory

Xcode MCP Server

Comprehensive Xcode integration for AI assistants: projects, builds, tests, simulators, SPM and CocoaPods.

Unverified
stdio (local)
No auth
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
git clone https://github.com/r-huijts/xcode-mcp-server.git && cd xcode-mcp-server && npm install && npm run build

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "xcode-mcp-server": {
      "command": "node",
      "args": [
        "/path/to/xcode-mcp-server/dist/index.js"
      ]
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • macOS with Xcode 14.0 or higher installed
  • Node.js 16 or higher
  • npm or yarn
  • Swift 5.5+ for Swift Package Manager features
  • CocoaPods (optional, for CocoaPods integration)
  • PROJECTS_BASE_DIR set to your projects base directory

About Xcode MCP Server

Xcode MCP Server is a TypeScript MCP server that gives AI assistants a standardized interface to Xcode. It detects and manages standard Xcode projects, workspaces, and Swift Package Manager projects; performs file operations, builds, tests, and archives; controls iOS simulators; and integrates CocoaPods and SPM. It connects to Claude Desktop over stdio by launching the compiled dist/index.js with Node, and enforces secure file access by validating all paths against allowed directories.

Tools & capabilities (7)

create_xcode_project

Create a new Xcode project from a template (e.g. ios-app, macOS, watchOS, tvOS) with options for name, output directory, organization name/identifier, language, tests, and setting it active.

add_swift_package

Add a Swift Package Manager dependency to the active project by URL with a version requirement (e.g. 'from: 5.0.0').

read_file

Read a file's contents with a specified encoding (e.g. utf-8); supports binary files via base64.

write_file

Write content to a file, optionally creating it if missing.

search_in_files

Search for text content within files in a directory using a file pattern and optional regex matching.

build_project

Build the active project with customizable options such as scheme and configuration (e.g. Debug/Release).

test_project

Run tests for a scheme with detailed failure reporting, optionally specifying a test plan.

When to use it

  • Scaffold a new iOS/macOS app from a template and add Swift Package dependencies via an AI assistant
  • Build, test, and analyze Xcode projects and surface detailed failure reports
  • Read, write, and search Swift source files within an allowed project directory
  • Control iOS simulators — boot, install/launch apps, take screenshots and record video
  • Manage CocoaPods and Swift Package Manager dependencies, and archive/validate builds for App Store submission

Security notes

All file operations are restricted to allowed directories via path validation (PROJECTS_BASE_DIR plus optional ALLOWED_PATHS). Input parameters are validated with Zod schemas, and external processes are executed with error handling. The server can read, write, and execute build/Xcode commands within the configured directories, so scope PROJECTS_BASE_DIR and ALLOWED_PATHS carefully.

Xcode MCP Server FAQ

How do I connect it to Claude Desktop?

Edit ~/Library/Application Support/Claude/claude_desktop_config.json and add an mcpServers entry named 'xcode' with command 'node' and args pointing to the built dist/index.js. An included setup.sh script can configure this automatically.

Is there a published npm package?

No. You install by cloning the repository, running npm install, and building with npm run build; then point the config at the compiled dist/index.js.

What platforms are supported?

macOS only, with Xcode 14.0+ installed. It requires Node.js 16+, and Swift 5.5+ for Swift Package Manager features (CocoaPods optional).

How is file access secured?

All file operations are restricted to allowed directories. You set PROJECTS_BASE_DIR (required) and can add ALLOWED_PATHS; the server validates every path against these before acting.

Alternatives to Xcode MCP Server

Compare all alternatives →

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 13 days agoRepo

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript
2 tools
Updated 17 days agoRepo

LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.

Verified
stdio (local)
No auth
Python
11 tools
Updated 15 days agoRepo