Back to MCP directory
publicPublicdnsLocal runtime

GitHub Plus

GitHub MCP Server Plus是一个增强版的GitHub API服务工具,提供文件操作、仓库管理、搜索功能等全面GitHub操作支持。

article

README

🚀 GitHub 模型上下文协议(MCP)服务器

GitHub 模型上下文协议(MCP)服务器提供了一系列强大的功能,能有效助力代码管理、问题跟踪和仓库操作等工作,提升开发效率。

🚀 快速开始

初始化仓库

在初始化新仓库时,需要配置以下参数:

  • owner: 仓库所有者
  • name: 仓库名称
  • description: 仓库描述(可选)
  • private: 是否为私有仓库(默认公开)

示例命令:

git init --owner="yourusername" --name="myrepo" --description="My new project"

代码搜索

支持以下高级搜索功能:

搜索参数

  • language:javascript:按编程语言筛选
  • repo:owner/name:指定仓库搜索
  • path:app/src:按路径筛选
  • extension:js:按文件扩展名筛选
  • 示例:q: "import express" language:typescript path:src/

问题管理

标签操作

  • 添加标签:gh issue add-label --label bug
  • 删除标签:gh issue remove-label --label bug
  • 列出所有标签:gh issue list-labels

状态查询

gh issue status --owner=myorg --repo=projectx

拉取请求管理

创建拉取请求

gh pr create --head mybranch --base main --title "添加新功能" --body "实现新的用户登录功能"

✨ 主要特性

该GitHub MCP 服务器提供了以下功能:

  1. 代码搜索
  2. 问题跟踪
  3. 拉取请求管理
  4. 用户和组织信息
  5. 仓库操作

📦 安装指南

个人访问令牌

按照以下步骤创建GitHub个人访问令牌:

  1. 访问个人访问令牌页面
  2. 点击“生成新令牌”
  3. 配置权限范围
  4. 复制生成的令牌

使用Claude Desktop

claude_desktop_config.json中添加以下配置:

Docker模式

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "mcp/github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

NPX模式

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

构建指南

使用以下命令构建Docker镜像:

docker build -t mcp/github -f src/github/Dockerfile .

📄 许可证

该GitHub MCP服务器遵循开源许可证,允许用户自由使用、修改和分发,但需遵守相关条款。

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