GitHub 企业版 MCP(管理控制平面)代理是用于与 GitHub 企业版服务交互的接口。借助此代理,可在 Cursor 的 AI 聊天中直接使用 GitHub 企业版的功能,为开发者提供更便捷的操作体验。
npm install mcp-github-enterprise
node index.js
该代理可作为接口,实现与 GitHub 企业版服务的交互,让用户能在 Cursor 的 AI 聊天中直接使用 GitHub 企业版的各项功能。
访问 Node.js 官方网站,下载并安装适配您操作系统的版本。
执行以下命令:
npm install mcp-github-enterprise
运行以下命令启动服务:
node index.js
在 Cursor 的 AI 聊天中直接调用以下函数即可实现各种 GitHub 企业版操作:
mcp_github_enterprise_list_repositories(owner="octocat")
mcp_github_enterprise_get_repository(owner="octocat", repo="hello-world")
mcp_github_enterprise_list_pull_requests(owner="octocat", repo="hello-world", state="open")
// 列举问题
mcp_github_enterprise_list_issues(owner="octocat", repo="hello-world", state="all")
// 获取问题详情
mcp_github_enterprise_get_issue(owner="octocat", repo="hello-world", issue_number=1)
// 获取问题/PR评论
mcp_github_enterprise_list_issue_comments(owner="octocat", repo="hello-world", issue_number=1)
// 创建新问题
mcp_github_enterprise_create_issue(
owner="octocat",
repo="hello-world",
title="发现一个bug",
body="这是一个关于该bug的描述",
labels=["bug", "重要"]
)
mcp_github_enterprise_get_content(owner="octocat", repo="hello-world", path="README.md")
# 创建新仓库
mcp_github_enterprise_create_repository(
name="new-project",
description="这是一个新的项目",
private=true,
auto_init=true
)
# 更新仓库描述
mcp_github_enterprise_update_repository(
owner="octocat",
repo="hello-world",
description="更新后的描述",
has_issues=true
)
这些功能专为 GitHub 企业版环境设计,需要具备管理员权限:
# 列举所有用户
mcp_github_enterprise_list_users(filter="active", per_page=100)
# 获取特定用户的详情
mcp_github_enterprise_get_user(username="octocat")
# 创建新用户(仅限企业版)
mcp_github_enterprise_create_user(
login="newuser",
email="newuser@example.com",
name="新用户",
company="ACME 公司"
)
# 更新用户信息(仅限企业版)
mcp_github_enterprise_update_user(
username="octocat",