用于与GitHub API交互的工具,支持文件操作、仓库管理及搜索等功能。

20 次收藏下载次数: 0状态:社区镜像维护者:mcp(Model Context Protocol)仓库类型:镜像最近更新:
下载命令
点击查看

GitHub (已归档) MCP Server

镜像概述和主要用途

本镜像提供与GitHub API交互的工具集,支持文件操作、仓库管理、Issue和Pull Request处理、代码搜索等功能。通过封装GitHub API,实现对GitHub资源的程序化管理和自动化操作。

https://www.anthropic.com/news/model-context-protocol

核心功能和特性

属性详情
Docker镜像https://hub.docker.com/repository/docker/mcp/github
作者https://github.com/modelcontextprotocol
代码仓库https://github.com/modelcontextprotocol/servers
Dockerfilehttps://github.com/modelcontextprotocol/servers/blob/2025.4.24/src/github/Dockerfile
镜像构建方Docker Inc.
Docker Scout健康评分
验证签名COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/github --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
许可证MIT License

使用场景和适用范围

  • 自动化仓库管理:批量创建/更新仓库、分支,实现标准化仓库配置
  • Issue和PR生命周期管理:自动创建Issue、添加评论、合并PR,支持工作流自动化
  • 批量文件操作:在多个仓库或分支中创建、更新文件,适用于配置同步、代码生成场景
  • 代码和用户搜索:跨仓库搜索代码片段、Issue、用户,支持数据分析和调研
  • CI/CD集成:作为CI/CD流程的一部分,实现与GitHub的无缝交互

可用工具列表(26个)

工具名称简短描述
add_issue_comment为现有Issue添加评论
create_branch在GitHub仓库中创建新分支
create_issue在GitHub仓库中创建新Issue
create_or_update_file在GitHub仓库中创建或更新单个文件
create_pull_request在GitHub仓库中创建新Pull Request
create_pull_request_review对Pull Request创建审核
create_repository在个人账号中创建新GitHub仓库
fork_repository将GitHub仓库Fork到个人账号或指定组织
get_file_contents获取GitHub仓库中文件或目录的内容
get_issue获取GitHub仓库中特定Issue的详情
get_pull_request获取特定Pull Request的详情
get_pull_request_comments获取Pull Request的审核评论
get_pull_request_files获取Pull Request中更改的文件列表
get_pull_request_reviews获取Pull Request的审核记录
get_pull_request_status获取Pull Request所有状态检查的综合状态
list_commits获取GitHub仓库中某个分支的提交列表
list_issues列出GitHub仓库中的Issue,支持筛选
list_pull_requests列出并筛选仓库的Pull Request
merge_pull_request合并Pull Request
push_files在单个提交中向GitHub仓库推送多个文件
search_code跨GitHub仓库搜索代码
search_issues跨GitHub仓库搜索Issue和Pull Request
search_repositories搜索GitHub仓库
search_users搜索GitHub用户
update_issue更新GitHub仓库中现有的Issue
update_pull_request_branch使用基础分支的最新更改更新Pull Request分支

工具详细信息

工具:add_issue_comment

为现有Issue添加评论

参数类型描述
bodystring评论内容
issue_numbernumberIssue编号
ownerstring仓库所有者(用户名或组织)
repostring仓库名称

工具:create_branch

在GitHub仓库中创建新分支

参数类型描述
branchstring新分支名称
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
from_branchstring 可选可选:从中创建的源分支(默认为仓库的默认分支)

工具:create_issue

在GitHub仓库中创建新Issue

参数类型描述
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
titlestringIssue标题
assigneesarray 可选可选:负责人列表
bodystring 可选可选:Issue内容
labelsarray 可选可选:标签列表
milestonenumber 可选可选:里程碑编号

工具:create_or_update_file

在GitHub仓库中创建或更新单个文件

参数类型描述
branchstring操作文件的分支
contentstring文件内容
messagestring提交消息
ownerstring仓库所有者(用户名或组织)
pathstring文件创建/更新的路径
repostring仓库名称
shastring 可选可选:被替换文件的SHA(更新现有文件时必需)

工具:create_pull_request

在GitHub仓库中创建新Pull Request

参数类型描述
basestring接收更改的目标分支名称
headstring包含更改的源分支名称
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
titlestringPull Request标题
bodystring 可选可选:Pull Request内容/描述
draftboolean 可选可选:是否创建为草稿Pull Request
maintainer_can_modifyboolean 可选可选:维护者是否可以修改此Pull Request

工具:create_pull_request_review

对Pull Request创建审核

参数类型描述
bodystring审核内容文本
eventstring审核操作类型
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称
commentsarray 可选可选:作为审核一部分发布的评论(指定position或line,不可同时指定)
commit_idstring 可选可选:需要审核的提交SHA

工具:create_repository

在个人账号中创建新GitHub仓库

参数类型描述
namestring仓库名称
autoInitboolean 可选可选:是否使用README.md初始化仓库
descriptionstring 可选可选:仓库描述
privateboolean 可选可选:仓库是否设为私有

工具:fork_repository

将GitHub仓库Fork到个人账号或指定组织

参数类型描述
ownerstring源仓库所有者(用户名或组织)
repostring源仓库名称
organizationstring 可选可选:Fork目标组织(默认为个人账号)

工具:get_file_contents

获取GitHub仓库中文件或目录的内容

参数类型描述
ownerstring仓库所有者(用户名或组织)
pathstring文件或目录路径
repostring仓库名称
branchstring 可选可选:获取内容的分支

工具:get_issue

获取GitHub仓库中特定Issue的详情

参数类型描述
issue_numbernumberIssue编号
ownerstring仓库所有者(用户名或组织)
repostring仓库名称

工具:get_pull_request

获取特定Pull Request的详情

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称

工具:get_pull_request_comments

获取Pull Request的审核评论

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称

工具:get_pull_request_files

获取Pull Request中更改的文件列表

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称

工具:get_pull_request_reviews

获取Pull Request的审核记录

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称

工具:get_pull_request_status

获取Pull Request所有状态检查的综合状态

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称

工具:list_commits

获取GitHub仓库中某个分支的提交列表

参数类型描述
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
pagenumber 可选可选:页码
perPagenumber 可选可选:每页条数
shastring 可选可选:分支SHA或分支名

工具:list_issues

列出GitHub仓库中的Issue,支持筛选

参数类型描述
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
directionstring 可选可选:排序方向
labelsarray 可选可选:标签筛选列表
pagenumber 可选可选:页码
per_pagenumber 可选可选:每页条数
sincestring 可选可选:起始时间(ISO 8601格式)
sortstring 可选可选:排序字段
statestring 可选可选:状态筛选(open/closed/all)

工具:list_pull_requests

列出并筛选仓库的Pull Request

参数类型描述
ownerstring仓库所有者(用户名或组织)
repostring仓库名称
basestring 可选可选:按基础分支名称筛选
directionstring 可选可选:排序方向
headstring 可选可选:按源用户/组织和分支名称筛选
pagenumber 可选可选:页码
per_pagenumber 可选可选:每页条数(最大100)
sortstring 可选可选:排序字段
statestring 可选可选:状态筛选(open/closed/merged/all)

工具:merge_pull_request

合并Pull Request

参数类型描述
ownerstring仓库所有者(用户名或组织)
pull_numbernumberPull Request编号
repostring仓库名称
commit_messagestring 可选可选:附加到自动提交消息的详情
commit_titlestring 可选可选:自动提交消息的标题
merge_methodstring 可选可选:合并方式(merge/squash/rebase)

工具:push_files

在单个提交中向GitHub仓库推送多个文件

参数类型描述
branchstring推送目标分支(如'main'或'master')
filesarray推送文件数组(每个元素需包含path和content字段)
messagestring提交消息
ownerstring仓库所有者(用户名或组织)
repostring仓库名称

工具:search_code

跨GitHub仓库搜索代码

参数类型描述
qstring搜索查询字符串(遵循GitHub搜索语法)
orderstring 可选可选:排序顺序(asc/desc)
pagenumber 可选可选:页码
per_pagenumber 可选可选:每页条数

工具:search_issues

跨GitHub仓库搜索Issue和Pull Request

参数类型描述
qstring搜索查询字符串(遵循GitHub搜索语法)
orderstring 可选可选:排序顺序(asc/desc)
pagenumber 可选可选:页码
per_pagenumber 可选可选:每页条数
sortstring 可选可选:排序字段(comments/created/updated)

工具:search_repositories

搜索GitHub仓库

参数类型描述
querystring搜索查询字符串(参见GitHub搜索语法)
pagenumber 可选可选:页码(默认:1)
perPagenumber 可选可选:每页条数(默认:30,最大:100)

工具:search_users

搜索GitHub用户

参数类型描述
qstring搜索查询字符串(遵循GitHub搜索语法)
orderstring 可选可选:排序顺序(asc/desc)
pagenumber 可选可选:页码
per_pagenumber 可选可选:每页条数
sortstring 可选可选:排序字段(followers/repositories/joined)

工具:update_issue

更新GitHub仓库中现有的Issue

参数类型描述
issue_numbernumberIssue编号
ownerstring

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 github 镜像标签

docker pull docker.xuanyuan.run/mcp/github:<标签>

DockerHub 原生拉取命令

docker pull mcp/github:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告