# GitHub Enterprise MCP server

> Allows AI agents to govern GitHub Enterprise organizations, repositories, rulesets, security alerts, and Actions with built-in security guardrails.

- Repository: https://github.com/dockndevai/mcp-github-enterprise
- Page: https://hostedmcp.org/servers/dockndevai/mcp-github-enterprise
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'GHE_TOKEN=<YOUR_GHE_TOKEN>' mcp-github-enterprise -- npx -y @dockndevai/mcp-github-enterprise
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-github-enterprise": {
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-github-enterprise"
      ],
      "env": {
        "GHE_TOKEN": "<YOUR_GHE_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-github-enterprise": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-github-enterprise"
      ],
      "env": {
        "GHE_TOKEN": "<YOUR_GHE_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-github-enterprise","type":"stdio","command":"npx","args":["-y","@dockndevai/mcp-github-enterprise"],"env":{"GHE_TOKEN":"<YOUR_GHE_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-github-enterprise": {
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-github-enterprise"
      ],
      "env": {
        "GHE_TOKEN": "<YOUR_GHE_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-github-enterprise --env 'GHE_TOKEN=<YOUR_GHE_TOKEN>' -- npx -y @dockndevai/mcp-github-enterprise
```

### Codex config.toml (`~/.codex/config.toml`)

```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>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'GHE_TOKEN=<YOUR_GHE_TOKEN>' mcp-github-enterprise npx -- -y @dockndevai/mcp-github-enterprise
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-github-enterprise": {
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-github-enterprise"
      ],
      "env": {
        "GHE_TOKEN": "<YOUR_GHE_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GHE_TOKEN` | yes | yes | GitHub token (fine-grained PAT, classic PAT, or App installation token). Read-only scopes to start. |
| `GHE_API_URL` | no | no | API base URL. Cloud: https://api.github.com (default). Server/GHES: https://HOST/api/v3. |
| `GHE_ENTERPRISE` | no | no | Enterprise slug, for enterprise-level endpoints (audit log, Actions policy). Optional. |
| `GHE_MODE` | no | no | Access mode: read-only \| read-write \| admin. Start with read-only. |

## Tools (23)

- `whoami`: 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. (read-only)
- `get_rate_limit`: Report the current REST API rate-limit budget (core, search, graphql) and reset times. Use to pace bulk reads. (read-only)
- `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. (read-only)
- `get_organization`: Fetch an organization's full profile and security-relevant settings (2FA, base permission, secret scanning & Dependabot defaults). (read-only)
- `list_members`: List an organization's members, optionally filtered by role (admin = owners, member = everyone else). (read-only)
- `list_teams`: List an organization's teams with their slugs, privacy, and permissions. Use a team slug with the team tools. (read-only)
- `list_security_managers`: List the teams granted the organization's security-manager role (least-privilege security triage). (read-only)
- `list_repositories`: List an organization's repositories (name, visibility, default branch, archived), optionally filtered by type. (read-only)
- `get_repository`: Fetch a single repository including its security_and_analysis settings (secret scanning, push protection, advanced security). (read-only)
- `get_branch_protection`: Fetch the protection settings for a branch (required reviews, status checks, signatures, force-push rules). (read-only)
- `list_org_rulesets`: List the organization's rulesets (the modern, org-wide replacement for per-repo branch protection). (read-only)
- `list_webhooks`: List the organization's webhooks and their events. Webhook secrets are redacted and never returned. (read-only)
- `get_actions_permissions`: Fetch the organization's GitHub Actions policy (which repos may run Actions, and which actions are allowed). (read-only)
- `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. (read-only)
- `list_runner_groups`: List the organization's self-hosted runner groups and which repositories may use them (runner isolation). (read-only)
- `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. (read-only)
- `list_workflows`: List the Actions workflows defined in a repository (name, path, state). Starting point for pipeline optimization. (read-only)
- `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. (read-only)
- `list_code_scanning_alerts`: List the organization's code-scanning (CodeQL/SARIF) alerts with rule, severity, state, and location. (read-only)
- `list_dependabot_alerts`: List the organization's Dependabot (vulnerable dependency) alerts with package, severity, state, and the fixing version. (read-only)
- `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'. (read-only)
- `assess_org_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. (read-only)
- `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. (read-only)

## FAQ

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