Home / Servers / GitHub API / repos_rename_branch
Rename a branch
An MCP tool from the GitHub API server, hosted on mcp.hjlabs.in.
Rename a branch Renames a branch in a repository. > [!NOTE] > Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to… [POST /repos/{owner}/{repo}/branches/{branch}/rename]
Name on the gateway: github_api__repos_rename_branch · 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… |
new_name required | string | The new name of the branch. |
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_rename_branch",
"arguments": {
"owner": "…",
"repo": "…",
"branch": "…",
"new_name": "…"
}
}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 rename a branch tool with owner set to ….