Mcp Github Enterprise

io.github.dockndevai由 GitHub 帳號 dockndevai 發布v0.1.1更新於 Nov 7, 2026

Govern GitHub Enterprise orgs, repos, rulesets, security alerts & Actions for AI agents.

概覽

AI 產生的概覽

預設唯讀的 MCP 伺服器,讓 AI 助理管理 GitHub Enterprise(Cloud 與 Server)的組織、儲存庫、規則集、安全警示與 Actions。

可以做什麼
  • 驗證權杖身分與 API 速率限制,列出組織、成員、團隊與安全管理員
  • 檢視儲存庫、分支保護、組織規則集、Webhook,以及 Actions 政策、執行器、執行器群組、快取用量與工作流程
  • 查閱機密掃描、程式碼掃描與 Dependabot 警示,讀取組織或企業層級的稽核日誌事件
  • 依內建安全基準為組織評分,並提供分階段的企業設定範本
  • 在更高模式下套用組織設定、建立團隊與規則集、保護分支、更新儲存庫安全設定、建立 Webhook;admin 模式還可刪除儲存庫、成員、團隊、規則集與 Webhook
適用情境
適合讓助理在沒有寫入權限的情況下稽核或彙報 GitHub Enterprise 組織的安全態勢、CI 設定與待處理警示。也適合希望以受控、依模式開放的方式管理組織設定與儲存庫,而不是把原始管理員權杖交給助理的團隊。
執行需求
透過 npx 從 npm 套件在本機執行,需要 Node.js。需在 GHE_TOKEN 提供 GitHub 權杖(細粒度 PAT、傳統 PAT 或 App 安裝權杖)。GHE_API_URL 預設指向 GitHub Cloud API,Enterprise Server 需改為該主機的 API 路徑;GHE_ENTERPRISE 為選用,用於企業層級端點。GHE_MODE 預設唯讀;允許清單、受保護組織、刪除、確認、試執行與稽核等設定皆為選用。
安裝前請注意
此權杖具備實際管理權限,應採最小權限並從唯讀模式開始。讀寫與 admin 模式可變更組織設定、分支保護、規則集、Webhook 與儲存庫安全設定,admin 模式還能刪除儲存庫、團隊、成員、規則集與 Webhook;破壞性操作受 GHE_ALLOW_DELETE 與輸入式確認雙重把關。企業的稽核日誌與警示資料會傳送給模型供應商;Webhook 密鑰與機密掃描值會被遮蔽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Github Enterprise,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-github-enterprise

[CI] [npm] [License: MIT]

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.
  • 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

bash
# Read-only, against GitHub Enterprise CloudGHE_TOKEN=your-token GHE_MODE=read-only npx -y @dockndevai/mcp-github-enterprise

Add to Claude Code:

bash
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

VariableDefaultPurpose
GHE_TOKEN—Required. Fine-grained PAT, classic PAT, or App installation token. Least privilege.
GHE_API_URLhttps://api.github.comCloud default. GHES: https://HOST/api/v3.
GHE_ENTERPRISE—Enterprise slug, for enterprise-level audit log / policy.
GHE_MODEread-onlyread-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_DELETEfalseRequired (with admin mode) for any destructive op.
GHE_REQUIRE_CONFIRMATIONtrueDestructive ops need a typed confirmation matching the target.
GHE_DRY_RUNfalseValidate + log writes without sending them.
GHE_AUDIT_LOGtrueJSON audit line per op to stderr.
GHE_MAX_PAGES10Auto-pagination cap (pages of 100).
GHE_GUARD_MODEoffOptional 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

Admin (admin, destructive ones also need GHE_ALLOW_DELETE)

create_repository · 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:

jsonc
{  "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

bash
npm installnpm run typecheck && npm test && npm run buildnpm 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

來源:README.md,提交 89ab430

工具

23

whoami

Who am I

Return the identity behind the configured GHE_TOKEN (login, type, and whether it is a user or an app). Use this first to confirm the token and base URL are wired correctly before anything else.

無需輸入參數。

get_rate_limit

Get API rate limit

Report the current REST API rate-limit budget (core, search, graphql) and reset times. Use to pace bulk reads.

無需輸入參數。

list_organizations

List organizations

List the organizations the token can see (filtered by GHE_ORG_ALLOWLIST), each flagged if it is protected (readable but never mutated). Start here to discover valid org logins.

無需輸入參數。

get_organization

Get organization

Fetch an organization's full profile and security-relevant settings (2FA, base permission, secret scanning & Dependabot defaults).

輸入參數org必填

list_members

List organization members

List an organization's members, optionally filtered by role (admin = owners, member = everyone else).

輸入參數org必填role

list_teams

List teams

List an organization's teams with their slugs, privacy, and permissions. Use a team slug with the team tools.

輸入參數org必填

list_security_managers

List security managers

List the teams granted the organization's security-manager role (least-privilege security triage).

輸入參數org必填

list_repositories

List repositories

List an organization's repositories (name, visibility, default branch, archived), optionally filtered by type.

輸入參數org必填type

get_repository

Get repository

Fetch a single repository including its security_and_analysis settings (secret scanning, push protection, advanced security).

輸入參數org必填repo必填

get_branch_protection

Get branch protection

Fetch the protection settings for a branch (required reviews, status checks, signatures, force-push rules).

輸入參數org必填repo必填branch必填

list_org_rulesets

List organization rulesets

List the organization's rulesets (the modern, org-wide replacement for per-repo branch protection).

輸入參數org必填

list_webhooks

List organization webhooks

List the organization's webhooks and their events. Webhook secrets are redacted and never returned.

輸入參數org必填

get_actions_permissions

Get Actions permissions

Fetch the organization's GitHub Actions policy (which repos may run Actions, and which actions are allowed).

輸入參數org必填

list_self_hosted_runners

List self-hosted runners

List the organization's self-hosted Actions runners (name, status, labels, busy). Use with runner groups to audit where CI executes — e.g. Kubernetes runners managed by actions-runner-controller.

輸入參數org必填

list_runner_groups

List runner groups

List the organization's self-hosted runner groups and which repositories may use them (runner isolation).

輸入參數org必填

get_actions_cache_usage

Get Actions cache usage

Report GitHub Actions cache usage — org-wide, or for one repository. Use to spot caches near the 10 GB/repo limit and to size a caching strategy for faster pipelines.

輸入參數org必填repo

list_workflows

List workflows

List the Actions workflows defined in a repository (name, path, state). Starting point for pipeline optimization.

輸入參數org必填repo必填

list_secret_scanning_alerts

List secret-scanning alerts

List the organization's secret-scanning alerts (type, state, repo, location). The matched secret value itself is dropped and never returned.

輸入參數org必填state

list_code_scanning_alerts

List code-scanning alerts

List the organization's code-scanning (CodeQL/SARIF) alerts with rule, severity, state, and location.

輸入參數org必填state

list_dependabot_alerts

List Dependabot alerts

List the organization's Dependabot (vulnerable dependency) alerts with package, severity, state, and the fixing version.

輸入參數org必填state

get_audit_log

Get audit log

Fetch recent audit-log events for the organization (or the enterprise, when GHE_ENTERPRISE is set), optionally filtered by a search phrase like 'action:repo.destroy' or 'actor:octocat'.

輸入參數org必填scopephraseperPage

assess_org_posture

Assess org security posture

Score an organization against the built-in security baseline (2FA, base permission, secret scanning + push protection, Dependabot, Actions policy). Returns per-control findings (pass/fail/unknown with severity and the exact remediation tool) plus a summary grade. Read-only — it changes nothing; apply fixes with harden_org_settings.

輸入參數org必填

recommend_enterprise_setup

Recommend enterprise setup

Return the staged secure-setup template for a GitHub Enterprise — enterprise, organization, and repository level controls with the rationale for each, plus the exact org-settings baseline that harden_org_settings applies. Pure guidance; use assess_org_posture to measure a specific org against it.

無需輸入參數。

版本歷史

1
  1. v0.1.1最新Nov 6, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分