SuperAPI AI 工具集

github-operations

编程与开发

查看项目

更新于 10-15 19:52

技能介绍

用途:该技能用于通过集中式 MCP Server 管理 GitHub 的 Pull Request 和 Issue,包括创建、更新、关闭、审查、合并 PR,以及创建、更新、关闭 Issue、添加评论、管理标签和搜索等。文件读写、分支操作、代码提交等 git 操作不在本技能范围内,需使用 git-delegation 技能。

主要能力:PR 方面支持 create_pull_request、list_pull_requests、get_pull_request、update_pull_request、merge_pull_request、get_pull_request_files、get_pull_request_status、request_reviewers;评论与审查支持 add_issue_comment、list_issue_comments、create_pull_request_review_comment、get_pull_request_comments、get_pull_request_reviews;Issue 方面支持 create_issue、list_issues、get_issue、update_issue、add_issue_comment、list_issue_comments;标签支持 list_labels、get_label;搜索支持 search_issues、search_code、search_repositories、search_users;工具类支持 get_me、list_notifications、list_teams、list_team_members。

使用方式:通过 mcporter CLI 调用 MCP Server 工具,选择器格式为 mcp-github.<tool_name>。简单参数用 key=value 格式,复杂对象用 --args 传 JSON。示例:mcporter call mcp-github.list_pull_requests owner=higress-group repo=hiclaw state=open;mcporter call mcp-github.create_pull_request --args '{"owner":"higress-group","repo":"hiclaw","title":"Add new feature","head":"feature-branch","base":"main"}'。注意 --config 需放在 call 子命令之前,JSON 参数必须使用 --args 标志。输出为 JSON,可用 jq 解析。无需环境变量,mcporter 自动从默认路径 ./config/mcporter.json 读取配置。

适用场景:需要以自动化方式管理 GitHub 仓库协作流程时,例如创建与合并 PR、请求审查者、在代码行上留审查评论、维护 Issue 与标签、搜索代码或仓库等。

限制:MCP Server 使用 HTTP 传输,HTTP 端点需要 Authorization 头携带 Bearer token(自动配置)。受 GitHub API 速率限制影响,出现 403 响应时需等待后重试;若 MCP Server 返回 403,可能需由 Manager 重新授权访问。已知问题:create_pull_request_review 存在模板处理缺陷,添加 PR 审查评论时,一般评论用 add_issue_comment,针对具体代码行用 create_pull_request_review_comment。典型工作流为:克隆与修改、推送变更使用 git-delegation 技能;创建 PR、审查 PR、合并 PR 使用本技能。