Skip to main content
Glama

GitHub Integration MCP Server

GitHub 集成

GitHub MCP 服务器提供了从 Pull 请求中提取差异的功能。

可用工具

获取差异

从 GitHub Pull Request 中检索差异内容。

参数

  • owner :存储库所有者/组织名称
  • repo :存储库名称
  • pr_number :拉取请求编号

返回:包含以下内容的对象:

  • content :包含 PR diff 的字符串

验证

必需:将 GitHub 个人访问令牌设置为环境变量:

export GITHUB_TOKEN=<your-github-token>

令牌至少需要repo范围的权限才能访问私有仓库。对于公共仓库,具有public_repo范围的令牌就足够了。

错误处理

服务器实现标准错误处理:

  • 丢失或无效的令牌返回ErrorCode.AuthenticationError
  • 无效的存储库详细信息返回ErrorCode.InvalidParams
  • 不存在的 PR 返回ErrorCode.NotFound
  • 差异提取失败会返回格式化的错误消息
  • SIGINT 信号正常关闭

技术细节

  • 使用 Highlight AI MCP SDK 构建
  • 使用 GitHub REST API v3
  • 通过 Zod 进行输入验证
  • 作为基于 stdio 的 MCP 服务器运行
  • 支持 Node.js >=18.0.0

限制

  • 根据 GitHub API 限制应用速率限制
  • 根据 GitHub API 限制,较大的差异可能会被截断
  • 令牌需要适当的存储库访问权限
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

从 GitHub Pull Requests 中提取差异,允许用户检索和分析存储库中分支之间的更改。

  1. 可用工具
    1. 获取差异
  2. 验证
    1. 错误处理
      1. 技术细节
        1. 限制

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            Provides tools for mapping and analyzing GitHub repositories. It allows users to set a GitHub Personal Access Token and retrieve detailed information about a specified repository, including its structure and summary statistics.
            Last updated -
            2
            17
            TypeScript
          • -
            security
            F
            license
            -
            quality
            Enables interaction with GitHub through the GitHub API, supporting file operations, repository management, advanced search, and issue tracking with comprehensive error handling and automatic branch creation.
            Last updated -
            9
            1
            TypeScript
          • A
            security
            A
            license
            A
            quality
            A TypeScript server that analyzes GitHub Pull Requests using the Model-Controller-Presenter pattern.
            Last updated -
            1
            5
            TypeScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            Enables comprehensive GitHub operations through natural language including file management, repository administration, issue tracking, and advanced code searching.
            Last updated -
            22,573
            1
            TypeScript

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/highlight-ing/highlight-github-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server