Skip to main content
Glama

MCP GITHUB 企业版🌉

Python >=3.9
MCP 协议
GitHub API

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


📊 功能和示例提示

  • 许可证摘要
    "Show me our GitHub Enterprise license summary"
    "How many licenses are we currently using?"

  • 许可证使用详情
    "List all consumed GitHub licenses"
    "Do we have any unused GitHub licenses?"

  • 用户查找
    "What GitHub orgs does johndoe belong to?"
    "What enterprise roles does johndoe have?"
    "Is johndoe an owner in our enterprise?"
    "Get detailed info about johndoe"
    "Does johndoe have 2FA enabled?"


Related MCP server: GitHub MCP Server

🌟 功能

  • 许可证分析:总席位与已消耗席位

  • 用户查找:组织成员资格、角色、2FA、SAML ID

  • 分页:自动处理大型企业

  • 双传输:stdio 用于直接 MCP,SSE 用于 HTTP

  • Kubernetes-Ready :在 EKS/GKE 或任何 K8s 集群上部署


📋 先决条件

  • Python 3.9+

  • 带有read:enterprise / 许可证范围的 GitHub PAT

  • GitHub Enterprise Cloud 租户


🚀 快速入门

1. 克隆并安装

git clone https://github.com/vipink1203/mcp-github-enterprise.git cd mcp-github-enterprise python -m venv .venv source .venv/bin/activate pip install -r requirements.txt

2.配置

cp .env.example .env # Edit .env: set GITHUB_TOKEN and GITHUB_ENTERPRISE_URL

3. 运行

标准输入输出传输

export TRANSPORT=stdio python main.py

SSE 运输

export TRANSPORT=sse PORT=8050 python main.py

🐳 Docker 和 n8n

将此服务与 n8n 一起添加到您的 docker-compose.yml 中:

services: github-mcp: image: ghcr.io/vipink1203/mcp-github-enterprise:latest environment: - GITHUB_TOKEN=${GITHUB_TOKEN} - GITHUB_ENTERPRISE_URL=${GITHUB_ENTERPRISE_URL} - TRANSPORT=sse - PORT=8050 ports: - "8050:8050" restart: unless-stopped networks: - n8n-network

在 n8n 的 UI 中,启用 MCP 客户端:

🔌 客户端配置

Claude Desktop / 风帆冲浪 / 光标

将此配置添加到您的 Claude Desktop 设置中:

{ "mcpServers": { "github-ent": { "command": "/path/to/your/venv/python", "args": ["/path/to/main.py"], "env": { "GITHUB_TOKEN": "", "GITHUB_ENTERPRISE_URL": "https://api.github.com/enterprises/{enterprise_name}", "TRANSPORT": "stdio" } } }

SSE配置

{ "mcpServers": { "github": { "transport": "sse", "url": "http://localhost:8050/sse" } } }

📊 示例用例

  • 企业用户管理:自动化用户入职和离职

  • 许可证监控:许可证即将到期时收到警报

  • 组织分析:分析组织结构和关系

  • 用户访问审计:跟踪用户权限和访问级别

  • 人工智能驱动的 GitHub Insights :让人工智能分析你的企业 GitHub 数据

🔌 MCP 工具和资源

工具

姓名

描述

list_consumed_licenses

总结许可证,可选择包括用户

get_user_organizations

列出用户的 GitHub 组织会员资格

get_user_enterprise_roles

列出用户的企业角色

get_user_detail

用户的完整许可证详细信息

资源

URI

描述

github://consumed-licenses/{dummy}

完整许可证使用情况 + 用户详细信息

github://user/{username}/roles

用户的组织和企业角色

🔒 安全注意事项

  • 安全存储你的 GitHub 令牌

  • 为你的 GitHub 令牌使用适当的范围

  • 对于生产环境,请考虑使用 AWS Secrets Manager 或类似产品

  • 在 Kubernetes 部署中实施网络策略

🤝 贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature

  3. 提交您的更改( git commit -m 'Add some amazing feature'

  4. 推送到分支( git push origin feature/amazing-feature

  5. 打开拉取请求

📜 许可证

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

🙏 致谢


采用❤️构建,实现无缝 AI ↔️ GitHub Enterprise 集成。

-
security - not tested
A
license - permissive license
-
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/vipink1203/github-mcp-bridge'

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