本项目提供了一系列操作 GitHub 仓库的功能,能创建新问题、获取仓库信息等,还支持多种搜索语法,帮助你高效使用 GitHub。
在使用 GitHub MCP 服务器前,你需要完成相关配置。具体步骤如下:
repo 权限范围的令牌(“对私有仓库进行全面控制”),如果仅用于公开仓库,可以选择 public_repo 权限范围,最后复制生成的令牌。claude_desktop_config.json 中添加以下配置:{
"githubMCP": {
"token": "your_personal_access_token_here",
"baseUrl": "https://api.github.com"
}
}
createIssueowner:仓库所有者名称(例如:octocat)repo:仓库名称(例如:hello-world)title:问题标题(例如:这是一个新问题)body:问题描述getRepositoryInfoowner:仓库所有者名称repo:仓库名称getContentsowner:仓库所有者名称repo:仓库名称path:文件路径(可选)language:javascript:根据编程语言筛选repo:owner/name:在特定仓库中搜索path:app/src:在指定路径下搜索extension:js:根据文件扩展名筛选q: "import express" language:typescript path:src/is:issue 或 is:pr:根据类型筛选is:open 或 is:closed:根据状态筛选label:bug:根据标签筛选author:username:根据作者筛选q: "memory leak" is:issue is:open label:bugtype:user 或 type:org:根据账户类型筛选followers:>1000:根据关注者数量筛选location:London:根据位置筛选q: "fullstack developer" location:London followers:>100调用 createIssue 函数:
owner:octocatrepo:hello-worldtitle:这是一个新问题body:请帮我解决这个问题。调用 getRepositoryInfo 函数:
owner:octocatrepo:hello-world文档中未提及许可证相关信息。
请根据实际需求调整上述配置和函数调用。