mcpField
G
gha-intel

gha-intel

本地服务
github.com/barissozudogru云与基础设施22 天前更新

关于 gha-intel

gha-intel 是供团队检查 GitHub Actions 性能和工作流配置的 MCP 服务。它统计运行耗时、审查 YAML 优化机会并查询仓库缓存用量;账户账单数据受已停用的 GitHub 接口限制。

主要功能

  1. 01工作流与作业耗时统计
  2. 02工作流 YAML 配置审查
  3. 03查询仓库缓存用量
  4. 04支持 stdio、HTTP 和 Docker 部署

适用场景

  1. 01查看近期工作流耗时趋势
  2. 02在工作流 YAML 中查找缓存或并发优化点
  3. 03检查仓库缓存占用

MCP 相关

提供工作流耗时分析、YAML 审查以及仓库缓存和运行用量查询工具。支持 stdio 和 HTTP 传输。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"barissozudogru-gha-intel": {
"command": "npx",
"args": [
"-y",
"@barissozudogru/gha-intel-mcp"
],
"env": {
"GITHUB_TOKEN": "<GITHUB_TOKEN>"
}
}
}
}
启动命令npx -y @barissozudogru/gha-intel-mcp
需要配置的环境变量
GITHUB_TOKEN密钥GitHub token with repository and actions read access, for the GitHub API.

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@barissozudogru/gha-intel-mcp0.4.3

工具

3

收录的工具列表 · 更新于 2 周前

参数类型必填说明
repostring是GitHub 仓库名称
countinteger否要分析的近期运行次数(默认值:10,最大值:100)
ownerstring是GitHub 仓库所有者(用户或组织)
workflow_idstring是工作流文件名(例如 ci.yml)或数字工作流 ID

详细介绍

gha-intel-mcp

gha-intel-mcp

npm version License: MIT

npm · Source · Issues

通过 MCP 检查 GitHub Actions 运行耗时并审查工作流配置。

工具

工具描述
list_workflow_performance计算近期工作流运行时长的平均值、最小值、最大值和 p95 统计数据。
analyze_workflow_config评估工作流 YAML 中的缓存、并行度、并发、制品、检出深度、超时、运行器固定、Docker 缓存和触发器。
get_billing_usage读取仓库缓存用量和近期运行耗时。账户账单使用的端点已停用;请参阅下方的限制说明。

要求

  • Node.js >= 18(使用原生 fetch)
  • 一个有权访问你要检查的仓库的 GitHub 令牌。授予访问权限前,请确认令牌类型和端点权限。

设置

提供三种传输模式。选择适合你部署方式的一种:


选项 A:stdio(本地,推荐用于桌面客户端)

服务作为 MCP 客户端的子进程,通过 stdin/stdout 运行。无需网络端口。

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json(macOS) %APPDATA%\Claude\claude_desktop_config.json(Windows)

{
  "mcpServers": {
    "gha-intel": {
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}
Claude Code
claude mcp add gha-intel -e GITHUB_TOKEN=ghp_your_token -- npx -y @barissozudogru/gha-intel-mcp
Cursor

~/.cursor/mcp.json

{
  "mcpServers": {
    "gha-intel": {
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}
Windsurf

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "gha-intel": {
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}
VS Code + Copilot

.vscode/mcp.json(工作区)或用户设置

{
  "servers": {
    "gha-intel": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}
Cline

打开 Cline 设置,前往 MCP Servers,然后添加:

{
  "mcpServers": {
    "gha-intel": {
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}
Continue.dev

~/.continue/config.yaml

mcpServers:
  - name: gha-intel
    command: npx
    args:
      - -y
      - "@barissozudogru/gha-intel-mcp"
    env:
      GITHUB_TOKEN: ghp_your_token
Zed

~/.config/zed/settings.json

{
  "context_servers": {
    "gha-intel": {
      "command": {
        "path": "npx",
        "args": ["-y", "@barissozudogru/gha-intel-mcp"],
        "env": {
          "GITHUB_TOKEN": "ghp_your_token"
        }
      }
    }
  }
}
JetBrains(IntelliJ、PyCharm、WebStorm 等)

前往 Settings > Tools > AI Assistant > MCP,然后添加:

{
  "mcpServers": {
    "gha-intel": {
      "command": "npx",
      "args": ["-y", "@barissozudogru/gha-intel-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    }
  }
}

选项 B:HTTP(远程或云端客户端)

以 HTTP 模式启动服务,并将客户端指向该端点:

GITHUB_TOKEN=ghp_your_token npx @barissozudogru/gha-intel-mcp --http
# Server listens on http://0.0.0.0:3000/mcp
# Health check: http://localhost:3000/health

也可以通过环境变量设置,而不使用标志:

TRANSPORT=http PORT=3000 GITHUB_TOKEN=ghp_your_token npx @barissozudogru/gha-intel-mcp
Cursor(HTTP)

~/.cursor/mcp.json

{
  "mcpServers": {
    "gha-intel": {
      "url": "http://localhost:3000/mcp"
    }
  }
}
VS Code + Copilot(HTTP)

.vscode/mcp.json

{
  "servers": {
    "gha-intel": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}
Windsurf(HTTP)

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "gha-intel": {
      "serverUrl": "http://localhost:3000/mcp"
    }
  }
}
Continue.dev(HTTP)

~/.continue/config.yaml

mcpServers:
  - name: gha-intel
    url: http://localhost:3000/mcp

选项 C:Docker
docker build -t gha-intel-mcp .
docker run -p 3000:3000 -e GITHUB_TOKEN=ghp_your_token gha-intel-mcp

容器默认以 HTTP 模式启动。将客户端指向 http://localhost:3000/mcp。


工具参考

list_workflow_performance

获取真实运行耗时数据,并计算作业级统计数据。

参数类型必填描述
ownerstring是GitHub 所有者(用户或组织)
repostring是仓库名称
workflow_idstring是工作流文件名(例如 ci.yml)或数字 ID
countnumber否要分析的近期运行数量(默认值:10,最大值:100)

输出: 每个作业和步骤的耗时统计数据(平均值、最小值、最大值、p95)、整体运行耗时,以及近期运行结论列表。


analyze_workflow_config

解析并审计工作流 YAML,找出优化机会。

参数类型必填描述
workflow_contentstring是工作流文件的完整 YAML 内容

输出: 按严重性(critical / warning / info / good)分组的发现,涵盖九个类别,每项均附有具体建议。

分析类别: 依赖项缓存、矩阵策略和 fail-fast、并发组和 cancel-in-progress、制品上传、git checkout 深度、作业超时分钟数、运行器版本固定、Docker 层缓存,以及触发器路径筛选。


get_billing_usage

检索仓库缓存用量和近期运行估算。目前,账户账单功能受已停用的 API 集成限制。

参数类型必填描述
ownerstring是GitHub 用户名或组织
repostring否用于获取仓库级缓存和运行统计的仓库名称

输出: 提供 repo 时,返回可获取的缓存用量和近期运行耗时。账户账单请求使用已停用的 GitHub 端点,可能会失败。现有成本估算采用历史费率表,不应视为当前费用。


环境变量

变量必填描述
GITHUB_TOKEN是GitHub 个人访问令牌。其访问权限必须与请求的仓库和端点相符。请勿将令牌纳入版本控制。
TRANSPORT否设置为 http 以启用 HTTP 模式(默认值:stdio)。
PORT否HTTP 模式下使用的 HTTP 端口(默认值:3000)。

限制和部署

  • 账户账单使用 /settings/billing/actions,GitHub 已于 2025 年 9 月停用该功能。 授予更广泛的令牌权限范围也无法恢复这些端点。仓库缓存 和运行耗时请求使用独立端点。
  • 当前成本估算采用历史费率,缓存利用率按固定的 10 GB 限额计算。请先检查账户配置,再将这些数据用于容量 或预算决策。
  • HTTP 模式会监听所有网络接口,且不实现客户端身份验证。 请仅在可信网络中使用,或在其前方部署经过身份验证的网关。 服务端使用其配置的 GitHub 令牌处理客户端请求。
  • 耗时统计描述的是已获取的运行数据,而不是对未来运行的预测。

开发与支持

请通过 GitHub issues 报告问题。有关贡献工作流,请参阅 CONTRIBUTING.md。

如需使用 Node.js 22 构建和测试源代码检出版本:

npm ci
npm test
npm run build

默认分支可能包含尚未发布到 npm 的更改。

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。