Skip to content

Commit 77aa4bf

Browse files
committed
Added support for managing simulators, build and running macos app and more
1 parent 3098619 commit 77aa4bf

File tree

13 files changed

+2273
-253
lines changed

13 files changed

+2273
-253
lines changed

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# XcodeBuild MCP
2+
3+
A Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants and other MCP clients.
4+
5+
## Overview
6+
7+
This project implements an MCP server that exposes Xcode operations as tools that can be invoked by MCP clients. It allows AI assistants or other tools to interact with Xcode projects programmatically through a standardised interface.
8+
9+
## Features
10+
11+
The XcodeBuildMCP server provides the following tools:
12+
13+
### Build tools
14+
- **build**: Builds the project using xcodebuild with support for workspaces, projects, schemes, and various platforms (iOS, macOS, watchOS, tvOS, visionOS and their simulator variants).
15+
- **showBuildSettings**: Shows build settings for the project using xcodebuild.
16+
- **getAppPath**: Extracts the app bundle path from build settings, making it easier to find the built app for installation or launching.
17+
- **listSchemes**: Lists all available schemes in an Xcode project or workspace.
18+
- **clean**: Cleans build products using xcodebuild's native clean action.
19+
20+
### Simulator tools
21+
- **listSimulators**: Lists available iOS simulators with their UUIDs.
22+
- **bootSimulator**: Boots an iOS simulator using a specified UUID.
23+
- **openSimulator**: Opens the iOS Simulator app to view the simulator UI.
24+
- **installAppInSimulator**: Installs an app in an iOS simulator.
25+
- **launchAppInSimulator**: Launches an app in an iOS simulator using its bundle ID.
26+
27+
### macOS tools
28+
29+
- **launchMacOSApp**: Launches a macOS app using the open command.
30+
31+
### Bundle ID tools
32+
- **getBundleId**: Extracts the bundle identifier from an app bundle (.app).
33+
- **getiOSBundleId**: Extracts the bundle identifier from an iOS app bundle.
34+
- **getMacOSBundleId**: Extracts the bundle identifier from a macOS app bundle.
35+
36+
## Getting started
37+
38+
### Prerequisites
39+
40+
- Node.js (v16 or later)
41+
- npm
42+
- Xcode command-line tools
43+
44+
### Installation
45+
46+
1. Clone the repository
47+
2. Install dependencies:
48+
```
49+
npm install
50+
```
51+
3. Build the project:
52+
```
53+
npm run build
54+
```
55+
4. Optionally start the server:
56+
```
57+
node build/index.js
58+
```
59+
60+
> [!NOTE]
61+
> You don't need to run the server manually as MCP clients will do this for you.
62+
63+
## Adding to Windsurf/Cursor/Clude Desktop etc.
64+
65+
Create a new custom server configuration and add the following; changing the path to the actual path you cloned the repo to.
66+
67+
```json
68+
{
69+
"mcpServers": {
70+
"XcodeBuildMCP": {
71+
"command": "node",
72+
"args": [
73+
"/path_to/XcodeBuildMCP/build/index.js"
74+
]
75+
}
76+
}
77+
}
78+
```
79+
80+
## Debugging
81+
82+
You can use MCP Inspector via:
83+
84+
```bash
85+
npx @modelcontextprotocol/inspector node build/index.js
86+
```
87+
88+
## Licence
89+
90+
This project is licensed under the MIT License - see the LICENSE file for details.

example_projects/iOS/MCPTest.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
CODE_SIGN_STYLE = Automatic;
397397
CURRENT_PROJECT_VERSION = 1;
398398
DEVELOPMENT_ASSET_PATHS = "\"MCPTest/Preview Content\"";
399-
DEVELOPMENT_TEAM = BR6WD3M6ZD;
399+
DEVELOPMENT_TEAM = "";
400400
ENABLE_PREVIEWS = YES;
401401
GENERATE_INFOPLIST_FILE = YES;
402402
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@@ -425,7 +425,7 @@
425425
CODE_SIGN_STYLE = Automatic;
426426
CURRENT_PROJECT_VERSION = 1;
427427
DEVELOPMENT_ASSET_PATHS = "\"MCPTest/Preview Content\"";
428-
DEVELOPMENT_TEAM = BR6WD3M6ZD;
428+
DEVELOPMENT_TEAM = "";
429429
ENABLE_PREVIEWS = YES;
430430
GENERATE_INFOPLIST_FILE = YES;
431431
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;

example_projects/macOS/MCPTest.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
COMBINE_HIDPI_IMAGES = YES;
398398
CURRENT_PROJECT_VERSION = 1;
399399
DEVELOPMENT_ASSET_PATHS = "\"MCPTest/Preview Content\"";
400-
DEVELOPMENT_TEAM = BR6WD3M6ZD;
400+
DEVELOPMENT_TEAM = "";
401401
ENABLE_HARDENED_RUNTIME = YES;
402402
ENABLE_PREVIEWS = YES;
403403
GENERATE_INFOPLIST_FILE = YES;
@@ -424,7 +424,7 @@
424424
COMBINE_HIDPI_IMAGES = YES;
425425
CURRENT_PROJECT_VERSION = 1;
426426
DEVELOPMENT_ASSET_PATHS = "\"MCPTest/Preview Content\"";
427-
DEVELOPMENT_TEAM = BR6WD3M6ZD;
427+
DEVELOPMENT_TEAM = "";
428428
ENABLE_HARDENED_RUNTIME = YES;
429429
ENABLE_PREVIEWS = YES;
430430
GENERATE_INFOPLIST_FILE = YES;

package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)