Xcode MCP Server
Xcode MCP Server
Model Context Protocol Server für das Apple-Ökosystem
Verbinde OpenCode, Codex und Claude Code mit Xcode — 43 professionelle Tools in einer einzigen index.js
🌐 Sprache: Deutsch | Español
Installation • Tools • OpenCode • Codex • Claude Code • Dokumentation
Was ist das?
Xcode MCP Server ist eine ernsthafte, produktionsreife Brücke zwischen deiner KI-IDE (OpenCode / Codex / Claude Code) und Xcode + Apple Dev Tools.
Ein LLM schreibt nicht mehr nur Swift: Es baut, testet, profiliert, verwaltet Simulatoren, physische Geräte, Signierung und öffnet Xcode sogar an der exakten Zeile – alles über MCP
stdioohne HTTP-Server.
Stack: ES Modules · @modelcontextprotocol/sdk@1.30 · StdioServerTransport · promisify(exec) · Yarn 4 Berry · Make
✅ Einzeldatei
index.js(2250 Zeilen) – kein Build-Schritt, kein Kompilieren, in einer Datei prüfbar. Shebang#!/usr/bin/env node, bereit fürnode,yarn startodernpx.✅ 43 Tools mit striktem JSON-Schema (
additionalProperties:false) + globalestry/catch. Jedes Tool gibtcontent: [{type:"text"}]undisError:truebei Fehlern zurück – kein// TODO.✅ Volle Apple-Abdeckung:
xcodebuild,simctl(9),devicectl(2),xctrace(5 Vorlagen),agvtool,security,osascript/xed.✅ Moderne DX: Gebündeltes Yarn 4 (
.yarn/releases), selbst dokumentierendesMakefilemithelp, modularedocs/, macOS-CI +make testals Smoke-Test.✅ Multi-Client: Dieselbe
index.jsfunktioniert ohne Änderungen mit OpenCode, Codex und Claude Code.
Related MCP server: Xcode MCP Server
✨ Funktionen
Kategorie | Tools | Beschreibung |
Build | 6 |
|
Tests | 2 |
|
Simulatoren | 9 |
|
Geräte | 2 |
|
Profilierung | 1 |
|
Versionen | 2 |
|
Editor | 2 |
|
Lokalisierung | 1 |
|
Assets | 6 |
|
AppIcon | 1 |
|
Paket / SPM | 11 |
|
📋 Inhaltsverzeichnis
📦 Voraussetzungen
Abhängigkeit | Version | Installation | Erforderlich |
macOS | 13+ (14+ empfohlen) | — | ✅ für |
Xcode | 15+ | App Store → | ✅ |
Node.js | ≥ 18 |
| ✅ |
Yarn | 4.x Berry |
| ✅ |
make | 3.81+ |
| ✅ |
swift-format | aktuell |
| ◻️ optional |
swiftlint | aktuell |
| ◻️ optional |
Linux/Windows: Nur
make lintfunktioniert (kein Xcode). Die CI führt dafür einensyntax-linux-Job aus.
🚀 Schritt-für-Schritt-Installation
Befolge genau diese Reihenfolge. Kopiere und füge Block für Block ein.
Schritt 0 — Xcode und Node überprüfen
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 --versionSchritt 1 — Das Repository klonen
git clone https://github.com/YanxReal/Xcode-MPC.git
cd Xcode-MPCSchritt 2 — Abhängigkeiten installieren
Option A — mit Make (empfohlen, modern):
make installWas make install macht:
Erkennt
yarn, installiert es bei Bedarf übercorepackFührt
yarn installaus (liestyarn.lock, installiert@modelcontextprotocol/sdk)Führt
chmod +x index.jsaus
Erwartete Ausgabe:
➤ YN0000: · Yarn 4.18.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 3s
✓ dependencies installedOption B — direkt mit Yarn:
yarn install
chmod +x index.jsWenn du von npm kommst:
rm -f package-lock.json
yarn installSchritt 3 — Umgebung überprüfen
make doctorEs sollte Folgendes angezeigt werden:
Node: v20.x
Yarn: 4.18.0
Xcode: Xcode 15.x
xcrun: xcrun version 70
...
✓ doctor completeFalls du xcodebuild: command not found siehst:
sudo xcode-select -s /Applications/Xcode.appSchritt 4 — Den MCP-Server validieren
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 PASSEDOder manuell:
python3 scripts/smoke_test.py
# or
node scripts/smoke_test.mjsSchritt 5 — Deinen KI-Client konfigurieren
Wähle einen (oder alle drei – dieselbe index.js funktioniert überall):
Client | Konfigurationsdatei | Befehl |
OpenCode |
|
|
Codex |
|
|
Claude Code |
| CLI oder |
Vollständige Schritt-für-Schritt-Anleitung mit Copy-and-Paste-JSON/TOML:
Schritt 6 — Neu starten und testen
Starte OpenCode / Codex / Claude Code neu und tippe:
list the xcode toolsDu solltest 43 Tools sehen und im Log:
✅ Xcode MCP Server started (stdio) — 43 tools registeredFertig! Jetzt kannst du sagen:
Build MyApp with xcode_build scheme MyApp destination "platform=iOS Simulator,name=iPhone 15"✅ Überprüfung
# 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🔧 Verwendung mit 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 toolsOder pro Projekt mit .mcp.json:
{
"mcpServers": {
"xcode": {
"command": "node",
"args": ["/Users/YanxReal/Dev/Tools/Xcode-MPC/index.js"]
}
}
}Prompt-Beispiele für jeden Client →
docs/opencode.md·docs/codex.md·docs/claude-code.md· Vorlagen:.mcp.json.example·.codex-config.toml.example
🛠️ Tools (43)
1. Build, Diagnose & Bereinigen
Tool |
| Wichtige Argumente | |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| format |
2. Tests & Abdeckung
Werkzeug |
| Wichtige Argumente |
|
|
|
|
|
|
3. Simulatoren 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. Physische Geräte 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. Versionen & Sicherheit (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. Lokalisierung (1)
xcode_sync_strings (.xcstrings → missing / pendingTranslation / emptyValues)
9. Assets Assets.xcassets + actool (6)
asset_list_contents (listet *.colorset/*.imageset), asset_manage_color (#RRGGBB Hell + Dunkel), asset_manage_image (Skalierungen/Vektor + preserves-vector-representation), asset_read_info (Contents.json), asset_delete (sicher), asset_validate_actool (xcrun actool --compile)
10. AppIcon für alle Apple-Betriebssysteme (1)
asset_generate_appicon (iOS, macOS, watchOS, tvOS, visionOS — 42 Slots, sips -z falls baseImagePath)
11. Paketverwaltung 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)
Vollständige Referenz mit JSON-Schema + Copy-and-Paste-Beispielen →
docs/tools.md
📖 Make-Befehle
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
📚 Dokumentation
Dokument | Zielgruppe | Inhalt |
Alle | Yarn Berry, Corepack, | |
LLM / Dev | Alle 43 Werkzeuge, JSON-Schema, Copy-and-Paste-JSON-Beispiele | |
OpenCode |
| |
Codex |
| |
Claude Code |
| |
Mitwirkende | Struktur, Hinzufügen eines Werkzeugs, CI, Release | |
Interessierte | Warum Single-File, Helfer, Dispatcher, Stdio-Ablauf |
🧪 Manueller 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🏗️ Architektur
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)Siehe docs/architecture.md für die Single-File-Entscheidung und den Ablauf OpenCode → stdin → handler → xcrun → stdout.
🤝 Mitwirken
# 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: Fehlerbericht · Feature-Anfrage · PR-Vorlage
CI läuft auf macos-14 und ubuntu-latest — dein PR wird automatisch getestet.
📄 Lizenz
MIT © YanxReal — siehe LICENSE.
🔗 Links
MCP-Spezifikation: https://modelcontextprotocol.io
Yarn Berry: https://yarnpkg.com/getting-started
Mit ❤️ gemacht für das Apple-Ökosystem · Yarn 4 + Make + CI + Doku
Falls es dir hilft, hinterlasse einen ⭐ auf 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