Allows AI agents to govern GitHub Enterprise organizations, repositories, rulesets, security alerts, and Actions with built-in security guardrails.
Also known as dockndevai/mcp-github-enterprise, @dockndevai/mcp-github-enterprise
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- 558
- Latest version
- 0.1.1
- Last commit
- Nov 11, 2026
- License
- MIT
What is GitHub Enterprise MCP?
GitHub Enterprise allows AI agents to govern GitHub Enterprise organizations, repositories, rulesets, security alerts, and Actions with built-in security guardrails.
Summary generated from the project's README
About GitHub Enterprise MCP server
Managing GitHub Enterprise organizations and repositories through AI agents is made safer with this server. It provides a controlled way for agents to govern members, teams, rulesets, security alerts, and GitHub Actions while maintaining strict security guardrails. The server works with both GitHub Enterprise Cloud and GitHub Enterprise Server, requiring a fine-grained PAT, classic PAT, or App installation token to function.
Security is a core focus, as the server operates in a read-only mode by default and only exposes tools matching the active access level. Users can restrict the agent's reach using an organization allowlist or protect specific organizations from any mutations. Destructive operations like deleting a repository or removing a member require admin mode, an explicit delete flag, and human confirmation. The system also redacts sensitive information like webhook secrets before they reach the model and logs every operation to stderr for auditing purposes.
Beyond basic administration, the server includes specialized tools to evaluate and improve security. The assess_org_posture tool scores an organization against a baseline, while harden_org_settings can automatically apply fixes to strengthen settings.
What you can do with it
- 1Audit organization security postureAsk the AI to evaluate how well your GitHub organization follows security best practices.
- 2Automate security hardeningInstruct the agent to apply recommended security settings to an organization to fix vulnerabilities.
- 3Perform safe administrative tasksRequest the agent to add members or teams while ensuring destructive actions require human approval.
Written from the project's README. Every use case is checked against a quote from it.
How to install GitHub Enterprise MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall GitHub Enterprise MCP in Claude Code
$ claude mcp add --env 'GHE_TOKEN=<YOUR_GHE_TOKEN>' mcp-github-enterprise -- npx -y @dockndevai/mcp-github-enterpriseInstall GitHub Enterprise MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-github-enterprise": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-github-enterprise"
],
"env": {
"GHE_TOKEN": "<YOUR_GHE_TOKEN>"
}
}
}
}Install GitHub Enterprise MCP in VS Code
.vscode/mcp.json
{
"servers": {
"mcp-github-enterprise": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-github-enterprise"
],
"env": {
"GHE_TOKEN": "<YOUR_GHE_TOKEN>"
}
}
}
}Install GitHub Enterprise MCP in VS Code CLI
$ code --add-mcp '{"name":"mcp-github-enterprise","type":"stdio","command":"npx","args":["-y","@dockndevai/mcp-github-enterprise"],"env":{"GHE_TOKEN":"<YOUR_GHE_TOKEN>"}}'Install GitHub Enterprise MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp-github-enterprise": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-github-enterprise"
],
"env": {
"GHE_TOKEN": "<YOUR_GHE_TOKEN>"
}
}
}
}Install GitHub Enterprise MCP in Codex
$ codex mcp add mcp-github-enterprise --env 'GHE_TOKEN=<YOUR_GHE_TOKEN>' -- npx -y @dockndevai/mcp-github-enterpriseInstall GitHub Enterprise MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.mcp-github-enterprise] command = "npx" args = ["-y", "@dockndevai/mcp-github-enterprise"] [mcp_servers.mcp-github-enterprise.env] GHE_TOKEN = "<YOUR_GHE_TOKEN>"
Install GitHub Enterprise MCP in Gemini CLI
$ gemini mcp add -s user -e 'GHE_TOKEN=<YOUR_GHE_TOKEN>' mcp-github-enterprise npx -- -y @dockndevai/mcp-github-enterpriseInstall GitHub Enterprise MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"mcp-github-enterprise": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-github-enterprise"
],
"env": {
"GHE_TOKEN": "<YOUR_GHE_TOKEN>"
}
}
}
}Configuration
GHE_TOKENRequiredSecretGitHub token (fine-grained PAT, classic PAT, or App installation token). Read-only scopes to start.
GHE_API_URLAPI base URL. Cloud: https://api.github.com (default). Server/GHES: https://HOST/api/v3.
GHE_ENTERPRISEEnterprise slug, for enterprise-level endpoints (audit log, Actions policy). Optional.
GHE_MODEAccess mode: read-only | read-write | admin. Start with read-only.
| Name | Description | |
|---|---|---|
| GHE_TOKEN | GitHub token (fine-grained PAT, classic PAT, or App installation token). Read-only scopes to start. | RequiredSecret |
| GHE_API_URL | API base URL. Cloud: https://api.github.com (default). Server/GHES: https://HOST/api/v3. | |
| GHE_ENTERPRISE | Enterprise slug, for enterprise-level endpoints (audit log, Actions policy). Optional. | |
| GHE_MODE | Access mode: read-only | read-write | admin. Start with read-only. |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachabledockndevai/mcp-github-enterprise is public and reachablegithub.com/dockndevai/mcp-github-enterprise ↗Pass
- Package names this repository as its source@dockndevai/mcp-github-enterprise names dockndevai/mcp-github-enterprise as sourcenpmjs.com/package/@dockndevai/mcp-github-enterprise ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @dockndevai/mcp-github-enterprisenpmjs.com/package/@dockndevai/mcp-github-enterprise/v/0.1.1# ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-11github.com/dockndevai/mcp-github-enterprise ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @dockndevai/mcp-github-enterprisePass
- No critical advisory in the package or its dependencies99 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubmcp-github-enterprise
A safe-by-default Model Context Protocol server for administering GitHub Enterprise (Cloud & Server) from an AI agent — organizations, members, teams, repositories, rulesets, security alerts, and Actions — with a built-in security-posture baseline and governance controls so an agent can help run your enterprise without being able to wreck it.
Part of the dockndevai suite of governed infrastructure MCP servers. Read-only by default · org-scoped · audited · human-confirmed.
Why
Handing an agent an admin token to GitHub is risky: one loose instruction can delete a repo, remove a member, or flip an org public. This server puts the agent behind the same controls you'd give a junior admin:
- Read-only until you say otherwise. Tools above the current access mode are never advertised.
- Pinned blast radius. An org allowlist and protected (read-only-forever) orgs.
- Destructive ops double-gated. Admin mode + an explicit delete flag + a typed confirmation + a human prompt. The prompt shows the tool, the exact arguments and a fingerprint; the target's version is pinned across the prompt and the action is refused if it changed; a prompt nobody answers is a refusal.
- Secrets never leak. Webhook secrets and secret-scanning values are redacted before anything reaches the model.
- Everything audited. A JSON line per operation to stderr.
Plus the part that makes it useful, not just safe: it ships an opinionated security baseline — assess_org_posture scores a live org and harden_org_settings applies the fix — and two operator skills (secure setup + Actions optimization).
Quick start
# Read-only, against GitHub Enterprise Cloud
GHE_TOKEN=your-token GHE_MODE=read-only npx -y @dockndevai/mcp-github-enterprise
Add to Claude Code:
claude mcp add github-enterprise -e GHE_TOKEN="your-token" -e GHE_MODE="read-only" -- npx -y @dockndevai/mcp-github-enterprise
GitHub Enterprise Server: add -e GHE_API_URL="https://HOST/api/v3". Full client configs (Cursor, Windsurf, Codex, VS Code, Claude Desktop) in docs/CLIENTS.md.
First call to run: whoami — confirms the token and base URL are wired correctly.
Configuration
| Variable | Default | Purpose |
|---|---|---|
GHE_TOKEN |
— | Required. Fine-grained PAT, classic PAT, or App installation token. Least privilege. |
GHE_API_URL |
https://api.github.com |
Cloud default. GHES: https://HOST/api/v3. |
GHE_ENTERPRISE |
— | Enterprise slug, for enterprise-level audit log / policy. |
GHE_MODE |
read-only |
read-only → read-write → admin. |
GHE_ORG_ALLOWLIST |
(all visible) | Comma-separated orgs that may be touched. Pin this. |
GHE_PROTECTED_ORGS |
— | Orgs readable but never mutated. |
GHE_ALLOW_DELETE |
false |
Required (with admin mode) for any destructive op. |
GHE_REQUIRE_CONFIRMATION |
true |
Destructive ops need a typed confirmation matching the target. |
GHE_DRY_RUN |
false |
Validate + log writes without sending them. |
GHE_AUDIT_LOG |
true |
JSON audit line per op to stderr (also carries the approval receipts). |
| Interactive confirmation | (automatic) | — |
GHE_REQUIRE_HUMAN_APPROVAL |
false |
When true, destructive and high-impact ops are refused if the client cannot show an approval prompt (instead of falling back to the GHE_ALLOW_DELETE gate alone). |
GHE_MAX_PAGES |
10 |
Auto-pagination cap (pages of 100). |
GHE_GUARD_MODE |
off |
Optional laya-guard AI risk gate: monitor | enforce. |
See .env.example for the complete list.
Tools
Registered only up to the active mode: 23 in read-only, 32 in read-write, 38 in admin.
Read (always on)
whoami · get_rate_limit · list_organizations · get_organization · list_members · list_teams · list_security_managers · list_repositories · get_repository · get_branch_protection · list_org_rulesets · list_webhooks · get_actions_permissions · list_self_hosted_runners · list_runner_groups · get_actions_cache_usage · list_workflows · list_secret_scanning_alerts · list_code_scanning_alerts · list_dependabot_alerts · get_audit_log · assess_org_posture · recommend_enterprise_setup
Write (read-write+)
harden_org_settings · update_org_settings · set_actions_permissions · create_team · set_member_role · create_org_ruleset · protect_branch · update_repo_security · create_webhook
Human-approved before they write (when the client can prompt; refused without a prompt under GHE_REQUIRE_HUMAN_APPROVAL=true): harden_org_settings, update_org_settings, set_actions_permissions, create_org_ruleset, protect_branch, update_repo_security, create_webhook, and set_member_role when granting admin. The prompt shows what changes (current → new per field; for create_org_ruleset, the new ruleset next to the existing ones) and the approval is pinned to the state it was shown. Under GHE_DRY_RUN=true they return before any prompt. create_team is not prompted. set_actions_permissions sends GitHub's required enabled_repositories on every write (setting only allowed_actions keeps the current enabled_repositories, read from the org's live policy). protect_branch takes requiredStatusChecks (or its alias requireStatusChecks).
Admin (admin, destructive ones also need GHE_ALLOW_DELETE)
create_repository (a private repository is created without a prompt; public and internal ask a human first, and are refused under GHE_REQUIRE_HUMAN_APPROVAL=true when the client cannot prompt) · delete_repository · remove_member · delete_team · delete_org_ruleset · delete_webhook
Security posture baseline
assess_org_posture { org } scores an organization against a built-in baseline and returns per-control findings with a grade:
{
"org": "acme",
"summary": { "score": 60, "grade": "C", "passed": 6, "failed": 4, "high_failures": 2 },
"findings": [
{ "id": "push-protection", "severity": "high", "status": "fail",
"current": false, "recommended": true,
"rationale": "Blocks secrets at push time — the only control that prevents the leak…",
"remediation": "harden_org_settings, or update_org_settings { secret_scanning_push_protection_enabled_for_new_repositories: true }." }
]
}
Then harden_org_settings { org } applies the baseline (base read permission, secret scanning + push protection, Dependabot defaults, no public-repo creation, no private forks, commit sign-off) — preview-able with GHE_DRY_RUN=true. recommend_enterprise_setup returns the full enterprise → org → repo setup template.
2FA is reported by the assessor but must be enforced in the org/enterprise authentication UI — GitHub does not expose it as a REST toggle.
Skills
Two bundled Agent Skills in .claude/skills:
github-enterprise-admin— the operator playbook: least-privilege token setup, the secure-setup template, the org-policy baseline, and the guardrails for destructive work.github-actions-optimization— pipeline optimization strategy, a caching strategy (dependencies, Docker layers, cache limits), and self-hosted runners on Kubernetes with actions-runner-controller (ARC): GitHub App/PAT connection, autoscaling, caching across ephemeral pods, and runner isolation.
A third, mcp-suite-maintenance, documents how to safely extend this server.
Development
npm install
npm run typecheck && npm test && npm run build
npm run dev # watch mode
Architecture (shared across the suite): config.ts (env → typed config) · security.ts (pure policy engine, unit-tested) · github/client.ts (REST wrapper) · baseline.ts (pure posture assessor) · tools/{read,write,admin}.ts (capability-tagged). See SECURITY.md and PUBLISHING.md.
License
MIT © dockndevai
GitHub Enterprise MCP questions
How do I add GitHub Enterprise MCP to Claude Code?
Run claude mcp add --env 'GHE_TOKEN=<YOUR_GHE_TOKEN>' mcp-github-enterprise -- npx -y @dockndevai/mcp-github-enterprise in your terminal. Add --scope user to make it available in every project.
How do I add GitHub Enterprise MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How does the server prevent accidental destructive actions?
It uses a multi-layered approach including read-only by default mode, an organization allowlist, and destructive operations that require an explicit delete flag, a typed confirmation, and a human prompt.
Can the server help improve my organization's security?
Yes, it includes a security posture baseline tool that scores your organization and a hardening tool to apply recommended security settings.
Is my sensitive data protected from the AI model?
Yes, the server redacts webhook secrets and secret-scanning values before they are sent to the model.
How do I verify my connection is working?
You can run the whoami tool as your first call to confirm the token and base URL are correctly configured.