Xcode MCP Server
xcode-mcp
Xcode関連の操作ツールを提供するMCP(Model Context Protocol)サーバー。Claude DesktopなどのMCPクライアントからXcodeプロジェクトを簡単に操作できます。このサーバーは、Xcodeプロジェクト管理、ビルド、テスト、アーカイブ、コード署名、そして関連するiOS開発ツールのための様々なユーティリティを提供します。
特徴
Xcodeプロジェクト情報の取得とスキームの一覧表示
クリーンなカスタム出力オプションを備えた強化されたビルド機能
きめ細かな制御による包括的なテスト実行
アプリのアーカイブと配布用IPAエクスポート
コード署名とプロビジョニングプロファイル管理
Swift パッケージ マネージャーの統合
simctl による iOS シミュレータの管理
新機能: 自動 Xcode インストール検出と改善されたデバイス管理によるリアルデバイス アプリの展開と起動
自動再試行によるアプリのインストール失敗のインテリジェントな処理
デバイスとXcode情報をスマートにキャッシュしてパフォーマンスを向上
Related MCP server: MCP Xcode Server
インストール
npm install @devyhan/xcode-mcp使用法
Claude Desktopでの使用
Claude Desktop の設定ファイルを開きます:
# macOS open ~/Library/Application\ Support/Claude/claude_desktop_config.json次の構成を追加または変更します。
{ "mcpServers": { "xcode-mcp": { "command": "npx", "args": [ "@devyhan/xcode-mcp", "-y" ] } } }Claude Desktop を再起動します。
利用可能なツール
1. xcodeプロジェクト情報
ターゲット、構成、スキームなど、Xcode プロジェクトまたはワークスペースに関する詳細情報を取得します。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパス
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeprojサンプル出力:
{
"project": {
"name": "MyApp",
"targets": ["MyApp", "MyAppTests", "MyAppUITests"],
"configurations": ["Debug", "Release"],
"schemes": ["MyApp"]
}
}2. xcode-list-schemes
Xcode プロジェクトまたはワークスペースで使用可能なすべてのスキーム、ターゲット、および構成の包括的なリストを提供します。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパス
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeprojサンプル出力:
Information about project "MyApp":
Targets:
MyApp
MyAppTests
MyAppUITests
Build Configurations:
Debug
Release
Schemes:
MyApp
MyAppTests3. xcodeビルド
拡張オプションを使用してXcodeプロジェクトまたはワークスペースをビルドします。ワークスペースとプロジェクトの両方のビルド、クリーンビルド、カスタム出力ディレクトリをサポートします。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパスscheme(必須): 構築するスキームconfiguration(オプション):ビルド構成(例:デバッグ、リリース)destination(オプション):ビルド先(例: 'platform=iOS Simulator,name=iPhone 14')extraArgs(オプション): 追加の xcodebuild 引数を文字列の配列として指定します。outputDir(オプション): カスタムビルド出力ディレクトリ (SYMROOT)clean(オプション): クリーンビルドを実行するかどうか (デフォルト: false)
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj
Scheme: MyAppScheme
Configuration: Debug
Destination: platform=iOS Simulator,name=iPhone 14
Clean: true
OutputDir: /Users/username/Desktop/build生成されたコマンド:
xcodebuild -project "/Users/username/Projects/MyApp/MyApp.xcodeproj" -scheme "MyAppScheme" clean build -configuration "Debug" -destination "platform=iOS Simulator,name=iPhone 14" SYMROOT="/Users/username/Desktop/build"4. xcodeテスト
豊富なオプションを使用して、Xcode プロジェクトまたはワークスペースのテストを実行します。特定のテスト、テストプラン、さまざまなテストモードの実行など、テスト実行をきめ細かく制御できます。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパスscheme(必須): テストするスキームdestination(必須):テストの宛先(例:'platform=iOS Simulator,name=iPhone 14')testPlan(オプション): 使用するテストプランの名前onlyTesting(オプション): 実行する特定のテスト識別子の配列skipTesting(オプション): スキップするテスト識別子の配列resultBundlePath(オプション): テスト結果バンドルを保存するパスbuildForTesting(オプション): テストを実行せずにテストのみを目的としてビルドするtestWithoutBuilding(オプション): ビルドせずにテストを実行する
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj
Scheme: MyAppScheme
Destination: platform=iOS Simulator,name=iPhone 14
OnlyTesting: ["MyAppTests/LoginTests"]
ResultBundlePath: /Users/username/Desktop/TestResults生成されたコマンド:
xcodebuild -project "/Users/username/Projects/MyApp/MyApp.xcodeproj" -scheme "MyAppScheme" -destination "platform=iOS Simulator,name=iPhone 14" test -only-testing:"MyAppTests/LoginTests" -resultBundlePath "/Users/username/Desktop/TestResults"5. xcodeアーカイブ
Xcodeプロジェクトのアーカイブ(.xcarchive)を作成し、オプションで配布用のIPAファイルにエクスポートします。エクスポートオプションのplistを通じて、App Store、アドホック、エンタープライズ向けの配布方法をサポートします。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパスscheme(必須): アーカイブするスキームconfiguration(オプション):ビルド構成(例:リリース)archivePath(必須): .xcarchive ファイルを保存するパスexportPath(オプション): アーカイブをエクスポートするパス (例: IPA ファイル)exportOptionsPlist(オプション): exportOptions.plist ファイルへのパス
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj
Scheme: MyAppScheme
Configuration: Release
ArchivePath: /Users/username/Desktop/MyApp.xcarchive
ExportPath: /Users/username/Desktop/Export
ExportOptionsPlist: /Users/username/Projects/MyApp/exportOptions.plist生成されたコマンド:
# Archive command
xcodebuild -project "/Users/username/Projects/MyApp/MyApp.xcodeproj" -scheme "MyAppScheme" -configuration "Release" archive -archivePath "/Users/username/Desktop/MyApp.xcarchive"
# Export command (if exportPath and exportOptionsPlist are provided)
xcodebuild -exportArchive -archivePath "/Users/username/Desktop/MyApp.xcarchive" -exportPath "/Users/username/Desktop/Export" -exportOptionsPlist "/Users/username/Projects/MyApp/exportOptions.plist"6. xcode-codesign-info
Xcodeプロジェクトの包括的なコード署名およびプロビジョニングプロファイル情報を取得します。システムにインストールされているコード署名ID、プロジェクトのコード署名設定、およびプロビジョニングプロファイルを表示します。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパスtarget(オプション): 特定のターゲット名
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj
Target: MyAppTargetサンプル出力:
코드 서명 인증서 목록:
1) 01AB2345CD6789EF0123456789ABCDEF01234567 "Apple Development: John Doe (ABC12DEF34)"
2) 9876543210FEDCBA98765432109876543210FEDC "Apple Distribution: Example Corp (XYZ12ABC3)"
프로젝트 코드 서명 설정:
CODE_SIGN_IDENTITY = Apple Development
CODE_SIGN_STYLE = Automatic
DEVELOPMENT_TEAM = ABC123DEF4
PROVISIONING_PROFILE_SPECIFIER =
설치된 프로비저닝 프로파일:
-rw-r--r-- 1 username staff 12345 Feb 1 12:34 01234567-89ab-cdef-0123-456789abcdef.mobileprovision
-rw-r--r-- 1 username staff 23456 Mar 15 09:12 fedcba98-7654-3210-fedc-ba9876543210.mobileprovision7. Swift パッケージマネージャー
Swift パッケージを管理するための Swift Package Manager (SPM) 機能へのアクセスを提供します。init、update、resolve、reset、clean などの一般的な SPM コマンドをサポートします。
パラメータ:
command(必須): 実行する SPM コマンド ("init"、"update"、"resolve"、"reset"、"clean")packageDir(必須): Swift パッケージのディレクトリ パスextraArgs(オプション): 追加の SPM 引数 (文字列の配列)
例:
Command: update
PackageDir: /Users/username/Projects/MySwiftPackage
ExtraArgs: ["--enable-pubgrub-resolver"]生成されたコマンド:
cd "/Users/username/Projects/MySwiftPackage" && swift package update --enable-pubgrub-resolverサンプル出力:
Resolving dependencies...
Fetching https://github.com/example/example-package.git
Checking out https://github.com/example/example-package.git at 1.2.38. simctl-manager
simctlコマンドラインツールを介してiOSシミュレータの管理機能へのアクセスを提供します。アプリの一覧表示、作成、起動、インストール、シミュレータデバイスの管理をサポートします。
パラメータ:
command(必須):SimCtlコマンド(「list」、「create」、「boot」、「shutdown」、「erase」、「install」、「launch」、「delete」)extraArgs(オプション): 追加の simctl 引数を文字列の配列として指定します。
例:
Command: list
ExtraArgs: ["devices", "--json"]生成されたコマンド:
xcrun simctl list devices --jsonサンプル出力(省略) :
{
"devices": {
"com.apple.CoreSimulator.SimRuntime.iOS-17-0": [
{
"name": "iPhone 14",
"udid": "12345678-1234-1234-1234-123456789ABC",
"state": "Booted",
"isAvailable": true
}
]
}
}9. デバイス上で実行
物理iOSデバイス上でアプリをビルド、インストール、実行します。デバイス名(韓国語名を含む)またはUUIDによるデバイス選択、環境変数、ログストリーミングをサポートします。また、bundleIdの直接指定、ビルドスキップオプション、追加の起動引数もサポートします。
パラメータ:
projectPath(必須): Xcode プロジェクト (.xcodeproj) またはワークスペース (.xcworkspace) へのパスscheme(必須): ビルドして実行するスキームdevice(必須): デバイス識別子または名前(韓国語名をサポート)configuration(オプション):ビルド構成(例:デバッグ、リリース)streamLogs(オプション): 起動後にデバイスログをストリーミングするかどうかstartStopped(オプション): デバッガー接続のために一時停止状態でアプリを起動するかどうかenvironmentVars(オプション): アプリに渡す環境変数 (key1=value1、key2=value2 形式)xcodePath(オプション): Xcode アプリケーション パス (デフォルト: "/Applications/Xcode-16.2.0.app")listDevices(オプション): 実行前に検出されたすべてのデバイスとそのIDを表示します。skipBuild(オプション):すでにインストールされているアプリのビルドとインストールの手順をスキップしますextraLaunchArgs(オプション): devicectl launch コマンドに渡す追加の引数directBundleId(オプション): プロジェクトから抽出するのではなく、バンドルIDを直接指定します。
例:
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj
Scheme: MyAppScheme
Device: "Your-iPhone"
Configuration: Debug
StreamLogs: true
EnvironmentVars: "DEBUG_MODE=1,API_URL=https://test-api.example.com"プロセス:
このツールは指定されたデバイスのXcode UDIDとCoreDevice UUIDの両方を識別します。
アプリのビルドとインストールにはXcode UDIDを使用します
devicectlでアプリを起動するためにCoreDevice UUIDを使用するアプリのバンドル識別子を取得します
要求に応じて、デバイスのログをストリーミングします
v0.4.0の主な改善点:
プロジェクトを必要とせずにbundleIdを直接指定する機能
すでにインストールされているアプリのビルドとインストールの手順をスキップする
追加のdevicectl起動コマンド引数のサポート
デバイスモデルとOSバージョン情報の表示の改善
devicectlコマンドのパス処理とログ記録の改善
サンプル出力:
// Standard output with build and install
앱 실행 결과:
Launched application with com.example.myapp bundle identifier.
로그 스트리밍이 시작되었습니다. 로그는 터미널에서 확인할 수 있습니다.
// Direct bundle ID usage with skip build
기기 모델: iPhone14,7
기기 OS 버전: 17.0
사용자 지정 번들 ID 사용: com.example.myapp
빌드 및 설치 과정 건너뛰기
앱 실행 결과:
Launched application with com.example.myapp bundle identifier.サンプルシナリオ: LLM との使用
以下は、Claude のような LLM にこれらのツールを順番に使用するように指示する方法の例です。
クロードへのユーザープロンプト:
I need to inspect my Xcode project, run some tests, and then archive it for distribution.
1. First, use the xcode-list-schemes tool to get all available schemes for my project at /Users/username/Projects/MyApp/MyApp.xcodeproj
2. After you see the schemes, run tests for the first available scheme on the iPhone 14 simulator.
3. Then archive the app for distribution using the Release configuration.予想されるワークフロー:
Claude は
xcode-list-schemesツールを実行してすべてのスキームを取得します。Project path: /Users/username/Projects/MyApp/MyApp.xcodeprojClaude は、識別されたスキームを使用して
xcode-testツールを実行します。Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj Scheme: [First scheme from output] Destination: platform=iOS Simulator,name=iPhone 14次に、Claude は
xcode-archiveツールを使用してアーカイブを作成します。Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj Scheme: [First scheme from output] Configuration: Release ArchivePath: /Users/username/Desktop/MyApp.xcarchive
このワークフローは、1 つのツールからの出力を使用して別のツールのパラメータに通知し、複数のツールを連結する方法を示します。
例: 実機での実行
クロードへのユーザープロンプト:
I need to test my app on a real device:
1. Get the list of available devices (including connected physical devices)
2. Run my app on my connected iPhone 予想されるワークフロー:
クロードはまずデバイスのリストを取得します。
listDevices: trueClaude は物理デバイスを識別し、その上でアプリを実行します。
Project path: /Users/username/Projects/MyApp/MyApp.xcodeproj Scheme: MyApp Device: "Your iPhone" (or the device UUID) StreamLogs: true再構築せずにすぐに再起動するには:
Device: "Your iPhone" DirectBundleId: "com.example.myapp" SkipBuild: true
セキュリティに関する考慮事項
このツールはXcode関連のコマンドを実行する可能性があり、セキュリティリスクを伴います。ご注意ください。
信頼できる Xcode プロジェクトでのみ使用してください。
不明なソースからのプロジェクトには注意してください。
ビルドパラメータに機密情報を含めないでください。
発達
要件
Node.js 16以上
npm 6以上
Xcode 14以上(すべての機能)
Xcode 16以上(
devicectlおよび実デバイス機能に必要)
ローカル開発とテスト
# Clone the repository
git clone https://github.com/devyhan/xcode-mcp.git
cd xcode-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Test
npm testライセンス
マサチューセッツ工科大学
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
- AlicenseBqualityFmaintenanceA Model Context Protocol server that enables AI assistants to build and test Xcode projects directly through a standardized interface, with capabilities for running tests, monitoring progress, and accessing logs in real-time.189653MIT
- Alicense-qualityDmaintenanceAn MCP server that provides tools for programmatically interacting with Xcode projects, enabling users to manage targets, schemes, and files. It supports essential development tasks including building, testing, and cleaning projects through the Xcode command-line tools.15MIT
- AlicenseBqualityCmaintenanceA Model Context Protocol server implementation for iOS Simulator control, providing tools for device management, app operations, permissions, system features, and certificate handling.292020MIT
- AlicenseBqualityBmaintenanceA comprehensive MCP server for iOS/macOS development that gives AI assistants full control over Xcode build, test, simulator management, and app deployment.65152MIT
Related MCP Connectors
MCP server for Appcircle mobile CI/CD platform.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
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/devyhan/xcode-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server