GitHub 管理控制平面(MCP)提供了一系列操作接口,用于管理仓库的拉取请求、问题、内容等,同时支持代码和问题的搜索功能,还能获取相关库和许可证信息。
本项目提供了多种操作接口,涵盖拉取请求、问题、仓库内容管理、资源搜索等功能,以下为您详细介绍各操作的使用方法。
创建拉取请求:
POST /repos/{owner}/{repo}/pulls
]( 创建一个新的拉取请求。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
head |
新分支的头指针(字符串,必需) |
base |
基础分支名称(字符串,必需) |
title |
拉取请求标题(字符串,必需) |
body |
拉取请求正文(字符串,可选) |
获取拉取请求:
GET /repos/{owner}/{repo}/pulls/{pull_number}
]( 获取指定编号的拉取请求。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
pull_number |
拉取请求编号(字符串,必需) |
创建问题:
POST /repos/{owner}/{repo}/issues
]( 创建一个新的问题。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
title |
问题标题(字符串,必需) |
body |
问题正文(字符串,可选) |
获取问题:
GET /repos/{owner}/{repo}/issues/{issue_number}
]( 获取指定编号的问题。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
issue_number |
问题编号(字符串,必需) |
获取仓库内容:
GET /repos/{owner}/{repo}/contents{/path*}
]( 获取指定路径的仓库内容。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
path |
文件或目录路径(字符串,可选) |
获取特定分支的仓库内容:
GET /repos/{owner}/{repo}/refs/heads/{branch}/contents{/path*}
]( 获取指定分支上指定路径的仓库内容。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
branch |
分支名称(字符串,必需) |
path |
文件或目录路径(字符串,可选) |
获取特定提交的仓库内容:
GET /repos/{owner}/{repo}/sha/{sha}/contents{/path*}
]( 获取指定提交上指定路径的仓库内容。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
sha |
提交哈希值(字符串,必需) |
path |
文件或目录路径(字符串,可选) |
获取特定标签的仓库内容:
GET /repos/{owner}/{repo}/refs/tags/{tag}/contents{/path*}
]( 获取指定标签上指定路径的仓库内容。参数 | 详情 |
---|---|
owner |
仓库所有者(字符串,必需) |
repo |
仓库名称(字符串,必需) |
tag |
标签名称(字符串,必需) |
path |
文件或目录路径(字符串,可选) |
GET /search/code
]( 搜索仓库中的代码。参数 | 详情 |
---|---|
q |
查询条件(字符串,必需) |
sort |
排序方式(字符串,可选) |
order |
排序顺序(字符串,可选) |
GET /search/issues
]( 搜索仓库中的问题。参数 | 详情 |
---|---|
q |
查询条件(字符串,必需) |
sort |
排序方式(字符串,可选) |
order |
排序顺序(字符串,可选) |
GET /
]( 获取 GitHub MCP 库。GET /LICENSE
]( 获取 MIT 许可证内容。本项目采用 MIT 许可证。您可以通过接口 [GET /LICENSE
]( 获取 MIT 许可证内容。