alibabacloud-devops

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Intelligent DevOps Execution via Yunxiao Tools

基于Yunxiao工具的智能DevOps执行

This skill translates natural-language DevOps requests into Alibaba Cloud Yunxiao API calls. It supports three invocation channels: Alibaba Cloud CLI (
aliyun devops
), MCP Server, and mcporter CLI. It covers 8 Yunxiao products (~388 CLI commands, ~165 MCP tools).
本技能将自然语言描述的DevOps请求转换为阿里云Yunxiao API调用。它支持三种调用渠道:Alibaba Cloud CLI(
aliyun devops
)、MCP Server和mcporter CLI。覆盖8款Yunxiao产品(约388条CLI命令、约165个MCP工具)。

1. Overview

1. 概述

  • Core flow: Intent classification → Ambiguity resolution → Product mapping → Reference reading → Tool execution → Result verification
  • Scope: CI/CD, code management, project collaboration, sprints/work items, artifacts, testing, application delivery
For the full product and tool catalog (MCP tools and CLI commands by product), see references/tool-catalog.md.

  • 核心流程:意图分类 → 歧义消除 → 产品映射 → 参考文档查阅 → 工具执行 → 结果验证
  • 覆盖范围:CI/CD、代码管理、项目协作、迭代/工作项、制品、测试、应用交付
完整的产品与工具目录(按产品划分的MCP工具和CLI命令)请查看 references/tool-catalog.md

2. Prerequisites

2. 前置条件

[MUST] Execution order is mandatory. Steps in this section form a sequential decision tree. You MUST execute them in the numbered order below. Do NOT check Node.js, MCP, or mcporter availability until the CLI path (Steps 1–4) has been fully attempted and failed. Do NOT run any checks in parallel across subsections 2.1 and 2.2.
Token Security Rules (applies to ALL channels):
  • NEVER ask users to paste plaintext tokens in conversation or command line
  • NEVER read/print token values using
    echo
    or similar commands
  • ONLY verify token existence via check (see steps below for channel-specific env var names)
  • If token is not configured, STOP and guide user to Yunxiao Personal Access Token. Required scopes: Organization Management (R/W), Project Collaboration (R/W), Code Management (R/W), Pipeline (R/W), Packages (R/W), Application Delivery (R/W), Test Management (R/W).
[必须] 执行顺序强制要求。本节步骤构成一个顺序决策树。您必须按照以下编号顺序执行。在CLI路径(步骤1-4)完全尝试失败前,请勿检查Node.js、MCP或mcporter的可用性。请勿并行检查2.1和2.2小节的内容。
Token安全规则(适用于所有渠道)
  • 绝对不要要求用户在对话或命令行中粘贴明文Token
  • 绝对不要使用
    echo
    或类似命令读取/打印Token值
  • 仅可通过检查验证Token是否存在(以下为各渠道特定的环境变量名称)
  • 如果未配置Token,请停止操作,并引导用户前往 Yunxiao个人访问Token 获取。所需权限范围:组织管理(读/写)、项目协作(读/写)、代码管理(读/写)、Pipeline(读/写)、Packages(读/写)、应用交付(读/写)、测试管理(读/写)。

2.1 CLI Channel Setup (Primary — MUST complete first)

2.1 CLI渠道配置(主渠道——必须优先完成)

The Alibaba Cloud CLI (
aliyun devops
) is the primary invocation channel. MCP Server and mcporter are fallbacks only. Full configuration guide: references/aliyun-cli-setup.md.
Step 1: CLI availability check
bash
aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
  • Available → Go to Step 3
  • Not available → Go to Step 2 (attempt installation)
Step 2: [MUST] Attempt CLI installation
[MUST] If CLI is not found in Step 1, you MUST attempt installation before considering any fallback channel. Skipping this step is prohibited. Full installation guide: references/aliyun-cli-install.md.
  1. Detect OS and install:
    • macOS (Homebrew available):
      bash
      brew install aliyun-cli
    • macOS / Linux (no Homebrew):
      bash
      /bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
    • Windows (PowerShell): Guide user to download and run the PowerShell install script. See references/aliyun-cli-install.md.
  2. Verify installation and re-check:
    bash
    aliyun version
    aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
    • Available → Go to Step 3
    • Still not available → Go to Section 2.2 Fallback
Step 3: Authentication and site type detection
Cloud DevOps (Yunxiao) uses Personal Access Token for authentication, not AK/SK profiles.
3a. Check token:
bash
[ -n "$ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"
If token is missing, guide user to configure based on their site type:
Central site (default) — token + organization ID:
bash
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID=<your-organization-id>
Region site — token + region API base URL:
bash
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_API_BASE_URL=<your-region-api-base-url>
[MUST] Never ask the user for an API base URL on the central site — it defaults to
openapi-rdc.aliyuncs.com
(for both the CLI and the MCP Server). The base URL is a region-site-only setting.
Recommend adding these to the user's shell profile (
~/.bashrc
,
~/.zshrc
, etc.) for persistence.
3b. Detect site type:
After token is confirmed, detect the site type:
bash
[ -n "$ALIBABA_CLOUD_YUNXIAO_API_BASE_URL" ] && echo "region site" || echo "central site (default)"
[ -n "$ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID" ] && echo "org id configured" || echo "org id missing"
  • ALIBABA_CLOUD_YUNXIAO_API_BASE_URL
    set → Region site: subsequent CLI calls do NOT use
    --organization-id
    ; the API base URL is read from the environment variable automatically
  • Not set → Central site (default): subsequent CLI calls use
    --organization-id
    ; if the org id is missing, guide user to set
    ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID
    (it can be looked up via
    aliyun devops base-get-user-by-token
    )
[MUST] Remember the detected site type. All subsequent CLI calls in this session must use the corresponding parameter pattern. CLI parameters use kebab-case (e.g.,
--organization-id
), not camelCase (
--organizationId
).
Step 4: [MUST] Disable the interactive plugin-install prompt
The
devops
commands live in the
aliyun-cli-devops
plugin, which is not bundled with a fresh CLI install. The first
aliyun devops <business-command>
therefore prompts
Do you want to install it? [Y/n]:
and blocks until the command times out. Run this once per session, before any business command:
bash
aliyun configure set --auto-plugin-install true
Skipping this step wastes the whole timeout budget of your first business call.
CLI ready — If Steps 1–4 all pass, CLI channel is ready. Skip Section 2.2 entirely and proceed to Section 3.
Alibaba Cloud CLI(
aliyun devops
)是调用渠道。MCP Server和mcporter仅作为备选方案。完整配置指南:references/aliyun-cli-setup.md
步骤1:检查CLI可用性
bash
aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
  • 可用 → 前往步骤3
  • 不可用 → 前往步骤2(尝试安装)
步骤2:[必须] 尝试安装CLI
[必须] 如果步骤1中未找到CLI,您必须先尝试安装,再考虑任何备选渠道。禁止跳过此步骤。完整安装指南:references/aliyun-cli-install.md
  1. 检测操作系统并安装:
    • macOS(已安装Homebrew):
      bash
      brew install aliyun-cli
    • macOS / Linux(未安装Homebrew):
      bash
      /bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
    • Windows(PowerShell):引导用户下载并运行PowerShell安装脚本。详情请查看 references/aliyun-cli-install.md
  2. 验证安装并重新检查:
    bash
    aliyun version
    aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
    • 可用 → 前往步骤3
    • 仍不可用 → 前往2.2 备选渠道
步骤3:身份验证与站点类型检测
云效DevOps使用个人访问Token进行身份验证,而非AK/SK配置文件。
3a. 检查Token:
bash
[ -n "$ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"
如果Token缺失,根据用户的站点类型引导其配置:
中心站点(默认)——Token + 组织ID:
bash
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID=<your-organization-id>
区域站点——Token + 区域API基础URL:
bash
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_API_BASE_URL=<your-region-api-base-url>
[必须] 切勿要求中心站点用户提供API基础URL——默认值为
openapi-rdc.aliyuncs.com
(适用于CLI和MCP Server)。基础URL仅针对区域站点配置。
建议将这些配置添加到用户的Shell配置文件(
~/.bashrc
~/.zshrc
等)中以持久生效。
3b. 检测站点类型:
确认Token存在后,检测站点类型:
bash
[ -n "$ALIBABA_CLOUD_YUNXIAO_API_BASE_URL" ] && echo "region site" || echo "central site (default)"
[ -n "$ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID" ] && echo "org id configured" || echo "org id missing"
  • 已设置
    ALIBABA_CLOUD_YUNXIAO_API_BASE_URL
    区域站点:后续CLI调用无需使用
    --organization-id
    ;API基础URL会自动从环境变量读取
  • 未设置 → 中心站点(默认):后续CLI调用需使用
    --organization-id
    ;如果组织ID缺失,引导用户设置
    ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID
    (可通过
    aliyun devops base-get-user-by-token
    查询)
[必须] 记住检测到的站点类型。本次会话中所有后续CLI调用必须使用对应的参数格式。CLI参数使用短横线命名法(kebab-case)(例如
--organization-id
),而非驼峰命名法(camelCase)(
--organizationId
)。
步骤4:[必须] 禁用交互式插件安装提示
devops
命令位于
aliyun-cli-devops
插件中,该插件随全新CLI安装包捆绑。首次执行
aliyun devops <业务命令>
时会提示
Do you want to install it? [Y/n]:
,并阻塞直至命令超时。在执行任何业务命令前,每个会话需运行以下命令一次:
bash
aliyun configure set --auto-plugin-install true
跳过此步骤会浪费首次业务调用的整个超时时间。
CLI就绪——如果步骤1-4全部通过,CLI渠道已就绪。完全跳过2.2小节,直接前往第3节。

2.2 Fallback Channel Setup (ONLY when CLI is unavailable)

2.2 备选渠道配置(仅当CLI不可用时)

[GATE] You may ONLY enter this section if both conditions are true:
  1. Step 1 (CLI check) returned "cli not available"
  2. Step 2 (CLI installation attempt) was executed and failed
If you have not attempted Step 2, go back and execute it now. Do NOT proceed here.
[准入条件] 仅当同时满足以下两个条件时,您才可以进入本节:
  1. 步骤1(CLI检查)返回"cli not available"
  2. 步骤2(CLI安装尝试)已执行且失败
如果您尚未尝试步骤2,请返回并立即执行。请勿继续此部分。

2.2.1 Node.js/Docker Runtime Check

2.2.1 Node.js/Docker运行时检查

This skill invokes
alibabacloud-devops-mcp-server@0.3.38
via
npx
or
docker
. Verify:
bash
node --version   # Node.js 18+ recommended
npx --version
Recommended: Pre-install dependencies (avoid runtime downloads)
bash
npm install -g alibabacloud-devops-mcp-server@0.3.38 mcporter@0.11.1 --registry=https://registry.npmmirror.com
本技能通过
npx
docker
调用
alibabacloud-devops-mcp-server@0.3.38
。请验证:
bash
node --version   # 推荐使用Node.js 18+
npx --version
推荐:预安装依赖(避免运行时下载)
bash
npm install -g alibabacloud-devops-mcp-server@0.3.38 mcporter@0.11.1 --registry=https://registry.npmmirror.com

2.2.2 Yunxiao Personal Access Token (for MCP/mcporter)

2.2.2 Yunxiao个人访问Token(适用于MCP/mcporter)

MCP/mcporter uses
YUNXIAO_ACCESS_TOKEN
(different from CLI's
ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN
):
bash
[ -n "$YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"
If missing, guide user to obtain a token and inject as env var (see Token Security Rules at the top of Section 2).
MCP/mcporter使用
YUNXIAO_ACCESS_TOKEN
(与CLI的
ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN
不同):
bash
[ -n "$YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"
如果缺失,引导用户获取Token并注入环境变量(请遵循第2节顶部的Token安全规则)。

2.2.3 MCP Server Setup

2.2.3 MCP Server配置

See references/mcp-setup.md for three connection modes (Stdio / Docker / SSE). Recommended — Stdio:
json
{
  "mcpServers": {
    "yunxiao": {
      "command": "npx",
      "args": ["-y", "alibabacloud-devops-mcp-server@0.3.38"],
      "env": {
        "YUNXIAO_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}
Central site needs the token only —
YUNXIAO_API_BASE_URL
defaults to
https://openapi-rdc.aliyuncs.com
. Add it to
env
only for a region site.

三种连接模式(标准输入输出/SSE/Docker)请查看 references/mcp-setup.md。推荐使用——标准输入输出:
json
{
  "mcpServers": {
    "yunxiao": {
      "command": "npx",
      "args": ["-y", "alibabacloud-devops-mcp-server@0.3.38"],
      "env": {
        "YUNXIAO_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}
中心站点仅需Token——
YUNXIAO_API_BASE_URL
默认值为
https://openapi-rdc.aliyuncs.com
。仅针对区域站点将其添加到
env
中。

3. Authorization Failure Handling

3. 授权失败处理

[MUST] When any tool call returns an authentication/authorization error:
  1. Consult references/token-scopes.md for the required token scope
  2. Guide user to add the scope in Yunxiao console under "Personal Access Token"
  3. Pause execution, wait for user confirmation before proceeding
Common error codes:
ErrorAction
401 Authentication failedCheck if token is valid/expired; prompt re-generation
403 Insufficient permissionsCheck token scopes (see token-scopes.md and references/ram-policies.md)
404 Resource not foundUse
search_*
/
list_*
to verify resource IDs
400 Parameter errorCheck field schema against MCP Schema
500 Server errorRetry up to 3 times with backoff

[必须] 当任何工具调用返回身份验证/授权错误时:
  1. 查阅 references/token-scopes.md 获取所需的Token权限范围
  2. 引导用户在Yunxiao控制台的「个人访问Token」中添加对应权限
  3. 暂停执行,等待用户确认后再继续
常见错误代码:
错误操作
401 身份验证失败检查Token是否有效/过期;提示重新生成
403 权限不足检查Token权限范围(请查看token-scopes.md和 references/ram-policies.md
404 资源未找到使用
search_*
/
list_*
验证资源ID
400 参数错误根据MCP Schema检查字段格式
500 服务器错误最多重试3次,每次重试增加等待时间

4. Parameter Confirmation

4. 参数确认

IMPORTANT — Before executing any tool call, all user-defined parameters (organizationId, projectId, repositoryId, pipelineId, branch names, work item subject, sprint dates, app/env names, etc.) must be confirmed with the user. Never call based on defaults or guesses.
Common required parameters by product:
ProductUniversal requiredTypical scenario parameters
All
organizationId
-
Codeup
repositoryId
sourceBranch
/
targetBranch
/
filePath
Flow
pipelineId
branch
/
runId
/
jobId
Projex
projectId
workitemTypeId
/
sprintId
/
subject
Testhub
projectId
testcaseId
/
testPlanId
AppStack
appName
envName
/
changeOrderId

重要——在执行任何工具调用前,所有用户定义的参数(organizationId、projectId、repositoryId、pipelineId、分支名称、工作项主题、迭代日期、应用/环境名称等)必须与用户确认。切勿基于默认值或猜测执行调用。
各产品常见必填参数:
产品通用必填参数典型场景参数
所有产品
organizationId
-
Codeup
repositoryId
sourceBranch
/
targetBranch
/
filePath
Flow
pipelineId
branch
/
runId
/
jobId
Projex
projectId
workitemTypeId
/
sprintId
/
subject
Testhub
projectId
testcaseId
/
testPlanId
AppStack
appName
envName
/
changeOrderId

5. Core Execution Flow

5. 核心执行流程

User request → [Step 1] Intent classification → [Step 2] Ambiguity handling → [Step 3] Product mapping
             → [Step 4] Read product references → [Step 5] Execute tool calls → Return results
用户请求 → [步骤1] 意图分类 → [步骤2] 歧义处理 → [步骤3] 产品映射
             → [步骤4] 查阅产品参考文档 → [步骤5] 执行工具调用 → 返回结果

Step 1: Intent Classification

步骤1:意图分类

Core principle: Identify the core verb, not the noun.
ActionTypical verbsTool prefix
Createcreate, add, initialize, set up
create_*
Queryview, get, list, search, find
get_*
/
list_*
/
search_*
Updateupdate, modify, change, edit
update_*
Deletedelete, remove, clean up
delete_*
(requires confirmation)
Triggerrun, execute, trigger, start, deploy
create_pipeline_run
/
execute_*
Configureconfigure, set up, bind, associate
update_*
/
create_*
Decision tree and examples: references/intent-classification.md.
核心原则:识别核心动词,而非名词。
操作典型动词工具前缀
创建create、add、initialize、set up
create_*
查询view、get、list、search、find
get_*
/
list_*
/
search_*
更新update、modify、change、edit
update_*
删除delete、remove、clean up
delete_*
需要确认
触发run、execute、trigger、start、deploy
create_pipeline_run
/
execute_*
配置configure、set up、bind、associate
update_*
/
create_*
决策树与示例:references/intent-classification.md

Step 2: Ambiguity Handling

步骤2:歧义处理

Core principle: If the instruction is vague or involves multi-product keywords, never guess — ask.
Ambiguity typeDetection conditionStrategy
ProductMulti-product keywords presentAsk which product
ActionAction unclearAsk for operation type
ObjectMissing identifiersAsk for resource name or ID
ParameterMissing key parametersAsk for missing values
ScopeOrg/project not specifiedAsk for org/project
核心原则:如果指令模糊或涉及多产品关键词,切勿猜测——询问用户。
歧义类型检测条件处理策略
产品歧义存在多产品关键词询问用户目标产品
操作歧义操作类型不明确询问用户操作类型
对象歧义缺少资源标识符询问用户资源名称或ID
参数歧义缺少关键参数询问用户缺失的参数值
范围歧义未指定组织/项目询问用户组织/项目信息

Step 3: Product Mapping

步骤3:产品映射

Full mapping: references/product-mapping.md.
KeywordsProductMCP toolsetCLI prefix
Pipeline, build, deploy, CI/CDFlowpipeline-managementflow-
Code, repo, branch, commit, MR, reviewCodeupcode-managementcodeup-
Artifact, package, Maven, NPM, Docker imagePackagespackages-managementpackages-
Requirement, work item, sprint, bug, taskProjexproject-managementprojex-
Test case, test plan, test reportTesthubtest-managementtest-hub-
Application, orchestration, change order, releaseAppStackapplication-deliveryapp-stack-
Organization, member, department, role-organization-managementbase-
Current user info-basebase-
Ambiguity decision points:
  • "CI/CD full flow" → Build-only → Flow; app lifecycle → AppStack; both → ask
  • "Repository" → Code repo → Codeup; artifact repo → Packages; unclear → ask
完整映射关系:references/product-mapping.md
关键词产品MCP工具集CLI前缀
Pipeline、build、deploy、CI/CDFlowpipeline-managementflow-
Code、repo、branch、commit、MR、reviewCodeupcode-managementcodeup-
Artifact、package、Maven、NPM、Docker imagePackagespackages-managementpackages-
Requirement、work item、sprint、bug、taskProjexproject-managementprojex-
Test case、test plan、test reportTesthubtest-managementtest-hub-
Application、orchestration、change order、releaseAppStackapplication-deliveryapp-stack-
Organization、member、department、role-organization-managementbase-
当前用户信息-basebase-
歧义决策点:
  • "CI/CD全流程" → 仅构建 → Flow;应用生命周期 → AppStack;两者皆有 → 询问用户
  • "Repository" → 代码仓库 → Codeup;制品仓库 → Packages;不明确 → 询问用户

Step 4: Read Product References

步骤4:查阅产品参考文档

After determining the target product, must consult the Yunxiao documentation index at references/product-reference.md.
确定目标产品后,必须查阅位于 references/product-reference.md 的Yunxiao文档索引。

Step 5: Execute Tool Calls

步骤5:执行工具调用

Three invocation channels (functionally equivalent):
MethodScenarioPrerequisites
Alibaba Cloud CLI (
aliyun devops
)
Shell environment available
aliyun
installed with token configured
Platform-native MCPIDE/platform with MCP Server
use_mcp_tool
available
Terminal CLI (mcporter)Pure terminal, no MCP ServerNode.js 18+ installed
Channel selection: Choose based on availability — CLI configured → CLI; MCP integrated → MCP; Shell + Node.js only → mcporter.
Region Site Routing (mandatory): When the user specifies a Yunxiao instance address or token differing from current MCP config:
  • MUST prompt user to update MCP Server config (
    YUNXIAO_API_BASE_URL
    /
    YUNXIAO_ACCESS_TOKEN
    )
  • MUST NOT bypass MCP Server via mcporter — mcporter is only for when MCP Server is absent
  • URL with Region keywords (e.g.,
    cn-shanghai
    ) → Region edition;
    openapi-rdc.aliyuncs.com
    or unspecified → Central (default, no base URL config needed)
Method A: Alibaba Cloud CLI
bash
aliyun devops <command> --<param1> <value1> \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"
All
aliyun devops
commands must include
--user-agent
with the session-scoped UA value (see Section 7: Observability). When using environment variables for authentication, no additional auth parameters are needed. When using command-line parameters, append
--yunxiao-access-token
and
--organization-id
(central) or
--api-base-url
(region) to each command.
For command discovery by product prefix, use
scripts/discover-commands.sh
or see references/tool-catalog.md.
Method B: Platform-native MCP
use_mcp_tool(
  server_name: "yunxiao",
  tool_name: "<tool>",
  arguments: { "<key>": "<value>" }
)
Method C: mcporter CLI
bash
npx -y mcporter@0.11.1 call --no-coerce --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" <tool_name> [key:"value" ...]
MUST always use
--no-coerce
to prevent auto type conversion of string enums.
Parameter rules: Use
key:"value"
format, space-separated. Do not pass JSON strings. Omit parameters for no-argument tools. Use
scripts/mcporter-call.sh
for convenience.
Get available tools:
bash
npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema
[MUST] Tool selection must be based on dynamic discovery: Select from registered tool list, never fabricate tool names. Use
mcporter list
or references/tool-catalog.md.
[MUST] Never fabricate results: All tool calls must be actually executed with real return values.
Pre-execution checklist (mandatory):
  1. Obtain
    organizationId
    via
    aliyun devops base-get-user-by-token
    (MCP:
    get_current_organization_info
    )
  2. [Mandatory] Verify target resource exists via
    list_*
    /
    search_*
    /
    get_*
    — even if ID is provided
  3. All required parameters confirmed with user (Section 4)
  4. Delete operations require confirmation
  5. [Mandatory] Dynamic schema validation before first call to any unfamiliar tool:
    • Method B: Check platform tool registry
    • Method C:
      npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema 2>&1 | grep -A 30 'function <tool_name>'
    • If schema returns a different tool name, use the schema's version
    • For Testhub: call
      test-hub-get-testcase-field-config
      (MCP:
      get_testcase_field_config
      ) first — it reports which fields are required (
      assignedTo
      is) and yields the per-library option IDs that
      customFieldValues
      must carry (e.g.
      {"tc.priority": "<P1 option id>"}
      ; sending the label
      "P1"
      fails with
      400 字段【优先级】所填值无效
      ).
      testSteps
      must carry a
      content[]
      array — a payload using only
      stepContent
      /
      expectedResult
      (which is the read-back shape) fails with
      500 unknown exception
      . See references/common-scenarios.md Scenario 6.
    • For Projex: call
      projex-list-workitem-types
      (MCP:
      list_work_item_types
      ) first — never use hardcoded type IDs
Full tool catalog: references/tool-catalog.md. Scenario examples: references/common-scenarios.md.

三种调用渠道(功能等效):
方法适用场景前置条件
Alibaba Cloud CLI(
aliyun devops
具备Shell环境已安装
aliyun
并配置Token
平台原生MCP集成了MCP Server的IDE/平台支持
use_mcp_tool
终端CLI(mcporter)纯终端环境,无MCP Server已安装Node.js 18+
渠道选择:根据可用性选择——已配置CLI → 使用CLI;已集成MCP → 使用MCP;仅具备Shell + Node.js → 使用mcporter。
区域站点路由(强制要求):当用户指定的Yunxiao实例地址或Token与当前MCP配置不同时:
  • 必须提示用户更新MCP Server配置(
    YUNXIAO_API_BASE_URL
    /
    YUNXIAO_ACCESS_TOKEN
  • 不得通过mcporter绕过MCP Server——仅当MCP Server不可用时才使用mcporter
  • 包含区域关键词的URL(例如
    cn-shanghai
    )→ 区域版;
    openapi-rdc.aliyuncs.com
    或未指定 → 中心版(默认,无需配置基础URL)
方法A:Alibaba Cloud CLI
bash
aliyun devops <command> --<param1> <value1> \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"
所有
aliyun devops
命令必须包含
--user-agent
标志,用于归属与追踪。UA值遵循固定模板,包含会话唯一标识符。当使用环境变量进行身份验证时,无需额外的身份验证参数。当使用命令行参数时,需在每个命令后附加
--yunxiao-access-token
--organization-id
(中心站点)或
--api-base-url
(区域站点)。
如需按产品前缀查找命令,可使用
scripts/discover-commands.sh
或查看 references/tool-catalog.md
方法B:平台原生MCP
use_mcp_tool(
  server_name: "yunxiao",
  tool_name: "<tool>",
  arguments: { "<key>": "<value>" }
)
方法C:mcporter CLI
bash
npx -y mcporter@0.11.1 call --no-coerce --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" <tool_name> [key:"value" ...]
必须始终使用
--no-coerce
,以防止字符串枚举被自动类型转换。
参数规则:使用
key:"value"
格式,空格分隔。请勿传递JSON字符串。无参数工具可省略参数。可使用
scripts/mcporter-call.sh
简化操作。
获取可用工具:
bash
npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema
[必须] 工具选择必须基于动态发现:从已注册工具列表中选择,切勿编造工具名称。可使用
mcporter list
references/tool-catalog.md
[必须] 切勿编造结果:所有工具调用必须实际执行并返回真实结果。
执行前检查清单(强制要求):
  1. 通过
    aliyun devops base-get-user-by-token
    (MCP:
    get_current_organization_info
    )获取
    organizationId
  2. [强制要求] 通过
    list_*
    /
    search_*
    /
    get_*
    验证目标资源是否存在——即使已提供ID
  3. 所有必填参数已与用户确认(第4节)
  4. 删除操作需要用户确认
  5. [强制要求] 在首次调用不熟悉的工具前进行动态Schema验证:
    • 方法B:检查平台工具注册表
    • 方法C:
      npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema 2>&1 | grep -A 30 'function <tool_name>'
    • 如果Schema返回不同的工具名称,使用Schema中的版本
    • 对于Testhub:先调用
      test-hub-get-testcase-field-config
      (MCP:
      get_testcase_field_config
      )——该命令会返回必填字段(如
      assignedTo
      )以及
      customFieldValues
      必须携带的每个库的选项ID(例如
      {"tc.priority": "<P1 option id>"}
      ;发送标签
      "P1"
      会返回错误
      400 字段【优先级】所填值无效
      )。
      testSteps
      必须携带
      content[]
      数组——仅使用
      stepContent
      /
      expectedResult
      的负载(这是返回结果的格式)会返回错误
      500 unknown exception
      。详情请查看 references/common-scenarios.md 场景6。
    • 对于Projex:先调用
      projex-list-workitem-types
      (MCP:
      list_work_item_types
      )——切勿使用硬编码的类型ID
完整工具目录:references/tool-catalog.md。场景示例:references/common-scenarios.md

6. Success Verification

6. 成功验证

[RECOMMENDED] After
create_*
/
update_*
, call the corresponding
get_*
to verify when budget permits. If API returned success with a resource ID, creation can be considered successful even without read-back.
Known API limitations: Some fields may differ between write and read-back — see references/verification-method.md.
OperationVerification command (CLI / MCP)Check
Create pipeline
flow-get-pipeline
(MCP:
get_pipeline
)
pipelineId + name match
Run pipeline
flow-get-latest-pipeline-run
(MCP:
get_latest_pipeline_run
)
status !=
FAIL
Create branch
codeup-get-branch
(MCP:
get_branch
)
Branch appears
Create MR
codeup-get-change-request
(MCP:
get_change_request
)
state =
OPENED
Create work item
projex-get-workitem
(MCP:
get_work_item
)
subject + workItemTypeId correct
Create sprint
projex-get-sprint
(MCP:
get_sprint
)
Date range matches
More: references/verification-method.md.

[推荐] 在执行
create_*
/
update_*
操作后,若预算允许,调用对应的
get_*
命令进行验证。如果API返回成功并返回资源ID,即使未执行回读操作,也可认为创建成功。
已知API限制:部分字段在写入和回读时可能存在差异——请查看 references/verification-method.md
操作验证命令(CLI / MCP)检查项
创建流水线
flow-get-pipeline
(MCP:
get_pipeline
pipelineId与名称匹配
运行流水线
flow-get-latest-pipeline-run
(MCP:
get_latest_pipeline_run
状态 !=
FAIL
创建分支
codeup-get-branch
(MCP:
get_branch
分支已存在
创建MR
codeup-get-change-request
(MCP:
get_change_request
状态 =
OPENED
创建工作项
projex-get-workitem
(MCP:
get_work_item
主题与workItemTypeId正确
创建迭代
projex-get-sprint
(MCP:
get_sprint
日期范围匹配
更多内容:references/verification-method.md

7. Observability

7. 可观测性

User-Agent Declaration (Mandatory)

User-Agent声明(强制要求)

[MUST] Every
aliyun devops
business command must carry the
--user-agent
flag for attribution and tracing. The UA value follows a fixed template that includes a per-session identifier.
UA Template:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-devops/{session-id}
Session-ID Generation Rule:
ItemRule
Format32-character lowercase hexadecimal string, e.g.,
f47ac10b58cc4372a5670e02b2c3d479
LifecycleGenerate once at the start of each skill invocation session; reuse the same value across all channels (CLI, MCP, mcporter) within that session
ConsistencyThe same
{session-id}
must be used for CLI
--user-agent
, MCP request metadata, and mcporter calls within one session
Generation method
python3 -c "import uuid; print(uuid.uuid4().hex)"
or
uuidgen | tr -d '-' | tr '[:upper:]' '[:lower:]'
Usage — append to every
aliyun devops
command:
bash
SESSION_ID=$(python3 -c "import uuid; print(uuid.uuid4().hex)")

aliyun devops <command> --<param1> <value1> \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"
Important: The
--user-agent
flag is applied directly on each business command. Do NOT configure UA through any global mode-setting command — always pass it inline per invocation.

[必须] 每个
aliyun devops
业务命令必须携带
--user-agent
标志,用于归属与追踪。UA值遵循固定模板,包含会话唯一标识符。
UA模板:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-devops/{session-id}
会话ID生成规则:
规则
格式32位小写十六进制字符串,例如
f47ac10b58cc4372a5670e02b2c3d479
生命周期在每次技能调用会话开始时生成一次;在该会话的所有渠道(CLI、MCP、mcporter)中重复使用同一值
一致性同一会话中的CLI
--user-agent
、MCP请求元数据和mcporter调用必须使用相同的
{session-id}
生成方法
python3 -c "import uuid; print(uuid.uuid4().hex)"
uuidgen | tr -d '-' | tr '[:upper:]' '[:lower:]'
使用方式——附加到每个
aliyun devops
命令
:
bash
SESSION_ID=$(python3 -c "import uuid; print(uuid.uuid4().hex)")

aliyun devops <command> --<param1> <value1> \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"
重要
--user-agent
标志需直接附加到每个业务命令。请勿通过任何全局模式设置命令配置UA——始终在每次调用时内联传递。

8. Best Practices

8. 最佳实践

  1. Read before write:
    get_*
    before
    update_*
    /
    delete_*
    to confirm current state
  2. Pagination: List APIs paginate by default; pass
    page
    /
    perPage
    for large lists
  3. YAML first: Pipeline creation goes through
    flow-create-pipeline --name --content
    (YAML is mandatory). Before composing the YAML, collect the three organization-specific values that are always rejected if guessed — the repository's
    httpUrlToRepo
    (never
    webUrl
    ), the Codeup service connection
    uuid
    (query with the lowercase filter
    --service-connection-type codeup
    ;
    Codeup
    reproducibly returns an empty list, which is not proof the connection is missing), and a
    runsOn.group
    harvested from an existing pipeline (no API lists build clusters, and
    public/<region>
    often does not exist). The Codeup credential is a nested
    certificate
    object, not a bare
    serviceConnection
    key, and a build-only pipeline must omit
    ArtifactUpload
    . MCP's
    create_pipeline_from_description
    builds its YAML internally and cannot be corrected — on any
    yaml校验失败
    /
    服务连接[...]不存在
    error, stop retrying it and switch to the CLI path. Verified template and preflight steps: references/common-scenarios.md Scenario 1.
  4. Smart search:
    flow-list-pipelines
    with timestamp parameters —
    --execute-start-time
    /
    --execute-end-time
    /
    --create-start-time
    /
    --create-end-time
    take millisecond epoch values (13 digits, e.g.
    $(($(date +%s) * 1000))
    ). Passing seconds (10 digits) is not rejected by the API; it silently filters against 1970 and returns misleading results, so always multiply by 1000 and sanity-check the digit count. (MCP provides
    smart_list_pipelines
    supporting natural-language time ranges.)
  5. Read-only first: When uncertain, use
    list_*
    /
    search_*
    /
    get_*
  6. Fail fast: Two consecutive same-parameter failures → change approach. Report: methods tried, errors, root cause, next steps
  7. Budget discipline: Plan critical path first; debugging ≤3 steps; near limit (≤2 remaining) → stop and report
  8. Clean up: Delete experimental resources after use

  1. 先读后写:在执行
    update_*
    /
    delete_*
    前调用
    get_*
    确认当前状态
  2. 分页处理:列表API默认分页;对于大型列表,传递
    page
    /
    perPage
    参数
  3. 优先使用YAML:创建流水线需通过
    flow-create-pipeline --name --content
    (YAML为必填项)。在编写YAML前,需收集三个组织特定值——猜测这些值会被拒绝:仓库的
    httpUrlToRepo
    (切勿使用
    webUrl
    )、Codeup服务连接
    uuid
    (使用小写过滤器
    --service-connection-type codeup
    查询;
    Codeup
    会返回空列表,但这并不证明连接不存在),以及从现有流水线获取的
    runsOn.group
    没有API列出构建集群,且
    public/<region>
    通常不存在)。Codeup凭证是嵌套的
    certificate
    对象,而非单独的
    serviceConnection
    键,仅构建的流水线必须省略
    ArtifactUpload
    。MCP的
    create_pipeline_from_description
    会在内部构建YAML且无法修改——如果出现
    yaml校验失败
    /
    服务连接[...]不存在
    错误,请停止重试并切换到CLI路径。已验证的模板和预检步骤:references/common-scenarios.md 场景1。
  4. 智能搜索
    flow-list-pipelines
    支持时间戳参数——
    --execute-start-time
    /
    --execute-end-time
    /
    --create-start-time
    /
    --create-end-time
    接受毫秒级时间戳(13位数字,例如
    $(($(date +%s) * 1000))
    )。传递秒级时间戳(10位数字)不会被API拒绝,但会自动过滤1970年的数据并返回误导性结果,因此请始终乘以1000并检查位数是否正确。(MCP提供的
    smart_list_pipelines
    支持自然语言时间范围。)
  5. 优先只读操作:不确定时,使用
    list_*
    /
    search_*
    /
    get_*
  6. 快速失败:连续两次相同参数调用失败 → 更换方法。报告:已尝试的方法、错误信息、根本原因、下一步计划
  7. 预算管控:优先规划关键路径;调试步骤≤3步;接近限制(剩余≤2步)→ 停止操作并报告
  8. 清理资源:使用后删除实验性资源

9. Scenario Quick Reference

9. 场景速查

Full examples: references/common-scenarios.md.
ScenarioProductKey CLI commandsKey MCP tools
Create Java build pipelineFlow
codeup-get-repository
(clone URL) →
flow-list-service-connections --service-connection-type codeup
(uuid; lowercase value,
Codeup
returns
[]
) →
flow-get-pipeline
(harvest
runsOn
) →
flow-create-pipeline
flow-list-pipelines
get_repository
list_service_connections
get_pipeline
create_pipeline_from_description
(falls back to CLI on YAML validation failure)
Create MR with review commentCodeup
codeup-get-repository
codeup-create-change-request
codeup-list-change-request-patch-sets
codeup-create-change-request-comment
get_repository
create_change_request
list_change_request_patch_sets
create_change_request_comment
Create sprint and add requirementProjex
projex-search-projects
projex-create-sprint
projex-create-workitem
search_projects
create_sprint
create_work_item
Run pipeline and view logsFlow
flow-get-pipeline
flow-create-pipeline-run
(branch goes in
--params '{"branchModeBranchs":"<branch>"}'
; there is no
--branch
flag) →
flow-get-pipeline-run --pipeline-run-id
flow-get-pipeline-job-run-log --job-id <stages[].stageInfo.jobs[].id>
get_pipeline
create_pipeline_run
get_pipeline_run
get_pipeline_job_run_log
Batch query artifactsPackages
packages-list-repositories
packages-list-artifacts
list_package_repositories
list_artifacts
Create test casesTesthub
test-hub-get-testcase-field-config
(required fields + option IDs) →
test-hub-list-directories
test-hub-create-testcase
test-hub-search-testcases
get_testcase_field_config
list_testcase_directories
create_testcase
search_testcases
Application release workflowAppStack
app-stack-list-all-release-workflows
app-stack-execute-change-request-release-stage
list_app_release_workflows
execute_app_release_stage

完整示例:references/common-scenarios.md
场景产品核心CLI命令核心MCP工具
创建Java构建流水线Flow
codeup-get-repository
(克隆URL)→
flow-list-service-connections --service-connection-type codeup
(uuid;小写值,
Codeup
返回
[]
)→
flow-get-pipeline
(获取
runsOn
)→
flow-create-pipeline
flow-list-pipelines
get_repository
list_service_connections
get_pipeline
create_pipeline_from_description
(YAML验证失败时回退到CLI)
创建带评审评论的MRCodeup
codeup-get-repository
codeup-create-change-request
codeup-list-change-request-patch-sets
codeup-create-change-request-comment
get_repository
create_change_request
list_change_request_patch_sets
create_change_request_comment
创建迭代并添加需求Projex
projex-search-projects
projex-create-sprint
projex-create-workitem
search_projects
create_sprint
create_work_item
运行流水线并查看日志Flow
flow-get-pipeline
flow-create-pipeline-run
(分支需放在
--params '{"branchModeBranchs":"<branch>"}'
;无
--branch
标志)→
flow-get-pipeline-run --pipeline-run-id
flow-get-pipeline-job-run-log --job-id <stages[].stageInfo.jobs[].id>
get_pipeline
create_pipeline_run
get_pipeline_run
get_pipeline_job_run_log
批量查询制品Packages
packages-list-repositories
packages-list-artifacts
list_package_repositories
list_artifacts
创建测试用例Testhub
test-hub-get-testcase-field-config
(必填字段 + 选项ID)→
test-hub-list-directories
test-hub-create-testcase
test-hub-search-testcases
get_testcase_field_config
list_testcase_directories
create_testcase
search_testcases
应用发布工作流AppStack
app-stack-list-all-release-workflows
app-stack-execute-change-request-release-stage
list_app_release_workflows
execute_app_release_stage

10. Reference Index

10. 参考索引

Reference fileContent
references/aliyun-cli-install.mdAlibaba Cloud CLI installation guide (macOS/Linux/Windows)
references/mcp-setup.mdMCP Server connection modes and environment variables
references/intent-classification.mdIntent classification decision tree
references/product-mapping.mdKeyword → product mapping table
references/product-reference.mdYunxiao documentation index and key concepts
references/tool-catalog.md~165 MCP tools grouped catalog
references/token-scopes.mdToken authorization scopes and troubleshooting
references/common-scenarios.mdEnd-to-end workflow examples
references/verification-method.mdSuccess verification and read-back methods
references/acceptance-criteria.mdTool call correctness acceptance criteria
references/ram-policies.mdYunxiao permission model vs. standard Alibaba Cloud RAM
参考文件内容
references/aliyun-cli-install.mdAlibaba Cloud CLI安装指南(macOS/Linux/Windows)
references/mcp-setup.mdMCP Server连接模式与环境变量
references/intent-classification.md意图分类决策树
references/product-mapping.md关键词→产品映射表
references/product-reference.mdYunxiao文档索引与核心概念
references/tool-catalog.md约165个MCP工具分组目录
references/token-scopes.mdToken授权范围与故障排查
references/common-scenarios.md端到端工作流示例
references/verification-method.md成功验证与回读方法
references/acceptance-criteria.md工具调用正确性验收标准
references/ram-policies.mdYunxiao权限模型与标准阿里云RAM对比