Chenlong-Tao/mcp-githubcli
If you are the rightful owner of mcp-githubcli and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This MCP server provides a user-friendly interface for GitHub CLI, allowing access to GitHub features via the MCP protocol.
The GitHub CLI MCP server offers a streamlined interface for interacting with GitHub's features using the Model Context Protocol (MCP). It simplifies tasks such as managing repositories, issues, pull requests (PRs), and gists. By leveraging the GitHub CLI, users can perform actions like viewing, creating, and managing these elements directly from the command line. The server ensures that all integer parameters are automatically converted to strings to ensure command execution accuracy. Additionally, it supports full output of PR differences, allowing users to view complete code changes without truncation. The server is designed to be extensible, allowing developers to add new tool functions by modifying the main script.
Features
- Repository Management: View and create repositories.
- Issue Management: View and create issues.
- PR Management: View, create, and view differences in pull requests.
- Gist Management: View and create gists.
- Full PR Diff Output: Ensures complete code change visibility.
Usages
usage with GitHub CLI
python # 查看PR差异 diff = pr_diff(2543, "qianshouapp/kyc") # 查看仓库 repo_info = repo_view("microsoft/vscode") # 创建issue issue_create("owner/repo", "标题", "这是issue的内容")
usage with GitHub CLI PR diff
python diff = pr_diff(2543, "qianshouapp/kyc") print(diff) # 显示完整差异
usage with GitHub CLI repo operations
python # 仓库操作示例 repo_list() # 列出你拥有或参与的GitHub仓库 repo_view("microsoft/vscode") # 查看仓库详细信息 repo_create("new-repo", "这是一个新仓库", False) # 创建新仓库
usage with GitHub CLI issue operations
python # Issue操作示例 issue_list("owner/repo", "open") # 列出仓库中的issue issue_view(456, "owner/repo") # 查看特定issue详情 issue_create("owner/repo", "测试Issue", "这是通过MCP创建的测试Issue") # 创建新issue
usage with GitHub CLI PR operations
python # PR操作示例 pr_list("owner/repo", "open") # 列出仓库中的PR pr_view(123, "owner/repo") # 查看特定PR详情 pr_diff(123, "owner/repo") # 查看特定PR的代码差异 pr_create("owner/repo", "新功能", "添加了新功能", "main") # 创建新PR
usage with GitHub CLI gist operations
python # Gist操作示例 gist_list() # 列出你的Gist gist_create({"file1.txt": "内容"}, "这是一个Gist", True) # 创建新Gist
Tools
Repository Operations
Functions for listing, viewing, and creating repositories.
Issue Operations
Functions for listing, viewing, and creating issues.
PR Operations
Functions for listing, viewing, creating, and diffing pull requests.
Gist Operations
Functions for listing and creating gists.