
How to add Xcode MCP Server to Claude Desktop
Comprehensive Xcode integration for AI assistants: projects, builds, tests, simulators, SPM and CocoaPods. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 380โ ยท stdio ยท no auth
Claude Desktop 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 Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Xcode MCP Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Xcode MCP Server's tools appear under the ๐ tools menu.
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 Claude Desktop
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 + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Xcode MCP Server config there under the "mcpServers" key and restart the client.
Is Xcode MCP Server safe to use with Claude Desktop?
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).