跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 CircleCI,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 检查 CircleCI:流水线、工作流和作业,失败的测试和构建产物,Insights 指标和不稳定测试,上下文和变量名称,并在你确认后启动流水线、重新运行或取消工作流。
试试这样问
CircleCI 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → CircleCI、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
CircleCI
让你的 AI 检查 CircleCI:流水线、工作流和作业,失败的测试和构建产物,Insights 指标和不稳定测试,上下文和变量名称,并在你确认后启动流水线、重新运行或取消工作流。
设置
- 在
https://app.circleci.com登录 CircleCI,打开 User Settings → Personal API Tokens(https://app.circleci.com/settings/user/tokens)。 - 点击 Create New Token,为它命名并复制。较新的令牌以
CCIPAT_开头。项目设置中的项目 API 令牌不能用于 API v2。 - 把令牌原样粘贴到
CIRCLECI_TOKEN,不要加前缀,然后安装连接器。令牌只会通过Circle-Token请求头发送到 circleci.com。 - 用
circleci_get_current_user检查设置,再用circleci_list_collaborations查看你所属的组织。
谁能看到什么:令牌在你所属的每个组织中都拥有与你的 CircleCI 用户相同的权限。请只把 MCP 服务器分享给可以查看这些构建的人。
项目 slug:大多数工具需要项目 slug,可在 Project Settings → Overview 中找到。通过 GitHub OAuth 和 Bitbucket Cloud 连接的项目使用 gh/<org>/<repo> 或 bb/<workspace>/<repo>(例如 gh/acme/web-app);通过 GitHub App 和 GitLab 连接的项目使用 circleci/<organization id>/<project id>。请连同斜杠原样传入 slug。
会启动构建并停止正在运行的工作,所以 AI 会先问你:circleci_trigger_pipeline 在某个分支或标签上启动新的流水线。它需要来自 circleci_list_pipeline_definitions 的定义 ID,而后者又需要来自 circleci_get_project 的项目 ID;GitLab 项目不支持此功能。circleci_rerun_workflow 把工作流作为新的工作流重新运行:全部作业、仅从失败的作业开始,或你选定的作业。circleci_cancel_workflow 会停止正在运行的工作流,尚未开始的作业将不再运行。启动和重新运行会消耗额度,并执行配置中的所有内容,包括部署作业;取消可能会让部署停在一半。每次调用前,AI 都会告诉你项目、分支、工作流或作业,并等你同意。安装时没有任何工具被关闭,这里也没有任何操作会删除项目、上下文或变量。
查明构建失败的原因:circleci_list_pipelines(最新的在前,可只看一个分支),按 ID 查询的 circleci_get_pipeline,或按应用中显示的 #编号查询的 circleci_get_pipeline_by_number;然后用 circleci_list_pipeline_workflows 和 circleci_list_workflow_jobs 找到失败的作业及其作业编号。circleci_get_job 提供状态、耗时、执行器、使用的上下文和网页链接。circleci_list_job_tests 统计通过、跳过和失败的测试数量,并列出每个失败测试及其消息(仅限保存了测试结果的作业)。circleci_list_job_artifacts 列出已保存的构建产物及下载链接,下载时需要同一个令牌。完整的步骤日志只能通过作业的 web_url 在 CircleCI 应用中查看。
趋势和不稳定测试:circleci_get_workflow_metrics 汇总项目所有工作流在最近 24 小时到最近 90 天之间某个时间窗口内的数据(运行次数、成功率、耗时、消耗的额度、恢复时间),可针对一个分支或全部分支。circleci_get_workflow_summary 显示单个工作流最近 90 天的数据及与上一周期相比的趋势。circleci_list_flaky_tests 列出在同一提交上既通过又失败过的测试,以及出现次数和浪费的时间。Insights 数据每天更新一次,不是实时的。
上下文和变量:circleci_list_contexts 需要来自 circleci_list_collaborations 的组织 ID(对于 GitHub OAuth 和 Bitbucket 组织,也可以用 gh/acme 这样的组织 slug)。circleci_list_context_env_var_names 和 circleci_list_project_env_var_names 只返回环境变量的名称,从不返回它们的值。
分页:列表会返回 next_page_token;AI 会把它作为 page_token 传回,直到它为空。
常见错误:401:令牌错误或已被撤销,或者它是项目 API 令牌;请在 User Settings 中创建个人 API 令牌。404:项目 slug 错误,或你的用户看不到该项目;对于你无权访问的项目,CircleCI 返回 404 而不是 403。429:已达到速率限制;请等一分钟后重试。
该连接器不涉及批准挂起的作业,创建或删除项目、上下文、环境变量、计划任务和 Webhook,也不读取完整的步骤日志。
前提条件: CIRCLECI_TOKEN
本地安装连接器
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
打开 http://localhost:3000/connectors/store,选择 CircleCI 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
circleci_get_current_user | Get the CircleCI user the personal API token belongs to: id, login and name |
circleci_list_collaborations | List the organizations the user belongs to: id, name, VCS type and slug (e.g. gh/acme, or circleci/<org-id> for GitHub App and GitLab… |
circleci_get_project | Get a project by slug: name, project id, organization name, slug and id, and the connected repository URL and default branch |
circleci_list_pipeline_definitions | List the pipeline definitions of a project: id, name, description and where the config and code come from |
circleci_list_pipelines | List the pipelines of a project, newest first: id, number, state, branch or tag, commit, trigger, actor, time and setup errors |
circleci_get_pipeline | Get one pipeline by id: number, state, branch or tag, commit, trigger, actor, time and setup errors |
circleci_get_pipeline_by_number | Get one pipeline of a project by its number (the #123 shown in the CircleCI app) |
circleci_list_pipeline_workflows | List the workflows of a pipeline: id, name, status (success, running, failed, on_hold, canceled ...), start and stop time and who started… |
circleci_get_workflow | Get one workflow by id: name, status, pipeline id and number, project, start and stop time, and who started, canceled or errored it |
circleci_list_workflow_jobs | List the jobs of a workflow: id, job number, name, type (build or approval), status, dependencies, start and stop time |
circleci_get_job | Get the details of a job by project and job number: name, status, duration, executor and resource class, parallelism and per-run status… |
circleci_list_job_tests | Summarize the test results a job uploaded with store_test_results: how many passed, were skipped and failed, and for every failed test its… |
circleci_list_job_artifacts | List the artifacts a job stored with store_artifacts: path, node index and download URL |
circleci_get_workflow_metrics | Insights summary for every workflow of a project over a reporting window (default last 90 days): runs, success rate, failed runs, duration… |
circleci_get_workflow_summary | Insights for one workflow: metrics for the last 90 days (runs, success rate, duration, credits, time to recovery) and their trend against… |
circleci_list_flaky_tests | List the project's flaky tests (tests that passed and failed on the same commit): test name, class, file, job and workflow, how often it… |
circleci_trigger_pipeline | Start a new pipeline for a project from a pipeline definition, on a branch or tag |
circleci_rerun_workflow | Rerun a workflow as a new workflow: all jobs, only from the failed job (from_failed), or chosen jobs |
circleci_cancel_workflow | Cancel a running workflow; its running jobs stop and jobs not yet started will not run, which can leave a deployment half done |
circleci_list_contexts | List the contexts (shared sets of environment variables) of an organization: id, name and creation time |
circleci_list_context_env_var_names | List the names of the environment variables in a context, with created and updated time |
circleci_list_project_env_var_names | List the names of a project's environment variables (Project Settings > Environment Variables) with their creation time |
示例提示
- “gh/acme/web-app 在 main 上最近一次流水线为什么失败?给我看失败的作业、失败的测试及其消息,以及作业链接。”
- “gh/acme/web-app 里哪些测试不稳定?它们随机失败了多少次,浪费了多少时间?”
- “比较 gh/acme/web-app 所有工作流在全部分支上最近 30 天的情况:成功率、平均耗时和消耗的额度。”
- “从失败的作业开始重新运行流水线 #1482 的部署工作流。告诉我哪些作业会再次运行,启动前先问我。”
- “在 release/2.4 分支上启动一条流水线,并把参数 deploy 设为 true。先给我看项目、分支和参数。”
下一步
这份指南对你有帮助吗?