feat(repo): add rename_branch tool (#245)

Adds a native `rename_branch` write tool so MCP clients can rename branches without emulating it via create + delete.

Changes:
- Add `rename_branch` to the repository branch tools with `owner`, `repo`, `branch`, and `new_name` parameters.
- Call the Gitea SDK's `RenameRepoBranch` operation and propagate API errors.
- Add handler/registration tests and README tool table entries.

Closes https://gitea.com/gitea/gitea-mcp/issues/236

Assisted by Codet

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/245
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2026-08-24 23:36:48 +00:00
parent e2052d903f
commit 04931d48a3
5 changed files with 188 additions and 0 deletions
+1
View File
@@ -180,6 +180,7 @@ Once configured, try `list all my repositories` in the chat box.
| create_branch | branch | Write | Create a new branch |
| delete_branch | branch | Write | Delete a branch |
| list_branches | branch | Read | List repository branches |
| rename_branch | branch | Write | Rename a branch |
| create_tag | tag | Write | Create a tag |
| delete_tag | tag | Write | Delete a tag |
| get_tag | tag | Read | Get tag details |