Skip to main content
Glama
highlight-ing

GitHub Integration MCP Server

GitHub 集成

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

可用工具

获取差异

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

参数

  • owner :存储库所有者/组织名称

  • repo :存储库名称

  • pr_number :拉取请求编号

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

  • content :包含 PR diff 的字符串

Related MCP server: OSSInsight MCP Server

验证

必需:将 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

Latest Blog Posts

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