GitHub Actions Utils MCP服务器-将AI工具直接连接到GitHub Actions
Created and maintained by techprimate and all the amazing contributors.
Features • Tools • Installation • Configuration • Examples • Development • License
关于
MCP(模型上下文协议)服务器,使AI代理、助手和聊天机器人能够获取和分析GitHub Action定义,探索可用的输入和输出,并理解动作配置——所有这些都是通过自然语言交互实现的。
使用案例:
- 工作流开发:在构建CI/CD工作流时快速发现GitHub Action参数
- 行动发现:探索任何公共GitHub Action的可用输入、输出和配置选项
- 文档:自动为工作流中使用的操作生成文档
- 迁移和更新:了解升级操作版本时的参数更改
- 验证:在部署工作流之前验证操作配置
特性
- 获取GitHub操作参数(
get_action_parameters工具) - 从GitHub存储库获取README文档(
get_readme工具) - Docker支持,易于部署
- 跨平台(macOS、Linux、Windows)
- 适用于VS Code、Claude Desktop、Cursor、Windsurf等
工具
get_action_parameters
获取并解析GitHub操作 action.yml 文件,返回有关输入、输出和配置的完整元数据。
参数:
actionRef(必填):GitHub Action引用格式owner/repo@version
示例查询:
Can you show me the parameters for actions/checkout@v5?
What inputs does actions/setup-node@v4 accept?
Explain the outputs of docker/build-push-action@v6get_readme
从GitHub存储库中获取README.md文件,以了解操作文档。
参数:
repoRef(必填):GitHub存储库参考格式owner/repo[@ref](默认为main如果没有提供参考)
示例查询:
Can you get the README for actions/checkout?
Show me the documentation for docker/build-push-action@v6
What does the README say about github/github-mcp-server?示例工作流程
发现动作参数
“行动的所有投入是什么/setup-python@v5?"
AI获取并解释所有可用的输入,包括 python-version, cache, architecture等等。
构建工作流
“帮助我创建一个工作流,用于签出代码、设置Node.js 20和运行测试”
AI使用这两种工具来理解正确的参数并生成完整的工作流文件。
比较操作版本
“行动之间发生了什么变化/upload-artifact@v3还有@v4?"
AI获取两个版本,并突出显示输入、输出和行为的差异。
探索新行动
“演示如何使用aws操作/配置aws凭据”
AI使用 get_readme 获取文档和 get_action_parameters 了解所有配置选项。
______________________________________________________________________
安装
先决条件
- 兼容的MCP主机应用程序:
- VS代码1.101+与GitHub副本 - 克劳德桌面 - 光标IDE - Windsurf IDE - 任何兼容MCP的客户端
- 以下之一:
- 预构建二进制文件(推荐) - 码头工人 - 转到1.25+(从源代码构建)
快速安装
选项1:预构建二进制文件(推荐)
下载最新版本:
访问 并下载适合您平台的二进制文件:
- macOS:
github-actions-utils-cli-darwin-amd64(英特尔)或github-actions-utils-cli-darwin-arm64(苹果硅) - Linux:
github-actions-utils-cli-linux-amd64或github-actions-utils-cli-linux-arm64 - 视窗:
github-actions-utils-cli-windows-amd64.exe
安装:
# macOS/Linux - move to a directory in your PATH
sudo mv github-actions-utils-cli-* /usr/local/bin/github-actions-utils-cli
sudo chmod +x /usr/local/bin/github-actions-utils-cli
# Verify installation
github-actions-utils-cli --version选项2:Docker
# Pull the image (from GitHub Container Registry)
docker pull ghcr.io/techprimate/github-actions-utils-cli:latest
# Or from Docker Hub
docker pull docker.io/techprimate/github-actions-utils-cli:latest
# Test it works
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | docker run -i --rm ghcr.io/techprimate/github-actions-utils-cli:latest mcp选项3:从源代码构建
# Clone and build
git clone https://github.com/techprimate/github-actions-utils-cli.git
cd github-actions-utils-cli
make build
# Binary will be at ./dist/github-actions-utils-cli______________________________________________________________________
配置
VS代码与GitHub Copilot
先决条件:VS代码1.101+,已安装GitHub Copilot
设置:
- 打开VS代码设置(Cmd/Ctrl+,)
- 搜索“MCP”
- 点击“在settings.json中编辑”
- 添加服务器配置:
Using BinaryUsing Docker
{
"github.copilot.chat.mcp.servers": {
"github-actions-utils": {
"command": "/usr/local/bin/github-actions-utils-cli",
"args": ["mcp"]
}
}
}{
"github.copilot.chat.mcp.servers": {
"github-actions-utils": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/techprimate/github-actions-utils-cli:latest",
"mcp"
]
}
}
}- 重新启动VS代码
- 打开副驾驶聊天,切换“代理模式”以激活MCP工具
故障排除:
- 确保VS代码为1.101或更高版本
- 验证GitHub Copilot扩展是否已安装并激活
- 检查二进制路径是否正确:
which github-actions-utils-cli
克劳德桌面
先决条件: 克劳德桌面 安装
设置:
- 找到您的Claude配置文件:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 视窗: %APPDATA%\Claude\claude_desktop_config.json - Linux: ~/.config/Claude/claude_desktop_config.json
- 添加服务器配置:
Using BinaryUsing Docker
{
"mcpServers": {
"github-actions-utils": {
"command": "/usr/local/bin/github-actions-utils-cli",
"args": ["mcp"]
}
}
}{
"mcpServers": {
"github-actions-utils": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/techprimate/github-actions-utils-cli:latest",
"mcp"
]
}
}
}- 重新启动克劳德桌面
- 寻找🔌 右下角的图标,用于验证服务器是否已连接
故障排除:
- 验证配置文件是否为有效的JSON
- 检查Claude Desktop日志中的连接错误
- 确保二进制路径是绝对的,而不是相对的
光标IDE
先决条件: 光标IDE 安装
设置:
- 打开光标设置(Cmd/Ctrl+,)
- 导航到“光标设置”→ "MCP"
- 点击“编辑配置”
- 添加服务器配置:
Using BinaryUsing Docker
{
"mcpServers": {
"github-actions-utils": {
"command": "/usr/local/bin/github-actions-utils-cli",
"args": ["mcp"]
}
}
}{
"mcpServers": {
"github-actions-utils": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/techprimate/github-actions-utils-cli:latest",
"mcp"
]
}
}
}- 重新启动游标
- MCP工具将在AI聊天中可用
Windsurf IDE
先决条件: Windsurf IDE 安装
设置:
- 打开风帆设置
- 导航到“MCP服务器”
- 添加新的服务器配置:
Using BinaryUsing Docker
{
"mcpServers": {
"github-actions-utils": {
"command": "/usr/local/bin/github-actions-utils-cli",
"args": ["mcp"]
}
}
}{
"mcpServers": {
"github-actions-utils": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/techprimate/github-actions-utils-cli:latest",
"mcp"
]
}
}
}- 重新启动Windsurf
其他MCP客户端
对于其他MCP兼容客户端,请使用标准MCP配置格式:
{
"mcpServers": {
"github-actions-utils": {
"command": "/usr/local/bin/github-actions-utils-cli",
"args": ["mcp"]
}
}
}有关具体的配置文件位置,请参阅MCP客户端的文档。
______________________________________________________________________
遥测
该项目使用Sentry进行错误跟踪和性能监控,以帮助改进该工具。
禁用遥测:
export TELEMETRY_ENABLED=false将此添加到您的shell配置文件中(.bashrc, .zshrc等)使其永久化。
______________________________________________________________________
发展
先决条件
- 转到1.25或更高版本
- 制造
- 打印 (用于格式化)
设置
# Clone the repository
git clone https://github.com/techprimate/github-actions-utils-cli.git
cd github-actions-utils-cli
# Install dependencies
make init
# Build
make build
# Run tests
make test
# Format code
make format
# Run static analysis (vet, staticcheck, govulncheck)
make analyze项目结构
.
├── cmd/cli/ # CLI entry point with main.go
├── internal/
│ ├── cli/
│ │ ├── cmd/ # Cobra commands (root, mcp)
│ │ └── mcp/ # MCP server and tool handlers
│ ├── github/ # GitHub Actions fetcher and parser
│ └── logging/ # Multi-handler for Sentry integration
├── .github/workflows/ # CI/CD pipelines
├── docs/ # Documentation
├── Makefile # Build commands
└── README.md # This file测试
# Run all tests
make test
# Run with coverage
go test -cover ./...
# Test specific package
go test ./internal/github/
# Run with race detection
go test -race ./...Docker开发
在本地构建和测试Docker镜像:
# Build Linux binaries for Docker
make build-linux
# Build Docker image (multi-platform)
make docker-build
# Test the Docker image
make docker-test
# Run interactively
make docker-run
# Or use docker directly
docker run --rm -i ghcr.io/techprimate/github-actions-utils-cli:latest mcpDocker镜像详细信息:
- 基本图像:
buildpack-deps:bookworm(包括常用构建工具和证书) - 平台:
linux/amd64,linux/arm64 - 注册表:
- ghcr.io/techprimate/github-actions-utils-cli (GitHub容器注册表) - docker.io/techprimate/github-actions-utils-cli (Docker Hub)
- 标签:
- latest -最新主分支机构建设 - v1.0.0 -特定版本发布 - 1.0 -主要版本.次要版本 - 1 -主要版本
Docker手动构建:
# Build binaries
make build-linux
# Build for specific platform
docker build --platform linux/amd64 -t github-actions-utils-cli:latest .
# Build multi-platform (requires buildx)
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t github-actions-utils-cli:latest \
--load \
.手动MCP测试
重要:MCP服务器通过stdin/stdout上的JSON-RPC进行通信,旨在供MCP客户端使用,而不是直接从命令行使用。当没有输出出现时,服务器正常工作——它正在等待来自MCP客户端的正确JSON-RPC格式的输入。
要验证服务器是否正常工作,请执行以下操作:
# Build the CLI
make build
# Test that the server starts (it should produce an error about invalid message format)
echo '{}' | ./dist/github-actions-utils-cli mcp
# Output: Error: invalid message version tag ""; expected "2.0"
# This confirms the server is reading stdin and validating JSON-RPC messages
# Verify binary is executable
./dist/github-actions-utils-cli --version实际测试工具,使用上述配置示例在MCP客户端(VS Code、Claude Desktop、Cursor等)中配置服务器,然后使用自然语言查询:
- “显示操作参数/checkout@v5"
- “获取github/github mcp服务器的README”
MCP客户端将处理JSON-RPC通信,并以用户友好的格式呈现结果。
添加新工具
看 代理商.md 有关添加新MCP工具的详细说明。
快速概述:
- 在中定义参数结构
internal/cli/mcp/tools.go - 实现处理程序功能
- 在中注册工具
internal/cli/mcp/server.go - 添加测试
- 更新README
______________________________________________________________________
贡献
欢迎投稿!请参阅我们的投稿指南:
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 使用提交更改 约定式提交
- 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
提交消息格式
我们使用 约定式提交:
feat: add support for private actions
fix: handle action.yaml extension
docs: update installation instructions______________________________________________________________________
安全
报告安全问题
请向报告安全漏洞 security@techprimate.com.
安全最佳实践
- 此工具仅获取可公开访问的GitHub Action定义
- 不需要或存储身份验证令牌
- 所有网络请求都通过GitHub的公共原始内容CDN
- 哨兵遥测可以通过环境变量禁用
______________________________________________________________________
许可证
本项目根据MIT许可证条款获得许可。看 许可证 了解详情。
______________________________________________________________________
支持
______________________________________________________________________
由以下材料制成❤️ 通过 科技灵长类动物
