xcode-cloud-mcp
xcode-cloud-mcp
App Store Connect API を介して、Xcode Cloud のプロダクトを検出し、ワークフローを調査・編集し、ビルド実行を監視し、ビルドの問題、ログ、テスト概要、UI テストアーティファクトを取得するための最小限の MCP サーバー。
機能
機能 | ツール | 使用例 | 戻り値の例 |
プロダクトの検出 |
| "このアカウントで利用可能な Xcode Cloud プロダクトを表示して。" |
|
ワークフローの検出 |
| "プロダクト |
|
ワークフロー設定の確認 |
| " |
|
実行中または最近のビルドの監視 |
| "監視できるように、ワークフロー |
|
ワークフローの有効化・無効化 |
| "新しい設定をテストしている間、ワークフロー |
|
名前・説明・クリーンモードの更新 |
| "ワークフロー |
|
開始条件の明示的な更新 |
| "ワークフロー | 更新された |
ワークフローアクション一覧の置換 |
| "ワークフロー | 削除後は |
ビルドの健全性をすばやく確認 |
| "ワークフロー |
|
コンパクトなビルドログ要約の読み取り |
| "ビルド |
|
ローカル grep 用にログを実体化 |
| "ローカルで grep できるように、ビルド |
|
テスト結果の要約 |
| "最新の失敗ビルドのテスト結果を要約して。" |
|
失敗したテストへ直接ジャンプ |
| "ビルド |
|
UI テストアーティファクトの取得 |
| "最新の失敗した UI テスト実行のスクリーンショットとビデオを表示して。" |
|
ローカル一時ファイルのクリーンアップ |
| "24 時間より古い保存済みログを削除して。" |
|
ビルドの検索はワークフロースコープです。取得ツールは、直接の buildRunId、または workflowId と buildNumber の組み合わせ、あるいは workflowId と buildSelector: "latest" | "latestFailing" の組み合わせを受け付けます。
list_products と list_workflows は、すべての結果を自動的にページネーションします。
list_build_runs は status: "all" | "failed" | "succeeded" | "running" | "pending" とオプションの limit(デフォルトは 20)をサポートしているため、エージェントは各実行をローカルで後処理したり MCP レスポンスサイズを膨張させたりすることなく、アクティブなワークフローをポーリングできます。
Related MCP server: appstore-release-mcp
要件
Node.js
20+Xcode Cloud にアクセスできる App Store Connect API の認証情報
環境変数
主な名前:
APPSTORE_CONNECT_API_KEY_IDAPPSTORE_CONNECT_API_ISSUER_IDAPPSTORE_CONNECT_API_KEY_CONTENT
互換エイリアス:
APP_STORE_KEY_IDAPP_STORE_ISSUER_IDAPP_STORE_PRIVATE_KEY
秘密鍵は、リテラルの複数行 PEM コンテンツとして、または \n をエスケープした文字列として渡すことができます。
Claude のセットアップ
claude mcp add xcode-cloud \
--env APPSTORE_CONNECT_API_KEY_ID="$APPSTORE_CONNECT_API_KEY_ID" \
--env APPSTORE_CONNECT_API_ISSUER_ID="$APPSTORE_CONNECT_API_ISSUER_ID" \
--env APPSTORE_CONNECT_API_KEY_CONTENT="$APPSTORE_CONNECT_API_KEY_CONTENT" \
-- npx -y @thatfactory/xcode-cloud-mcpCodex のセットアップ
codex mcp add xcode-cloud \
--env APPSTORE_CONNECT_API_KEY_ID="$APPSTORE_CONNECT_API_KEY_ID" \
--env APPSTORE_CONNECT_API_ISSUER_ID="$APPSTORE_CONNECT_API_ISSUER_ID" \
--env APPSTORE_CONNECT_API_KEY_CONTENT="$APPSTORE_CONNECT_API_KEY_CONTENT" \
-- npx -y @thatfactory/xcode-cloud-mcp利用可能なツール
list_products()list_workflows(productId)get_workflow_details(workflowId)list_build_runs(workflowId, limit?, status?)set_workflow_enabled(workflowId, enabled)update_workflow_general(workflowId, name?, description?, clean?)update_workflow_start_conditions(workflowId, branchStartCondition?, manualBranchStartCondition?, pullRequestStartCondition?, manualPullRequestStartCondition?, scheduledStartCondition?, tagStartCondition?, manualTagStartCondition?)update_workflow_actions(workflowId, actions)get_build_issues(buildRunId? workflowId? buildNumber? buildSelector?)get_build_logs(buildRunId? workflowId? buildNumber? buildSelector?, maxCharacters?)materialize_build_logs(buildRunId? workflowId? buildNumber? buildSelector?)get_test_results(buildRunId? workflowId? buildNumber? buildSelector?)get_failed_tests(buildRunId? workflowId? buildNumber? buildSelector?)get_test_artifacts(buildRunId? workflowId? buildNumber? buildSelector?)cleanup_saved_logs(buildRunId?, maxAgeHours?)
ログ取得の動作
get_build_logs は、意図的に MCP レスポンスをコンパクトに保ちます:
テキスト形式のビルドログアーティファクトをダウンロードして、一時的なローカルディレクトリに展開します
savedLogsDirectoryとsavedLogsを返すため、ローカルエージェントはrg、grep、またはcatで抽出されたファイルを調査できますコンパクトな
failedTestsの要約、highlights、および上限付きのexcerptを返します呼び出し側が非常に大きな
maxCharactersを渡した場合でも、インラインの excerpt は上限に切り詰められ、過大な MCP レスポンスを回避します
推奨されるエージェントのワークフロー:
get_failed_testsまたはget_build_logsを呼び出します。savedLogsDirectoryを読み取ります。そのディレクトリ内で
rgを使用して、失敗した正確なテストまたはアサーションを調べます。必要に応じて、調査が完了したら
cleanup_saved_logsを呼び出します。
一時ログは、システムの一時ディレクトリ配下の次のようなパスに書き込まれます:
/tmp/xcode-cloud-mcp/build-logs/<buildRunId>macOS では、これは通常 /var/folders/.../T/ 配下のパスに解決されます。
クリーンアップポリシー:
同じ
buildRunIdに対する呼び出しのたびに、そのビルド固有の一時ディレクトリを最初に削除して再作成します24 時間より古いビルドディレクトリは自動的に削除されます
単一の
buildRunIdに対して、または選択した保持期間より古いすべてのディレクトリに対して、cleanup_saved_logsを直接呼び出すこともできます
プロンプト例
Retrieve logs of the latest failing build for workflow abc123.Retrieve logs of build 81, then inspect the returned savedLogsDirectory and grep for Expectation failed.Get the failed tests for build 81, then open the saved logs directory and inspect the failing test in context.Retrieve logs of build number 42 for workflow abc123.Show me the latest failing UI test artifacts for workflow abc123.List the workflows for product def456 and then summarize the latest build.Show me the full workflow details for workflow abc123, including environment, start conditions, actions, and whether it is enabled.Disable workflow abc123, remove the archive action, then restore the original action list after the experiment.ワークフロー詳細の動作
get_workflow_details は、App Store Connect によって公開されている現在のワークフロー設定を返します。次のようにグループ化されます:
generalenvironmentstartConditionsactionspostActions
注記:
environmentには、App Store Connect が返す場合に、リポジトリ、xcodeVersion、macOsVersionが含まれます。actionsには、アクションタイプ、スキーム、プラットフォーム、宛先、合格必須状態、および存在する場合はテストプランの詳細が含まれます。postActionsは現在、注記付きの空の配列として返されます。観測された API レスポンスでは、App Store Connect のワークフローペイロードが個別のポストアクションを公開しないためです。
ワークフロー更新の動作
ワークフロー更新ツールは、意図的に明示的です:
set_workflow_enabledはisEnabledのみを切り替えますupdate_workflow_generalはname、description、cleanのみを変更しますupdate_workflow_start_conditionsは、渡した開始条件オブジェクトのみを変更しますupdate_workflow_actionsはactions配列全体を置き換えるため、呼び出し側は最初に現在のワークフローを取得し、その後で最終的に望むアクションリストを送信する必要があります
重要な制限:
Xcode Cloud でワークフローに
Restrict Editingが有効になっている場合、App Store Connect API キーにApp Managerアクセス権があっても編集が失敗することがありますMCP による編集を確実に機能させるには、書き込みツールを使用する前に、そのワークフローの
Restrict Editingチェックボックスをオフにしてくださいそれでも Apple がリクエストを拒否する場合は、
Adminなどより強力な API キーロールを使用してください
ローカル開発
依存関係をインストール:
npm installテストを実行:
npm testパッケージをビルド:
npm run buildAvailable Tools
18 toolscleanup_saved_logsA
Remove saved local log directories either for one build run or for all directories older than a retention window.
Inputs: buildRunId, maxAgeHours.
configure_manual_release_candidateA
Replace all actions with one macOS archive and all start conditions with manual builds from one exact branch. Requires TestFlight Deployment Preparation. Preserves enabled state. Does not configure tester-group post-actions; use Xcode or App Store Connect for those.
Inputs: branch (required), scheme (required), workflowId (required), buildDistributionAudience (required).
get_build_issuesC
Resolve a build and return build identity plus issue counts from Xcode Cloud.
Inputs: buildRunId, workflowId, buildNumber, buildSelector.
get_build_logsC
Resolve a build, download text-like log artifacts, save them under a temporary local directory, and return a compact summary with failed tests, highlights, and saved log paths that local agents can inspect with grep or cat.
Inputs: buildRunId, workflowId, buildNumber, buildSelector, +1 more.
get_build_run_testflight_buildsResolve TestFlight Builds from an Xcode Cloud RunARead-onlyIdempotent
Verify an exact run, workflow and App Store Connect app, then look up the externally eligible builds linked to the run. For automatic handoff, supply both the expected canonical branch ref and full source commit SHA. Use build IDs only when the overall status is ready.
Inputs: appId (required), platforms (required), buildRunId (required), workflowId (required), +2 more. Returns: appId, status, buildRun, platforms
get_failed_testsC
Resolve a build, ensure logs are materialized locally, and return only the detected failed tests with their assertion messages when available.
Inputs: buildRunId, workflowId, buildNumber, buildSelector.
get_test_artifactsC
Resolve a build and return metadata plus download URLs for UI test artifacts and result bundles.
Inputs: buildRunId, workflowId, buildNumber, buildSelector.
get_test_resultsC
Resolve a build and return build-level test summary information, saved local log paths, detected failed tests, and result bundle metadata.
Inputs: buildRunId, workflowId, buildNumber, buildSelector.
get_workflow_detailsA
Retrieve detailed Xcode Cloud workflow configuration, including environment, start conditions, actions, and enabled state.
Inputs: workflowId (required).
list_build_runsARead-onlyIdempotent
Scan recent build runs for a workflow with source provenance. Optionally filter by outcome and full source commit SHA. The scan reports whether additional runs remain beyond the limit.
Inputs: workflowId (required), limit, status, sourceCommitSha.
list_productsA
List Xcode Cloud products available to the configured App Store Connect account. Automatically paginates through all results.
Inputs: no named parameters.
list_workflowsA
List workflows for a given Xcode Cloud product. Automatically paginates through all results.
Inputs: productId (required).
materialize_build_logsB
Resolve a build, download and extract text-like log artifacts into a local temporary directory, and return saved file paths for grep or cat based investigation.
Inputs: buildRunId, workflowId, buildNumber, buildSelector.
set_workflow_enabledB
Explicitly enable or disable one Xcode Cloud workflow.
Inputs: enabled (required), workflowId (required).
start_buildStart Xcode Cloud BuildA
Start exactly one new Xcode Cloud build through Apple's public App Store Connect API. Each successful invocation creates a new build run, and repeating the same call can create another build. Individual build-run cancellation is not supported by Apple's public API.
Inputs: workflowId (required), clean, buildRunId, pullRequestId, +1 more.
update_workflow_actionsB
Explicitly replace the full workflow actions array. This should be used only when the caller intends to send the final desired action list.
Inputs: actions (required), workflowId (required).
update_workflow_generalC
Explicitly update general workflow fields such as name, description, and clean build behavior.
Inputs: workflowId (required), name, clean, description.
update_workflow_start_conditionsC
Explicitly update workflow start conditions. Pass null to remove a condition.
Inputs: workflowId (required), tagStartCondition, branchStartCondition, manualTagStartCondition, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Several clusters overlap: get_build_logs and materialize_build_logs both download/extract log artifacts, get_test_results and get_failed_tests both return failed-test info (the latter is a subset of the former), and get_test_artifacts covers similar ground. update_workflow_actions vs configure_manual_release_candidate also risk misselection since both rewrite the actions array, though descriptions do add disambiguating detail.
Names follow a consistent snake_case verb_noun convention (list_products, get_workflow_details, update_workflow_general, set_workflow_enabled, start_build, cleanup_saved_logs). Minor deviations: 'materialize_build_logs' uses an unusual verb and 'get_build_run_testflight_builds' is an awkward multi-noun compound, but the pattern remains readable and predictable.
18 tools is on the heavy side for a single-integration CI/CD server, and the granularity is uneven — log retrieval is split across three tools and test inspection across three more. The count is defensible given the breadth of Xcode Cloud resources, but a few tools could be consolidated.
Read/build/manage coverage is solid (products, workflows, build runs, logs, tests, TestFlight handoff), but lifecycle gaps exist: no create_workflow or delete_workflow, no way to fetch a single build run's full detail generically, and no independent TestFlight version/build listing. Some dead ends are acknowledged (build cancellation unsupported by Apple's API), which mitigates but does not eliminate the gaps.
Maintenance
Related MCP Connectors
MCP server for Appcircle mobile CI/CD platform.
MCP server exposing Buildkite API data (pipelines, builds, jobs, tests) to AI tooling and editors.
MCP server for interacting with the Supabase platform
The official Planning Center MCP server for interacting with your ministry's data.
Related MCP Servers
- AlicenseBqualityFmaintenanceAn MCP server to communicate with the App Store Connect API for iOS Developers25332MIT
- AlicenseAqualityDmaintenanceAn MCP server that drives the full App Store release cycle for iOS and macOS apps: version bump, archive + TestFlight upload, metadata, review submission, and status.850 npmMIT
- AlicenseNot gradedqualityCmaintenanceApp Store Connect MCP Server (Swift) that manages apps, builds, TestFlight, metadata, reviews natively on macOSMIT
- AlicenseNot gradedqualityBmaintenanceThis MCP server provides access to Apple's App Store Connect API. It allows users to inspect apps, versions, builds, TestFlight groups, sales, users, and optionally edit metadata and manage testers.173 npm2MIT