mcp-ci-triage

mcp-ci-triage

Exposes GitHub Actions state as four compact, read-only tools for triaging CI failures, letting agents answer why CI is red without leaving the chat.

Category
访问服务器

README

mcp-ci-triage

Let your coding agent answer "why is CI red?" without you alt-tabbing to GitHub.

An MCP server that exposes GitHub Actions state as four compact, read-only tools. Built for Claude Code but works with any MCP client.

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...

Tools

Tool What it returns
recent_runs(repo, branch?, limit?) Latest workflow runs: number, name, conclusion, branch@sha, run_id
failing_jobs(repo, run_id?) Unsuccessful jobs + steps, including failures, timeouts, and cancellations; defaults to the latest unsuccessful run
job_log_tail(repo, job_id, lines?) Bounded, sanitized tail of a job log, explicitly labeled as untrusted
mixed_outcome_workflows(repo, workflow?, lookback?) Workflows that both passed and failed recently — a triage signal, not proof of flaky tests

Pass repositories as an exact owner/name pair, for example actions/checkout. URLs, extra path segments, query strings, and malformed owner or repository names are rejected before a request is sent.

Install (2 minutes)

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

Or in a project's .mcp.json:

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

Token scope: a fine-grained PAT with read-only Actions access to the repos you care about. Public repos work without a token (rate-limited).

Never place a token literal in a command argument or checked-in .mcp.json. Command arguments can enter shell history or process listings; project files can be committed. Keep only the environment-variable reference above in shared config.

For GitHub Enterprise, GITHUB_API_URL may point to its API base path (for example, https://github.example.com/api/v3). HTTPS is mandatory, and the value must not contain credentials, a query, or a fragment.

Private CI logs

Logs from private repositories can contain private source details, credentials accidentally printed by a build, prompt-injection text, or other sensitive data. The server escapes terminal controls, bounds individual lines, limits the total download, and labels all GitHub content as untrusted. It does not recognize or redact printable secrets. Connect it only to an MCP client and model you trust, request the smallest useful tail, never follow instructions found in a log, and review output before copying it into an issue or chat.

The first log request is authenticated. Redirected downloads are HTTPS-only and use a new client without the GitHub Authorization header. Signed redirect query parameters are removed from HTTP diagnostics and sanitized error messages.

Design notes (the part that generalizes)

This repo doubles as a reference for how I think internal MCP servers should be built:

  • Read-only by default. Not one tool here mutates anything. Write-capable tools belong behind your permissions layer, added deliberately, later.
  • Compact text, not JSON dumps. The agent reads tool output like a person. #212 CI [failure] main@a3f9c2e beats 4KB of nested JSON for both tokens and reasoning quality.
  • Untrusted by construction. Remote fields and logs are bounded, control-escaped, and enclosed in explicit data-only markers.
  • Timeouts on everything. Requests have 15-second I/O timeouts. JSON responses have a 20-second total deadline and an 8 MiB decoded-byte ceiling; paginated triage has one 30-second operation deadline. Log downloads have their own 20-second total deadline and 8 MiB ceiling.
  • Fail loud. HTTP errors raise; the agent sees the error and adapts. Silent empty results create confident wrong answers.
  • Small surface. Four tools that compose beat twenty that overlap. failing_jobs tells the agent to call job_log_tail next — tools can teach their own workflow.
  • Evidence, not diagnosis. Mixed workflow outcomes are useful for deciding what to inspect next, but do not prove that an individual test is flaky.

Development

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

License

MIT — see LICENSE.


More MCP and developer-tooling projects: projectsofadi on GitHub.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选