Back to MCP directory
publicPublicdnsLocal runtime

limited-github-cli-mcp

一个基于GitHub CLI的MCP服务器,支持创建、查看、列表和评论PR操作,无需直接处理GitHub访问令牌。

article

README

🚀 有限的GitHub CLI MCP

这是一个借助GitHub CLI来执行GitHub拉取请求(PR)操作的MCP服务器。其独特之处在于,它利用本地的gh命令,无需GitHub访问令牌。

🚀 快速开始

使用此MCP服务器前,需满足以下先决条件:

  • 已安装GitHub CLI (gh)
  • 使用gh auth login登录到GitHub账户
  • 拥有要操作的GitHub仓库的本地克隆

✨ 主要特性

此MCP服务器提供以下功能:

  1. 创建PR (create_pr)
    • 可指定标题、正文、基础分支、头部分支和草稿选项。
  2. 列出PR (list_prs)
    • 能根据状态(打开、关闭、已合并、所有)、基础分支和结果数量进行过滤。
  3. 查看PR详细信息 (view_pr)
    • 通过指定PR编号可获取特定PR的详细信息。
  4. 在PR上评论 (comment_pr)
    • 通过指定PR编号和正文可向PR添加评论。

💻 使用示例

基础用法

创建PR

use_mcp_tool({
  server_name: "limited-github-cli",
  tool_name: "create_pr",
  arguments: {
    title: "添加新功能",
    body: "此PR添加了功能X",
    base: "main",
    head: "feature/x",
    draft: true
  }
})

列出PR

use_mcp_tool({
  server_name: "limited-github-cli",
  tool_name: "list_prs",
  arguments: {
    state: "open",
    limit: 5
  }
})

查看PR详细信息

use_mcp_tool({
  server_name: "limited-github-cli",
  tool_name: "view_pr",

(原文档此处代码未完整,若有完整代码可按格式补充)

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client