CircleCI自动化_circleci-automation

CircleCI自动化_circleci-automation
以下为本文档的中文说明这是一个通过 Rube MCPModel Context Protocol中间件来自动化 CircleCI CI/CD 操作的技能。它基于 Composio 平台的 CircleCI 工具集通过 Rube MCP 桥接 AI 代理与 CircleCI API 的交互使得用户可以通过自然语言指令完成复杂的 CI/CD 管理任务。使用场景包括需要触发新的流水线运行Trigger Pipeline、监控管道和工作流状态Monitor Pipelines and Workflows、查看具体的 Job 执行详情Inspect Job Details、获取构建产物Retrieve Build Artifacts以及检查测试结果Review Test Metadata。核心操作流程遵循严格的先决条件检查首先确认 Rube MCP 可用然后通过 RUBE_MANAGE_CONNECTIONS 建立 CircleCI 连接确认连接状态为 ACTIVE 后才开始执行工作流。该技能提供了完整的参数说明和陷阱提示例如 project_slug 的格式必须是 {vcs}/{org}/{repo}如 gh/myorg/myrepobranch 和 tag 参数互斥不能同时使用以及 Pipeline ID 和工作流 ID 是 UUID 格式而 Job Number 是整数格式。它还定义了 Pipeline → Workflow → Job 的三层调用层级关系以及分页处理的规范。此外该技能覆盖了常见的错误处理和速率限制应对策略如指数退避Exponential Backoff和合理的轮询间隔5-10 秒适合在生产环境中使用。CircleCI Automation via Rube MCPAutomate CircleCI CI/CD operations through Composio’s CircleCI toolkit via Rube MCP.PrerequisitesRube MCP must be connected (RUBE_SEARCH_TOOLS available)Active CircleCI connection viaRUBE_MANAGE_CONNECTIONSwith toolkitcircleciAlways callRUBE_SEARCH_TOOLSfirst to get current tool schemasSetupGet Rube MCP: Addhttps://rube.app/mcpas an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.Verify Rube MCP is available by confirmingRUBE_SEARCH_TOOLSrespondsCallRUBE_MANAGE_CONNECTIONSwith toolkitcircleciIf connection is not ACTIVE, follow the returned auth link to complete CircleCI authenticationConfirm connection status shows ACTIVE before running any workflowsCore Workflows1. Trigger a PipelineWhen to use: User wants to start a new CI/CD pipeline runTool sequence:CIRCLECI_TRIGGER_PIPELINE- Trigger a new pipeline on a project [Required]CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- Monitor resulting workflows [Optional]Key parameters:project_slug: Project identifier in formatgh/org/repoorbb/org/repobranch: Git branch to run the pipeline ontag: Git tag to run the pipeline on (mutually exclusive with branch)parameters: Pipeline parameter key-value pairsPitfalls:project_slugformat is{vcs}/{org}/{repo}(e.g.,gh/myorg/myrepo)branchandtagare mutually exclusive; providing both causes an errorPipeline parameters must match those defined in.circleci/config.ymlTriggering returns a pipeline ID; workflows start asynchronously2. Monitor Pipelines and WorkflowsWhen to use: User wants to check the status of pipelines or workflowsTool sequence:CIRCLECI_LIST_PIPELINES_FOR_PROJECT- List recent pipelines for a project [Required]CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- List workflows within a pipeline [Required]CIRCLECI_GET_PIPELINE_CONFIG- View the pipeline configuration used [Optional]Key parameters:project_slug: Project identifier in{vcs}/{org}/{repo}formatpipeline_id: UUID of a specific pipelinebranch: Filter pipelines by branch namepage_token: Pagination cursor for next page of resultsPitfalls:Pipeline IDs are UUIDs, not numeric IDsWorkflows inherit the pipeline ID; a single pipeline can have multiple workflowsWorkflow states include: success, running, not_run, failed, error, failing, on_hold, canceled, unauthorizedpage_tokenis returned in responses for pagination; continue until absent3. Inspect Job DetailsWhen to use: User wants to drill into a specific job’s execution detailsTool sequence:CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- Find workflow containing the job [Prerequisite]CIRCLECI_GET_JOB_DETAILS- Get detailed job information [Required]Key parameters:project_slug: Project identifierjob_number: Numeric job number (not UUID)Pitfalls:Job numbers are integers, not UUIDs (unlike pipeline and workflow IDs)Job details include executor type, parallelism, start/stop times, and statusJob statuses: success, running, not_run, failed, retried, timedout, infrastructure_fail, canceled4. Retrieve Build ArtifactsWhen to use: User wants to download or list artifacts produced by a jobTool sequence:CIRCLECI_GET_JOB_DETAILS- Confirm job completed successfully [Prerequisite]CIRCLECI_GET_JOB_ARTIFACTS- List all artifacts from the job [Required]Key parameters:project_slug: Project identifierjob_number: Numeric job numberPitfalls:Artifacts are only available after job completionEach artifact has apathandurlfor downloadArtifact URLs may require authentication headers to downloadLarge artifacts may have download size limits5. Review Test ResultsWhen to use: User wants to check test outcomes for a specific jobTool sequence:CIRCLECI_GET_JOB_DETAILS- Verify job ran tests[Prerequisite]CIRCLECI_GET_TEST_METADATA- Retrieve test results and metadata [Required]Key parameters:project_slug: Project identifierjob_number: Numeric job numberPitfalls:Test metadata requires the job to have uploaded test results (JUnit XML format)If no test results were uploaded, the response will be emptyTest metadata includes classname, name, result, message, and run_time fieldsFailed tests include failure messages in themessagefieldCommon PatternsProject Slug FormatFormat: {vcs_type}/{org_name}/{repo_name} - GitHub: gh/myorg/myrepo - Bitbucket: bb/myorg/myrepoPipeline - Workflow - Job Hierarchy1. Call CIRCLECI_LIST_PIPELINES_FOR_PROJECT to get pipeline IDs 2. Call CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID with pipeline_id 3. Extract job numbers from workflow details 4. Call CIRCLECI_GET_JOB_DETAILS with job_numberPaginationCheck response fornext_page_tokenfieldPass token aspage_tokenin next requestContinue untilnext_page_tokenis absent or nullKnown PitfallsID Formats:Pipeline IDs: UUIDs (e.g.,5034460f-c7c4-4c43-9457-de07e2029e7b)Workflow IDs: UUIDsJob numbers: Integers (e.g.,123)Do NOT mix up UUIDs and integers between different endpointsProject Slugs:Must include VCS prefix:gh/for GitHub,bb/for BitbucketOrganization and repo names are case-sensitiveIncorrect slug format causes 404 errorsRate Limits:CircleCI API has per-endpoint rate limitsImplement exponential backoff on 429 responsesAvoid rapid polling; use reasonable intervals (5-10 seconds)Quick ReferenceTaskTool SlugKey ParamsTrigger pipelineCIRCLECI_TRIGGER_PIPELINEproject_slug, branch, parametersList pipelinesCIRCLECI_LIST_PIPELINES_FOR_PROJECTproject_slug, branchList workflowsCIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_IDpipeline_idGet pipeline configCIRCLECI_GET_PIPELINE_CONFIGpipeline_idGet job detailsCIRCLECI_GET_JOB_DETAILSproject_slug, job_numberGet job artifactsCIRCLECI_GET_JOB_ARTIFACTSproject_slug, job_numberGet test metadataCIRCLECI_GET_TEST_METADATAproject_slug, job_numberWhen to UseThis skill is applicable to execute the workflow or actions described in the overview.LimitationsUse this skill only when the task clearly matches the scope described above.Do not treat the output as a substitute for environment-specific validation, testing, or expert review.Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.