Github Enterprise Mcp

Github Enterprise Mcp

🚀 GitHub 企业版 MCP 服务器文档

GitHub 企业版 MCP(管理控制台协议)服务器是一款强大的工具,它能让你通过 Cursor 的 AI 聊天功能,直接与 GitHub 企业版实例进行交互。借助该工具,你可以轻松实现仓库管理、代码审查、问题跟踪等多种 GitHub 企业版功能。

🚀 快速开始

在使用 GitHub 企业版 MCP 服务器之前,你需要完成安装和配置工作。以下是详细的操作步骤:

  1. 下载服务器:从 GitHub 仓库 下载最新版本的服务器。
  2. 环境变量配置:设置必要的环境变量,示例如下:
    export GHE_HOST=your-enterprise-host.com
    export GHE_PORT=443
    export GITHUB_TOKEN=your PAT token
    
  3. 启动服务器:使用以下命令启动服务器:
    npm start --prefix path/to/mcp-server
    

📦 安装指南

环境变量和命令行参数

  • 环境变量
    • GHE_HOST:GitHub 企业版实例的主机名。
    • GHE_PORT:GitHub 企业版实例使用的端口,默认为 443。
    • GITHUB_TOKEN:用于身份验证的个人访问令牌(PAT)。
  • 命令行参数
    • --host:自定义服务器绑定地址,例如 --host 0.0.0.0
    • --port:自定义服务器端口,例如 --port 3000
    • --config:指定配置文件路径,例如 --config ./config.json

💻 使用示例

在 Cursor 中使用工具

以下是在 Cursor 的 AI 聊天中使用 GitHub 企业版工具的具体示例:

基础用法
// 列出仓库
mcp_github_enterprise_列出仓库(owner="octocat")

// 获取仓库信息
mcp_github_enterprise_获取仓库(owner="octocat", repo="hello-world")

// 列出拉取请求
mcp_github_enterprise_列出拉取请求(owner="octocat", repo="hello-world", state="open")

// 管理问题
// 列出问题
mcp_github_enterprise_列出问题(owner="octocat", repo="hello-world", state="all")
// 获取问题详情
mcp_github_enterprise_获取问题(owner="octocat", repo="hello-world", issue_number=1)
// 获取问题/拉取请求评论
mcp_github_enterprise_列出问题评论(owner="octocat", repo="hello-world", issue_number=1)

// 创建新问题
mcp_github_enterprise_创建问题(
owner="octocat",
repo="hello-world",
title="发现了一个错误",
body="这里是对错误的描述",
labels=["bug", "important"]
)

// 操作仓库内容
mcp_github_enterprise_获取内容(owner="octocat", repo="hello-world", 路径="README.md")

// 管理仓库设置
// 创建新仓库
mcp_github_enterprise_创建仓库(
name="new-project",
description="这是一个新项目",
private=true,
auto_init=true
)
// 更新仓库设置
mcp_github_enterprise_更新仓库(
owner="octocat",
repo="hello-world",
description="更新后的描述",
has_issues=true
)
高级用法
// 设置仓库策略
mcp_github_enterprise_设置仓库策略(
owner="octocat",
repo="hello-world",
required_linear_history=true,
required_signatures=true
)

✨ 主要特性

GitHub 企业版 MCP 服务器支持以下企业级功能:

  • 代码审查
  • 依赖管理
  • 安全扫描
  • 存储库策略

⚠️ 注意事项

  1. 权限要求:所有企业级功能都需要有效的个人访问令牌(PAT),部分功能还需要站点管理员权限。
  2. 错误处理:如果出现任何错误,请检查日志文件并确保令牌权限正确。
  3. 性能优化:建议在高负载情况下使用反向代理和负载均衡器。

🤝 贡献指南

  1. 问题报告:发现问题请提交到 GitHub 仓库 的问题部分。
  2. 代码贡献:Fork 仓库并在您的分支上进行修改,然后创建 Pull Request。
  3. 反馈:欢迎通过邮件或 GitHub 贡献您的意见和建议。

📄 许可证

GitHub 企业版 MCP 服务器遵循 MIT 许可证,允许个人和商业用途。

  • 0 关注
  • 0 收藏,8 浏览
  • system 提出于 2025-09-27 05:15

相似服务问题