# xcode-mcp-server

> MCP Server

This repository provides an Xcode Model Context Protocol (MCP) server, enabling AI assistants to interact with Xcode projects, manage simulators, and automate various development tasks. This repository provides an Xcode

## Overview

- **Category:** Developer Tools
- **Language:** TypeScript
- **Stars:** 385
- **Forks:** 9
- **Owner:** r-huijts
- **GitHub:** https://github.com/r-huijts/xcode-mcp-server
- **Created:** 2025-01-16T12:15:47+00:00
- **Updated:** 2025-03-28T17:32:13+00:00
- **Source:** https://model-context-protocol.com/servers/xcode-mcp-server-ai-integration-automation

## Setup

## Setup

### 1. From Source

1. Clone this repository:
   ```bash
   git clone https://github.com/r-huijts/xcode-mcp-server.git
   cd xcode-mcp-server
   ```

2. Install dependencies:
   ```bash
   npm install
   ```

3. Set up environment variables:
   ```bash
   cp .env.example .env
   ```
   Edit `.env` and set `PROJECTS_BASE_DIR` to your Xcode projects directory.

4. Build the project:
   ```bash
   npm run build
   ```

Then update your Claude configuration:

```json
{
  "mcpServers": {
    "xcode": {
      "command": "node",
      "args": [
        "/absolute/path/to/xcode-mcp-server/dist/index.js"
      ],
      "env": {
        "PROJECTS_BASE_DIR": "/path/to/your/xcode/projects"
      }
    }
  }
}
```

> **Note**: Replace `/path/to/your/xcode/projects` with the actual path to your Xcode projects directory.

After updating the configuration, restart Claude Desktop for the changes to take effect.

## Tools

## Available Tools

		1. `set_projects_base_dir` - Set the base directory for Xcode projects
		2. `set_project_path` - Set the active Xcode project
		3. `get_active_project` - Get information about the current project
		4. `read_file` - Read contents of project files
		5. `write_file` - Write or update project files
		6. `list_project_files` - List all files in the project
		7. `analyze_file` - Run static analysis on source files
		8. `build_project` - Build the project with specified configuration
		9. `run_tests` - Execute project tests
		10. `run_xcrun` - Execute Xcode command-line tools
		11. `compile_asset_catalog` - Compile asset catalogs
		12. `swift_package_update` - Update Swift package dependencies
		13. `list_simulators` - Get available iOS simulators
		14. `boot_simulator` - Start a simulator by UDID
		15. `shutdown_simulator` - Stop a running simulator
		16. `run_lldb` - Launch the LLDB debugger
		17. `trace_app` - Capture app performance traces
