Token导航 LogoToken导航TokenDH.com
Go GitHub MCP logo
开发工具未说明官方级别未说明来源级核验

Go GitHub MCP

MCP Server

一个基于Go的Model Context Protocol (MCP)服务器实现,提供GitHub集成功能,包括拉取请求列表、评论管理和GitHub认证。

工具数

3

提示词数

0

GitHub Stars

1

资源数

0
GitHubGoClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

diasduisembayev

提供方

diasduisembayev

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

转到github mcp

Go中的模型上下文协议(MCP)服务器实现,为Claude提供GitHub集成。\ 本项目展示了如何使用 包裹。

______________________________________________________________________

特性

  • 列出拉取请求:通过按状态(打开、关闭、全部)过滤来获取您编写的拉取请求
  • 获取未解决的评论:使用智能预览检索未解决的审核评论
  • 获取完整评论:访问内容完整且无截断的完整评论线程
  • GitHub身份验证:基于令牌的安全身份验证
  • GraphQL集成:使用GitHub的GraphQL API高效获取数据

______________________________________________________________________

安装

先决条件

  • 转到1.19或更高版本
  • 具有适当权限的GitHub个人访问令牌
  • Claude CLI或兼容的MCP客户端

建筑

  1. 克隆存储库:
   git clone 
   cd gogithub
  1. 安装依赖项:
   go mod tidy
  1. 构建MCP服务器:
   go build -o github-mcp-server

______________________________________________________________________

配置

1.GitHub令牌设置

创建具有以下权限的GitHub个人访问令牌:

  • repo --完全控制私有存储库
  • read:user --读取个人资料访问权限

将令牌设置为环境变量:

export GITHUB_TOKEN=your_github_token_here

______________________________________________________________________

2.克劳德MCP配置

将MCP服务器添加到Claude配置文件中:

~/.克劳德。

{
  "mcpServers": {
    "my-github-tools": {
      "command": "/path/to/your/gogithub/github-mcp-server",
      "env": {
        "GITHUB_TOKEN": "your_github_token_here"
      }
    }
  }
}
替换 /path/to/your/gogithub/github-mcp-server 使用构建二进制文件的绝对路径。

______________________________________________________________________

3.重启克劳德

重新启动Claude CLI以加载新的MCP服务器配置。

______________________________________________________________________

用法

配置后,您可以在Claude中使用以下工具。

列出拉取请求

list my open pull requests

参数:

  • state (可选): "open", "closed",或 "all" (默认值: "open")

______________________________________________________________________

获取未解决的评论

get unresolved comments from https://github.com/owner/repo/pull/123

参数:

  • pull_request_url (必填):完整的GitHub PR URL

______________________________________________________________________

获取完整评论

get full comments from https://github.com/owner/repo/pull/123

参数:

  • pull_request_url (必填):完整的GitHub PR URL
  • unresolved_only (可选): "true""false" (默认值: "false")

______________________________________________________________________

工作流示例

  1. 查找您的PR:
   list my open prs
  1. 检查未解决的注释:
   get unresolved comments from the first open PR
  1. 获取完整的评论详细信息:
   get full comments from this PR
  1. 向克劳德寻求帮助:
   help me fix those comments step by step

______________________________________________________________________

建筑

项目结构

gogithub/
├── main.go             # MCP server setup and tool registration
├── github_service.go   # GitHub API integration and handlers
├── go.mod              # Go module dependencies
├── go.sum              # Dependency checksums
└── README.md           # This file

关键组件

  • MCP服务器 --使用 github.com/mark3labs/mcp-go/mcp
  • GitHub REST API --通过搜索发现拉取请求
  • GitHub GraphQL API --高效的评论线程检索
  • OAuth2身份验证 --安全的GitHub令牌处理

______________________________________________________________________

代码示例

工具注册

listPRsTool := mcp.NewTool(
    "list_pull_requests",
    mcp.WithDescription("Lists pull requests authored by the authenticated user."),
    mcp.WithString(
        "state",
        mcp.Description("The state of the pull requests to list (open, closed, or all). Defaults to 'open'."),
        mcp.Enum("open", "closed", "all"),
    ),
)

s.AddTool(listPRsTool, ghService.listPullRequestsHandler)

处理程序实现

func (s *githubService) listPullRequestsHandler(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
    state := req.GetString("state", "open")

    // GitHub API integration
    query := strings.Join(queryParts, " ")
    result, resp, err := s.restClient.Search.Issues(ctx, query, opts)

    // Return formatted results
    return mcp.NewToolResultText(responseBuilder.String()), nil
}

______________________________________________________________________

相关资源

目录标签

目录标签

GitHubGoClaudeGitHub集成本地部署拉取请求管理评论管理MCP服务器Go开发

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP