mcpField
M
Mcp Server Github

Mcp Server Github

远程服务
github.com/kogunlowo123版本控制029 周前更新
代码仓库

关于 Mcp Server Github

Mcp Server Github 为团队和开发者提供 GitHub API 操作,涵盖代码库数据、问题、拉取请求、代码搜索、分支和 Actions 工作流。

主要功能

  1. 01列出代码库
  2. 02创建问题
  3. 03列出拉取请求
  4. 04读取文件内容
  5. 05搜索代码
  6. 06管理分支和 Actions 工作流

适用场景

  1. 01查看代码库和拉取请求信息
  2. 02创建带标签或受理人的问题
  3. 03搜索 GitHub 代码库中的代码
  4. 04检查工作流运行记录

MCP 相关

这是一个向 MCP 客户端提供 GitHub API 工具的 MCP 服务。运行时需在 GITHUB_TOKEN 中配置 GitHub 个人访问令牌。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://github.com/kogunlowo123/mcp-server-aws
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

全部服务地址
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-aws
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-azure
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-terraform
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-kubernetes
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-devops
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-github
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-database
Streamable HTTPhttps://github.com/kogunlowo123/mcp-server-vector-db

工具

详细介绍

mcp-server-github

一个 MCP(Model Context Protocol)服务,提供用于与 GitHub API 交互的工具,包括仓库、议题、拉取请求、代码搜索、分支和 GitHub Actions 工作流。

架构

graph TB
    subgraph Client
        style Client fill:#4A90D9,stroke:#2E6BA6,color:#FFFFFF
        MCP_Client["MCP Client"]
    end

    subgraph Server["mcp-server-github"]
        style Server fill:#2ECC71,stroke:#1A9B52,color:#FFFFFF
        Index["index.ts<br/>MCP Server Entry"]
        subgraph Tools
            style Tools fill:#F39C12,stroke:#C67D0A,color:#FFFFFF
            T1["list_repos"]
            T2["create_issue"]
            T3["list_pull_requests"]
            T4["get_file_contents"]
            T5["search_code"]
            T6["create_branch"]
            T7["list_workflows"]
            T8["get_workflow_runs"]
        end
    end

    subgraph External["GitHub API"]
        style External fill:#24292E,stroke:#1B1F23,color:#FFFFFF
        Repos["Repos API"]
        Issues["Issues API"]
        PRs["Pull Requests API"]
        Contents["Contents API"]
        Search["Search API"]
        Git["Git Refs API"]
        Actions["Actions API"]
    end

    MCP_Client -- "stdio transport" --> Index
    Index --> T1 & T2 & T3 & T4 & T5 & T6 & T7 & T8
    T1 --> Repos
    T2 --> Issues
    T3 --> PRs
    T4 --> Contents
    T5 --> Search
    T6 --> Git
    T7 --> Actions
    T8 --> Actions

安装

npm install
npm run build

配置

变量描述必需
GITHUB_TOKENGitHub 个人访问令牌是

用法

独立运行
GITHUB_TOKEN=ghp_xxxx npm start
开发
npm run dev
Docker
docker build -t mcp-server-github .
docker run -e GITHUB_TOKEN=ghp_xxxx mcp-server-github
MCP 客户端配置
{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxx"
      }
    }
  }
}

工具参考

工具描述参数
list_repos列出仓库owner?、type?、sort?
create_issue创建议题owner、repo、title、body?、labels?、assignees?
list_pull_requests列出拉取请求owner、repo、state?、sort?
get_file_contents获取文件内容owner、repo、path、ref?
search_code搜索代码query、per_page?
create_branch创建分支owner、repo、branch、from_branch?
list_workflows列出工作流owner、repo
get_workflow_runs获取工作流运行记录owner、repo、workflow_id、status?

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。