You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the set of tools listed, I can see 'create branch' and 'delete file' tools but not 'delete branch'. Is this intentionally excluded?
Is it in the roadmap to add the tool with some guardrails like only allow deleting unprotected branches or branches created by the MCP server tool?
Appreciate any inputs.
Hello I'd like to pick this up. I've implemented a delete_branch tool following the same pattern as the existing create_branch, with the guardrail suggested above: it fetches the branch first and refuses to delete protected branches, returning a clear error to the model instead of attempting the deletion.
The Behavior:
Required params: owner, repo, branch
Checks branch protection via GET /repos/{owner}/{repo}/branches/{branch} before deleting
Deletes via DELETE /repos/{owner}/{repo}/git/refs/heads/{branch}
ReadOnlyHint: false, scoped to repo
Tests cover success, protected-branch refusal, branch-not-found, and delete-failure cases. Happy to adjust the guardrail scope (e.g. also blocking the default branch) based on maintainer preference. Opening a PR shortly.
Activity
bfedorov-clgx commentedon Apr 23, 2026
hello team!
I agree with colleague, it's highy necessary feature. Please add delete_branch tool.
nmime commentedon Jun 1, 2026
Can it be added?
huzaifa678 commentedon Jun 28, 2026
Hello I'd like to pick this up. I've implemented a delete_branch tool following the same pattern as the existing create_branch, with the guardrail suggested above: it fetches the branch first and refuses to delete protected branches, returning a clear error to the model instead of attempting the deletion.
The Behavior:
Required params: owner, repo, branch
Checks branch protection via GET /repos/{owner}/{repo}/branches/{branch} before deleting
Deletes via DELETE /repos/{owner}/{repo}/git/refs/heads/{branch}
ReadOnlyHint: false, scoped to repo
Tests cover success, protected-branch refusal, branch-not-found, and delete-failure cases. Happy to adjust the guardrail scope (e.g. also blocking the default branch) based on maintainer preference. Opening a PR shortly.