Home / Servers / GitHub API / repos_update_branch_protection
Update branch protection
An MCP tool from the GitHub API server, hosted on mcp.hjlabs.in.
Update branch protection Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise… [PUT /repos/{owner}/{repo}/branches/{branch}/protection]
Name on the gateway: github_api__repos_update_branch_protection · may change things.
Parameters
| Name | Type | Description |
|---|---|---|
owner required | string | The account owner of the repository. The name is not case… |
repo required | string | The name of the repository without the .git extension. The… |
branch required | string | The name of the branch. Cannot contain wildcard… |
required_status_checks required | object | Require status checks to pass before merging. Set to null to disable. |
enforce_admins required | boolean | Enforce all configured restrictions for administrators. Set to true to enforce… |
required_pull_request_reviews required | object | Require at least one approving review on a pull request, before merging. Set… |
restrictions required | object | Restrict who can push to the protected branch. User, app, and team… |
required_linear_history | boolean | Enforces a linear commit Git history, which prevents anyone from pushing merge… |
allow_force_pushes | boolean | Permits force pushes to the protected branch by anyone with write access to… |
allow_deletions | boolean | Allows deletion of the protected branch by anyone with write access to the… |
block_creations | boolean | If set to true, the restrictions branch protection settings which limits who… |
required_conversation_resolution | boolean | Requires all conversations on code to be resolved before a pull request can be… |
lock_branch | boolean | Whether to set the branch as read-only. If this is true, users will not be… |
allow_fork_syncing | boolean | Whether users can pull changes from upstream when the branch is locked. Set to… |
How to call it
Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:
{
"name": "github_api__repos_update_branch_protection",
"arguments": {
"owner": "…",
"repo": "…",
"branch": "…",
"required_status_checks": "…",
"enforce_admins": true,
"required_pull_request_reviews": "…",
"restrictions": "…"
}
}Or connect the GitHub API server directly, which lists 1,221 tools including this one:
claude mcp add --transport http hj-github-api https://mcp.hjlabs.in/mcp/github-api \
--header "Authorization: Bearer YOUR_API_KEY"Try asking
Use the update branch protection tool with owner set to ….