Skip to main content
Glama
README.md
# πŸ”¨ Xcode MCP Server

> **The first MCP server for Xcode** β€” Let AI agents like Claude build your iOS apps!

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![MCP](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io)
[![Platform](https://img.shields.io/badge/Platform-macOS-lightgrey.svg)](https://developer.apple.com/xcode/)

An MCP (Model Context Protocol) server that gives AI assistants the power to work with Xcode projects. List projects, read configurations, inspect targets, and trigger builds β€” all through natural conversation.

## ✨ Features

| Tool | Description |
|------|-------------|
| `list-projects` | Find all Xcode projects in a directory tree |
| `read-project` | Parse .xcodeproj structure (targets, configs, files) |
| `list-targets` | Get build targets with product types |
| `list-schemes` | List available build schemes |
| `build` | Trigger xcodebuild with configurable options |
| `xcodebuild-info` | Get Xcode version and available SDKs |

## πŸš€ Quick Start

### Prerequisites

- macOS with Xcode Command Line Tools (`xcode-select --install`)
- Node.js 18+
- npm or yarn

### Installation

```bash
# Clone the repo
git clone https://github.com/airdrop-alpha/xcode-mcp.git
cd xcode-mcp

# Install dependencies
npm install

# Build TypeScript
npm run build
```

### Configuration

#### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

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

#### OpenClaw

Add to your OpenClaw MCP config:

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

## πŸ’¬ Example Conversation

```
You: List Xcode projects in my Developer folder

Claude: Found 3 Xcode projects:
  β€’ MyApp.xcodeproj
  β€’ TestFramework.xcodeproj
  β€’ SampleProject.xcodeproj

You: What targets does MyApp have?

Claude: MyApp has 3 targets:
  β€’ MyApp (application)
  β€’ MyAppTests (unit-test)
  β€’ MyAppUITests (ui-test)

You: Build it for iPhone 15 simulator

Claude: βœ… Build succeeded!
```

## πŸ› οΈ Tool Reference

### list-projects

Find Xcode projects in a directory (recursive, 5 levels deep).

```json
{ "directory": "/path/to/search" }
```

### read-project

Parse an Xcode project file and return its structure.

```json
{ "projectPath": "/path/to/MyApp.xcodeproj" }
```

**Returns:** Project name, targets, build configurations, source files.

### list-targets

List build targets with their product types.

```json
{ "projectPath": "/path/to/MyApp.xcodeproj" }
```

**Returns:** Target names and types (app, framework, test, etc.)

### list-schemes

List available schemes (shared and user).

```json
{ "projectPath": "/path/to/MyApp.xcodeproj" }
```

### build

Build a project using xcodebuild.

```json
{
  "projectPath": "/path/to/MyApp.xcodeproj",
  "scheme": "MyApp",
  "configuration": "Debug",
  "destination": "platform=iOS Simulator,name=iPhone 15",
  "clean": false
}
```

### xcodebuild-info

Get Xcode version and SDK information. No parameters required.

## πŸ—οΈ Architecture

```
xcode-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts         # MCP server entry point
β”‚   └── xcode-parser.ts  # Xcode project file parser
β”œβ”€β”€ dist/                # Compiled JavaScript
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md
```

## ⚠️ Current Limitations

- Parses `.xcodeproj` files directly (simplified parser)
- `.xcworkspace` support coming soon
- Build output truncated to last 5KB for large projects
- Code signing disabled by default for faster builds

## πŸ—ΊοΈ Roadmap

- [ ] Workspace (`.xcworkspace`) support
- [ ] Simulator management (list, boot, install)
- [ ] Test execution with result parsing
- [ ] Swift Package dependencies
- [ ] Provisioning profile management
- [ ] App Store Connect integration

## 🀝 Contributing

Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.

```bash
# Development mode (hot reload)
npm run dev

# Test with MCP Inspector
npm run inspect
```

## πŸ“„ License

[MIT](LICENSE) Β© 2026

---

**Built for the AI-assisted development era. πŸ€–**

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: building projects, listing projects/schemes/targets, reading project details, and getting xcodebuild info. The descriptions reinforce these distinct roles, making misselection unlikely.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (list-projects, list-schemes, list-targets, read-project), but 'build' and 'xcodebuild-info' deviate slightly. The naming is still readable and predictable overall, with only minor inconsistencies.

Tool Count5/5

Six tools is well-scoped for an Xcode server, covering essential operations like building, listing, reading, and getting system info. Each tool earns its place without feeling excessive or insufficient for the domain.

Completeness4/5

The toolset covers core Xcode workflows well, including discovery, inspection, and building. Minor gaps exist, such as no explicit tools for running tests or managing dependencies, but agents can likely work around these with the provided tools.

Maintenance

ActivityInactive
ResponsivenessNo issues