Skip to main content
Glama

mcp-ci-triage

让你的编码代理回答“为什么 CI 是红的?”,而无需你切换到 GitHub 标签页。

一个 MCP 服务器,将 GitHub Actions 状态暴露为四个紧凑的只读工具。专为 Claude Code 构建,但可与任何 MCP 客户端配合使用。

You: why is CI failing on main?
Agent: → recent_runs("acme/api", branch="main")
       → failing_jobs("acme/api", run_id=8123)
       → job_log_tail("acme/api", job_id=442, lines=80)
Agent: Run #212 fails in `unit` at the pytest step: test_rate_limiter
       times out after the Redis fixture change in a3f9c2e. Two options...

工具

工具

返回内容

recent_runs(repo, branch?, limit?)

最近的工作流运行:编号、名称、结论、分支@sha、run_id

failing_jobs(repo, run_id?)

未成功的作业和步骤,包括失败、超时和取消;默认返回最近一次未成功的运行

job_log_tail(repo, job_id, lines?)

作业日志的有界、经过净化的尾部,明确标记为不可信

mixed_outcome_workflows(repo, workflow?, lookback?)

最近既有通过又有失败的工作流——这是一个分诊信号,而非测试不稳定的证据

以精确的 owner/name 对形式传递仓库,例如 actions/checkout。 URL、额外的路径段、查询字符串以及格式错误的 owner 或仓库名称 会在发送请求之前被拒绝。

Related MCP server: DevOps MCP Server

安装(2 分钟)

pip install git+https://github.com/projectsofadi/mcp-ci-triage
# or: clone + `pip install .`

# First load GITHUB_TOKEN into the launching environment from your shell or
# operating-system secret manager. Then add the server without a token literal:
claude mcp add ci-triage -- python -m mcp_ci_triage

或者在项目的 .mcp.json 中:

{
  "mcpServers": {
    "ci-triage": {
      "command": "python",
      "args": ["-m", "mcp_ci_triage"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    }
  }
}

令牌范围: 一个细粒度 PAT,对你关心的仓库具有只读 Actions 访问权限。公共仓库无需令牌即可工作(有速率限制)。

切勿将令牌字面量放在命令参数或已提交的 .mcp.json 中。 命令参数可能进入 shell 历史或进程列表;项目文件可能 被提交。在共享配置中仅保留上述环境变量引用。

对于 GitHub Enterprise,GITHUB_API_URL 可以指向其 API 基础路径(例如 https://github.example.com/api/v3)。必须使用 HTTPS,且该值不得包含凭据、查询字符串或片段。

私有 CI 日志

来自私有仓库的日志可能包含私有源代码细节、构建意外打印的凭据、提示注入文本或其他敏感数据。 服务器会转义终端控制字符、限制单行长度、限制总下载量,并将所有 GitHub 内容标记为不可信。它不会识别或 编辑可打印的机密。仅将其连接到你信任的 MCP 客户端和模型, 请求最小的有用尾部,绝不遵循日志中的指令,并在将输出复制到 issue 或聊天之前审查输出。

首次日志请求是经过身份验证的。重定向下载仅限 HTTPS,并使用 不带 GitHub Authorization 头的新客户端。签名重定向查询 参数会从 HTTP 诊断和经过净化的错误消息中移除。

设计说明(可推广的部分)

此仓库同时作为我关于内部 MCP 服务器应如何构建的参考:

  • 默认只读。 这里没有任何工具会修改任何内容。支持写入的工具应放在你的权限层之后,稍后有意添加。

  • 紧凑文本,而非 JSON 转储。 代理像人一样读取工具输出。#212 CI [failure] main@a3f9c2e 在令牌和推理质量上都优于 4KB 的嵌套 JSON。

  • 构造上不可信。 远程字段和日志是有界的、控制字符转义的,并包含在明确的数据专用标记中。

  • 所有内容都有超时。 请求有 15 秒的 I/O 超时。JSON 响应有 20 秒的总截止时间和 8 MiB 的解码字节上限;分页分诊有一个 30 秒的操作截止时间。日志下载有自己的 20 秒总截止时间和 8 MiB 上限。

  • 响亮地失败。 HTTP 错误会抛出;代理看到错误并适应。静默的空结果会产生自信的错误答案。

  • 小表面积。 四个可组合的工具胜过二十个重叠的工具。failing_jobs 告诉代理下一步调用 job_log_tail——工具可以教自己的工作流。

  • 证据,而非诊断。 混合工作流结果有助于决定接下来检查什么,但并不能证明某个测试是不稳定的。

开发

pip install -e ".[dev]"
ruff check .
ruff format --check .
pytest
python -m build
python -m twine check dist/*

许可证

MIT — 参见 LICENSE


更多 MCP 和开发者工具项目:projectsofadi on GitHub

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    Not graded
    maintenance
    Connects AI assistants to GitHub Actions workflows to monitor CI/CD pipelines, view run logs, diagnose failures, and optionally trigger or manage workflows with granular permission controls.
    10
    1
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables read-only integration with GitHub, Jenkins, and Artifactory for DevOps monitoring, analysis, and troubleshooting. Provides repository inspection, build log retrieval, and artifact management through natural language.
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Exposes tools to list, run, and inspect GitHub Actions workflows locally via act, enabling debugging and fixing failures through an agent loop.
    3

View all related MCP servers

Related MCP Connectors

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

  • Git-backed platform for skills, tools, and context for AI agents

  • Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/projectsofadi/mcp-ci-triage'

If you have feedback or need assistance with the MCP directory API, please join our Discord server