Xcode MCP Server
Provides tools for managing CocoaPods dependencies, including adding and removing pods and migrating projects to Swift Package Manager.
Provides tools for interacting with Xcode, including building, testing, analyzing, archiving, cleaning projects, managing simulators and devices, profiling with xctrace, and opening files at specific lines.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Xcode MCP Serverbuild the project and run tests on iPhone 16 simulator"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Xcode MCP Server
Model Context Protocol Server for the Apple Ecosystem
Connect OpenCode, Codex and Claude Code to Xcode β 43 professional tools in a single index.js
π Language: English | EspaΓ±ol
Installation β’ Tools β’ OpenCode β’ Codex β’ Claude Code β’ Docs
What is this?
Xcode MCP Server is a serious, production-ready bridge between your AI IDE (OpenCode / Codex / Claude Code) and Xcode + Apple Dev Tools.
An LLM no longer just writes Swift: it builds, tests, profiles, manages simulators, physical devices, signing and even opens Xcode on the exact line β all via MCP
stdiowith no HTTP server.
Stack: ES Modules Β· @modelcontextprotocol/sdk@1.30 Β· StdioServerTransport Β· promisify(exec) Β· Yarn 4 Berry Β· Make
β Single-file
index.js(2250 lines) β no build step, no compile, auditable in one file. Shebang#!/usr/bin/env node, ready fornode,yarn startornpx.β 43 tools with strict JSON Schema (
additionalProperties:false) + globaltry/catch. Each tool returnscontent: [{type:"text"}]andisError:trueon failure β no// TODO.β Full Apple coverage:
xcodebuild,simctl(9),devicectl(2),xctrace(5 templates),agvtool,security,osascript/xed.β Modern DX: Vendored Yarn 4 (
.yarn/releases), self-documentingMakefilewithhelp, modulardocs/, macOS CI +make testsmoke.β Multi-client: same
index.jsworks with OpenCode, Codex and Claude Code without changes.
Related MCP server: Xcode MCP Server
β¨ Features
Category | Tools | Description |
Build | 6 |
|
Tests | 2 |
|
Simulators | 9 |
|
Devices | 2 |
|
Profiling | 1 |
|
Versions | 2 |
|
Editor | 2 |
|
Localization | 1 |
|
Assets | 6 |
|
AppIcon | 1 |
|
Package / SPM | 11 |
|
π Table of Contents
π¦ Requirements
Dependency | Version | Install | Required |
macOS | 13+ (14+ recommended) | β | β
for |
Xcode | 15+ | App Store β | β |
Node.js | β₯ 18 |
| β |
Yarn | 4.x Berry |
| β |
make | 3.81+ |
| β |
swift-format | latest |
| β»οΈ optional |
swiftlint | latest |
| β»οΈ optional |
Linux/Windows: only
make lintworks (no Xcode). CI runs asyntax-linuxjob for that.
π Step-by-step Installation
Follow exactly in this order. Copy and paste block by block.
Step 0 β Verify Xcode and Node
xcodebuild -version
# Xcode 15.4 Build version 15F31d
node --version
# v20.11.0 (or newer)
yarn --version
# 4.18.0 β if "command not found", run:
corepack enable
corepack prepare yarn@stable --activate
yarn --versionStep 1 β Clone the repository
git clone https://github.com/YanxReal/Xcode-MPC.git
cd Xcode-MPCStep 2 β Install dependencies
Option A β with Make (recommended, modern):
make installWhat make install does:
Detects
yarn, installs viacorepackif missingRuns
yarn install(readsyarn.lock, installs@modelcontextprotocol/sdk)Runs
chmod +x index.js
Expected output:
β€ YN0000: Β· Yarn 4.18.0
β€ YN0000: β Resolution step
β€ YN0000: β Completed
β€ YN0000: Β· Done with warnings in 3s
β dependencies installedOption B β with Yarn directly:
yarn install
chmod +x index.jsIf you come from npm:
rm -f package-lock.json
yarn installStep 3 β Verify the environment
make doctorShould show:
Node: v20.x
Yarn: 4.18.0
Xcode: Xcode 15.x
xcrun: xcrun version 70
...
β doctor completeIf you see xcodebuild: command not found:
sudo xcode-select -s /Applications/Xcode.appStep 4 β Validate the MCP server
make lint
# β node --check index.js
# β lint ok
make test
# β smoke test MCP...
# β tools/list: 43 tools
# β xcode_sync_strings OK
# β xcode_certificates_check OK
# β smoke test PASSEDOr manually:
python3 scripts/smoke_test.py
# or
node scripts/smoke_test.mjsStep 5 β Configure your AI client
Pick one (or all three β same index.js works everywhere):
Client | Config file | Command |
OpenCode |
|
|
Codex |
|
|
Claude Code |
| CLI or |
Full step-by-step with copy-paste JSON/TOML:
Step 6 β Restart and test
Restart OpenCode / Codex / Claude Code and type:
list the xcode toolsYou should see 43 tools and in the log:
β
Xcode MCP Server started (stdio) β 43 tools registeredDone! Now you can say:
Build MyApp with xcode_build scheme MyApp destination "platform=iOS Simulator,name=iPhone 15"β Verification
# 1. Syntax
make lint
# 2. Smoke MCP (no Xcode needed, just Node)
make test
# 3. Apple environment
make doctor
# Checks: node, yarn, xcodebuild, xcrun, simctl, swiftlint, security, osascript
# 4. Visual inspector (optional)
make inspect
# or
yarn inspect
# Open http://localhost:6274 β tools/list β tools/callπ§ Usage with OpenCode / Codex / Claude Code
OpenCode
~/.config/opencode/opencode.json:
{
"mcpServers": {
"xcode": {
"command": "node",
"args": ["/Users/YanxReal/Dev/Tools/Xcode-MPC/index.js"],
"env": {}
}
}
}Codex (OpenAI)
~/.codex/config.toml:
[mcp_servers.xcode]
command = "node"
args = ["/Users/YanxReal/Dev/Tools/Xcode-MPC/index.js"]Claude Code (Anthropic)
claude mcp add xcode -- node /Users/YanxReal/Dev/Tools/Xcode-MPC/index.js
# verify
claude mcp list
# xcode: connected β 43 toolsOr per-project with .mcp.json:
{
"mcpServers": {
"xcode": {
"command": "node",
"args": ["/Users/YanxReal/Dev/Tools/Xcode-MPC/index.js"]
}
}
}Prompt examples for each client β
docs/opencode.mdΒ·docs/codex.mdΒ·docs/claude-code.mdΒ· Templates:.mcp.json.exampleΒ·.codex-config.toml.example
π οΈ Tools (43)
1. Build, Diagnostics & Clean
Tool |
| Key args |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2. Tests & Coverage
Tool |
| Key args |
|
|
|
|
|
|
3. Simulators xcrun simctl (9)
simctl_list (filter booted), simctl_lifecycle (boot|shutdown|erase), simctl_install_launch, simctl_media_capture (screenshot|record), simctl_push_notification, simctl_location_mock, simctl_privacy_control, simctl_ui_appearance (light|dark), simctl_open_url
4. Physical Devices xcrun devicectl (2)
devicectl_list (--json), devicectl_logs (deviceUdid*, durationSeconds)
5. Profiling xcrun xctrace (1)
xctrace_profile (template: Time Profiler|Allocations|Leaks|System Trace, timeLimitSeconds, outputFilePath*)
6. Versions & Security (2)
agvtool_version_bump (bump_build|set_version|set_build), xcode_certificates_check (security find-identity)
7. Xcode GUI Editor (2)
xcode_get_active_file (AppleScript osascript), xcode_open_at_line (filePath*, line*, column β xed β xcode://)
8. Localization (1)
xcode_sync_strings (.xcstrings β missing / pendingTranslation / emptyValues)
9. Assets Assets.xcassets + actool (6)
asset_list_contents (list *.colorset/*.imageset), asset_manage_color (#RRGGBB Light + Dark), asset_manage_image (scales/vector + preserves-vector-representation), asset_read_info (Contents.json), asset_delete (safe), asset_validate_actool (xcrun actool --compile)
10. AppIcon ALL Apple OS (1)
asset_generate_appicon (iOS, macOS, watchOS, tvOS, visionOS β 42 slots, sips -z if baseImagePath)
11. Package SPM / CocoaPods / Carthage (11)
package_resolve/update/list/read_resolved/reset_cache/compute_checksum, spm_add/remove_dependency, cocoapods_manage, carthage_manage, cocoapods_to_spm_migrate (PodfileβPackage.swift)
Full reference with JSON Schema + copy-paste examples β
docs/tools.md
π Make Commands
make help # Show this pretty help (colors)
make install # yarn install + chmod +x
make reinstall # clean + install (from scratch)
make lint # node --check index.js
make doctor # Check Node/Yarn/Xcode/simctl/swiftlint/osascript
make test # Smoke test MCP (43 tools + 2 calls)
make start # yarn start (stdio)
make dev # yarn dev (--watch)
make inspect # MCP Inspector at http://localhost:6274
make clean # Remove node_modules/.yarn/cache/build
make fmt # prettier if available
make release VERSION=1.0.1 # bump + tag + pushDetails β docs/development.md
π Documentation
Doc | Audience | Covers |
Everyone | Yarn Berry, Corepack, | |
LLM / Dev | All 43 tools, JSON Schema, copy-paste JSON examples | |
OpenCode |
| |
Codex |
| |
Claude Code |
| |
Contributors | Structure, adding a tool, CI, release | |
Curious | Why single-file, helpers, dispatcher, stdio flow |
π§ͺ Manual Smoke Test
# Without Make:
python3 scripts/smoke_test.py
# STDERR: β
Xcode MCP Server started β 43 tools
# β tools/list: 43 tools
# β xcode_sync_strings OK
# β smoke test PASSED
# With Make:
make testποΈ Architecture
index.js (2250 lines, 1 file)
βββ Shebang + Imports (MCP SDK, promisify(exec), fs, path, os)
βββ Helpers: shellEscape, expandTilde, runCommand (try/catch + 10MB buffer), formatResult
βββ TOOLS[43]: Strict JSON Schema (additionalProperties:false)
βββ Handlers[43]: async handle_* with validation + fallbacks (xedβxcode://, swift-formatβswiftlint)
βββ Dispatcher: HANDLERS map + ListTools/CallTool (try/catch β isError:true)
βββ Server: StdioServerTransport (stdin JSON-RPC, stdout JSON-RPC, stderr logs)See docs/architecture.md for single-file decision, OpenCode β stdin β handler β xcrun β stdout flow.
π€ Contributing
# 1. Fork and branch
git checkout -b feat/my-tool
# 2. Develop: add to TOOLS + Handler + HANDLERS in index.js
make install && make lint && make test
# 3. Document in docs/tools.md + README.md
# 4. PRIssues: Bug Report Β· Feature Request Β· PR Template
CI runs on macos-14 and ubuntu-latest β your PR is tested automatically.
π License
MIT Β© YanxReal β see LICENSE.
π Links
MCP Spec: https://modelcontextprotocol.io
Yarn Berry: https://yarnpkg.com/getting-started
Made with β€οΈ for the Apple ecosystem Β· Yarn 4 + Make + CI + Docs
If it helps you, leave a β on GitHub
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceBridges Claude AI with Xcode, enabling AI-powered code assistance, project management, and automated development tasks securely on your local machine.76186385MIT
- -licenseNot gradedqualityNot gradedmaintenanceA server that acts as a bridge between Claude and local Xcode projects, enabling AI-powered code assistance, project management, and automated development tasks without exposing your code to the internet.
- AlicenseBqualityCmaintenanceProvides programmatic access to Xcode functionality, enabling AI assistants to create, build, test, and manage iOS/macOS projects directly.3385MIT
- AlicenseAqualityBmaintenanceEnable Claude Code, Cursor, or your favorite LLM to interact with Xcode, building your projects the same way you do, and seeing the same errors. Greatly increases productivity when working on iOS, iPadOS, macOS, visionOS, tvOS projects & Swift packages - or any time you might use Xcode.295MIT
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/YanxReal/Xcode-MPC'
If you have feedback or need assistance with the MCP directory API, please join our Discord server