Skip to main content
Glama
xcode-cloud-mcp

xcode-cloud-mcp

by thatfactory

xcode-cloud-mcp

极简 MCP 服务器,用于发现 Xcode Cloud 产品、检查和编辑工作流、监控构建运行,并通过 App Store Connect API 检索构建问题、日志、测试摘要和 UI 测试产物。

功能特性

功能

工具

示例用法

示例返回

发现产品

list_products

"显示此账户中可用的 Xcode Cloud 产品。"

Demo App、productType: APP、createdDate: 2026-03-30T10:00:00Z

发现工作流

list_workflows

"列出产品 def456 的工作流。"

Feature Branch、description、isEnabled: true、containerFilePath: Chauffeur.xcodeproj

检查工作流配置

get_workflow_details

"显示 abc123 的完整工作流详情,包括环境和操作。"

general、environment、startConditions、actions、postActions

监控运行中或最近的构建

list_build_runs

"显示工作流 abc123 正在运行的构建,以便我进行监控。"

number: 93、executionProgress: RUNNING、completionStatus: null、startedDate: ...

启用或禁用工作流

set_workflow_enabled

"在我们测试新设置期间禁用工作流 abc123。"

operation.type: set_workflow_enabled、workflow.general.isEnabled: false

更新名称、描述或清理模式

update_workflow_general

"将工作流 abc123 重命名为 Feature Branch v2 并调整其描述。"

changedFields: [name, description]、更新后的 workflow.general

显式更新启动条件

update_workflow_start_conditions

"更改工作流 abc123,使拉取请求构建不再自动取消。"

更新后的 workflow.startConditions.pullRequest.autoCancel: false

替换工作流操作列表

update_workflow_actions

"从工作流 abc123 中移除归档操作,实验完成后再加回来。"

移除后 actionCount: 4,恢复后 actionCount: 5

快速查看构建健康状况

get_build_issues

"工作流 abc123 最近一次失败的构建出了什么问题?"

issueCounts: { errors: 1, testFailures: 3, warnings: 2 }

读取紧凑的构建日志摘要

get_build_logs

"检索构建 81 的日志并总结失败原因。"

failedTests、highlights、excerpt、savedLogsDirectory

物化日志以供本地 grep

materialize_build_logs

"下载构建 81 的日志,以便我在本地进行 grep。"

savedLogsDirectory: /var/folders/...、savedLogs: [...]

汇总测试结果

get_test_results

"汇总最近一次失败构建的测试结果。"

testFailures、issueCounts、summary

直接跳转到失败的测试

get_failed_tests

"构建 81 中有哪些测试失败了?"

displayExpiryDateReturnsFormattedDateWhenExpiryDateExists()、断言消息、已保存的日志路径

检索 UI 测试产物

get_test_artifacts

"显示最近一次失败的 UI 测试运行中的截图和视频。"

screenshots、videos、resultBundles、downloadUrl

清理本地临时文件

cleanup_saved_logs

"删除超过 24 小时的已保存日志。"

removedDirectories: [...]、retainedDirectories: [...]

构建查找以工作流为作用域。检索工具接受直接的 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_ID

  • APPSTORE_CONNECT_API_ISSUER_ID

  • APPSTORE_CONNECT_API_KEY_CONTENT

兼容别名:

  • APP_STORE_KEY_ID

  • APP_STORE_ISSUER_ID

  • APP_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-mcp

Codex 设置

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,内联摘录也会被限制,以避免过大的 MCP 响应

推荐的代理工作流:

  1. 调用 get_failed_tests 或 get_build_logs。

  2. 读取 savedLogsDirectory。

  3. 在该目录中使用 rg 检查确切的失败测试或断言。

  4. 如有需要,在调查完成后调用 cleanup_saved_logs。

临时日志写入系统临时目录下的路径,格式如下:

/tmp/xcode-cloud-mcp/build-logs/<buildRunId>

在 macOS 上,这通常解析为 /var/folders/.../T/ 下的路径。

清理策略:

  • 每次对同一 buildRunId 的新调用都会先删除并重新创建该构建专属的临时目录

  • 超过 24 小时的旧构建目录会自动清理

  • 你也可以直接调用 cleanup_saved_logs 来清理单个 buildRunId,或清理所有超过所选保留期限的目录

示例提示词

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 公开的实时工作流配置,分组为:

  • general

  • environment

  • startConditions

  • actions

  • postActions

说明:

  • 当 App Store Connect 返回时,environment 包含仓库、xcodeVersion 和 macOsVersion。

  • actions 包含操作类型、scheme、平台、目标、必须通过状态以及测试计划详情(如果存在)。

  • 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 在此之后仍拒绝请求,请使用更强的 API 密钥角色,例如 Admin

本地开发

安装依赖:

npm install

运行测试:

npm test

构建包:

npm run build

Available Tools

18 tools
cleanup_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 RunA
Read-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_runsA
Read-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

    C2.9/5.0

    Scored across 18 tools

    Disambiguation3/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness3/5

    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

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers