Back to MCP directory
publicPublicdnsLocal runtime

github-mcp-bridge

一个基于MCP协议的GitHub企业版数据查询服务,允许AI代理通过API安全获取企业许可证使用情况、用户权限等数据,支持双传输模式与Kubernetes部署。

article

README

🚀 MCP GITHUB 企业版 🌉

MCP GITHUB 企业版是一个模型上下文协议(MCP)服务器,它允许 AI 代理(如 Claude、ChatGPT 等)查询你的 GitHub 企业版许可数据。通过 /consumed-licenses 端点,用户可以安全地获取许可摘要、用户详细信息、组织成员资格和企业角色等内容。

🚀 快速开始

克隆仓库

git clone https://github.com/yourusername/mcp-github.git
cd mcp-github

安装依赖

pip install -r requirements.txt

配置环境变量

export GITHUB_TOKEN="你的GitHub令牌"

运行服务器

python server.py

访问 API

curl http://localhost:8000/consumed-licenses

✨ 主要特性

功能与示例提示

  • 许可摘要"显示我们 GitHub 企业的许可摘要""我们现在有多少个许可证在使用?"

  • 详细许可使用情况"列出所有使用的 GitHub 许可证""是否有未使用的 GitHub 许可证?"

  • 用户查找"johndoe 属于哪些 GitHub 组织?""johndoe 在企业中有哪些角色?""获取 johndoe 的详细信息"

功能特点

| 工具 | 描述 | |------|------| | list_consumed_licenses | 汇总许可,可选包含用户信息 | | get_user_organizations | 列出用户的 GitHub 组织成员资格 | | get_user_enterprise_roles | 列出用户的企业角色 | | get_user_detail | 用户的完整许可详细信息 |

📦 安装指南

克隆仓库

git clone https://github.com/yourusername/mcp-github.git
cd mcp-github

安装依赖

pip install -r requirements.txt

配置环境变量

export GITHUB_TOKEN="你的GitHub令牌"

运行服务器

python server.py

访问 API

curl http://localhost:8000/consumed-licenses

🔧 技术细节

安全注意事项

  • 安全地存储你的 GitHub 令牌
  • 使用适当的权限范围为你的 GitHub 令牌
  • 考虑在生产环境中使用 AWS 密码管理器等工具
  • 在 Kubernetes 部署中实施网络策略

贡献指南

欢迎贡献!请随意提交拉取请求。

  1. 叉仓库
git clone https://github.com/yourusername/mcp-github.git
cd mcp-github
  1. 创建功能分支
git checkout -b feature/amazing-feature
  1. 提交更改
git commit -m '添加一些很棒的功能'
  1. 推送到仓库
git push origin feature/amazing-feature
  1. 创建拉取请求

📄 许可证

此项目根据 MIT 许可证发布,具体内容请参阅 LICENSE 文件。

致谢

感谢以下项目的贡献:


为 AI ↔️ GitHub 企业版集成打造的匠心之作。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client