
How to add Xcode MCP Server to Cursor
Comprehensive Xcode integration for AI assistants: projects, builds, tests, simulators, SPM and CocoaPods. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 380★ · stdio · no auth
Cursor config for Xcode MCP Server
git clone https://github.com/r-huijts/xcode-mcp-server.git && cd xcode-mcp-server && npm install && npm run build{
"mcpServers": {
"xcode-mcp-server": {
"command": "node",
"args": [
"/path/to/xcode-mcp-server/dist/index.js"
]
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Xcode MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Xcode MCP Server's tools to confirm it's connected.
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
What Xcode MCP Server can do in Cursor
create_xcode_projectCreate 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_packageAdd a Swift Package Manager dependency to the active project by URL with a version requirement (e.g. 'from: 5.0.0').
read_fileRead a file's contents with a specified encoding (e.g. utf-8); supports binary files via base64.
write_fileWrite content to a file, optionally creating it if missing.
search_in_filesSearch for text content within files in a directory using a file pattern and optional regex matching.
build_projectBuild the active project with customizable options such as scheme and configuration (e.g. Debug/Release).
test_projectRun tests for a scheme with detailed failure reporting, optionally specifying a test plan.
Security
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Xcode MCP Server config there under the "mcpServers" key and restart the client.
Is Xcode MCP Server safe to use with Cursor?
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.
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).