# github_set_branch_protection

A write tool on the Github MCP server.

Agent View of the PolicyLayer registry record for `github_set_branch_protection`. HTML page: https://policylayer.com/tools/dkeeno-github-mcp-server/github-set-branch-protection

## Facts

- Tool: `github_set_branch_protection`
- Server: Github (`dkeeno/github-mcp-server`) — https://policylayer.com/tools/dkeeno-github-mcp-server.md
- Homepage: https://github.com/dkeeno/github-mcp-server
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "github_set_branch_protection",
    "arguments": {}
  }
}
```

## Why github_set_branch_protection is rated Medium

Setting branch protection rules modifies repository configuration in a reversible manner (rules can be changed or removed later). This is a Write operation because it creates or modifies repository settings. Severity is high because misconfiguring branch protection could weaken security controls, prevent legitimate merges, or lock out development workflows, affecting repository operations significantly.

From the tool's own definition: "Tool name 'github_set_branch_protection' indicates modification of repository branch protection settings. Server description mentions 'repository management' and the context of related tools (archive_repo, audit_repo, batch_commit, workflow operations)…"

## Use case

AI agents use github_set_branch_protection to create or update resources in Github, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Github environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Github:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "github_set_branch_protection": {
      "limits": [
        {
          "counter": "github_set_branch_protection_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Github (68)

- `github_delete_repo` — Destructive — https://policylayer.com/tools/dkeeno-github-mcp-server/github-delete-repo.md
- `github_delete_secret` — Destructive — https://policylayer.com/tools/dkeeno-github-mcp-server/github-delete-secret.md
- `github_remove_branch_protection` — Destructive — https://policylayer.com/tools/dkeeno-github-mcp-server/github-remove-branch-protection.md
- `github_cancel_workflow_run` — Execute — https://policylayer.com/tools/dkeeno-github-mcp-server/github-cancel-workflow-run.md
- `github_rerun_workflow` — Execute — https://policylayer.com/tools/dkeeno-github-mcp-server/github-rerun-workflow.md
- `github_trigger_workflow` — Execute — https://policylayer.com/tools/dkeeno-github-mcp-server/github-trigger-workflow.md
- `github_transfer_repo` — Financial — https://policylayer.com/tools/dkeeno-github-mcp-server/github-transfer-repo.md
- `github_analyze_workflow_failure` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-analyze-workflow-failure.md
- `github_audit_repo` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-audit-repo.md
- `github_check_token_scopes` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-check-token-scopes.md
- `github_get_branch_protection` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-branch-protection.md
- `github_get_file` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-file.md
- `github_get_issue` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-issue.md
- `github_get_pr` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-pr.md
- `github_get_profile_stats` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-profile-stats.md
- `github_get_repo` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-repo.md
- `github_get_repo_stats` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-repo-stats.md
- `github_get_traffic` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-traffic.md
- `github_get_user` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-user.md
- `github_get_workflow_logs` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-workflow-logs.md
- `github_get_workflow_run` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-get-workflow-run.md
- `github_list_issues` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-issues.md
- `github_list_prs` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-prs.md
- `github_list_releases` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-releases.md
- `github_list_repos` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-repos.md
- `github_list_secrets` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-secrets.md
- `github_list_security_alerts` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-security-alerts.md
- `github_list_stargazers` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-stargazers.md
- `github_list_variables` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-variables.md
- `github_list_workflow_runs` — Read — https://policylayer.com/tools/dkeeno-github-mcp-server/github-list-workflow-runs.md
- …and 38 more: https://policylayer.com/tools/dkeeno-github-mcp-server.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=dkeeno-github-mcp-server · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dkeeno-github-mcp-server
