feat: pr_merge tool — closes code workflow gap for claude.ai sessions #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add
pr_mergetool to allow merging pull requests from claude.ai sessions via gitea-mcp.This is the critical missing piece for a complete code workflow from claude.ai without
needing GitHub or a local terminal.
Why this is now P0
With the ADR decision (infra #34) that Gitea is true master and GitHub is optional,
the tooling gap on the Gitea side must be closed. Today, claude.ai can:
✅ Read files, list repos, browse code
✅ Write files, create branches
✅ Create issues, comment on issues
✅ Create PRs (pr_create)
❌ Merge PRs — missing, blocks completing any code change from claude.ai
Without pr_merge, every code change started from claude.ai must be completed
in a terminal or web UI. That breaks the workflow.
Gitea API
POST /api/v1/repos/{owner}/{repo}/pulls/{index}/mergeBody:
Merge styles:
merge,rebase,rebase-merge,squash,fast-forward-onlyTool spec
Required token permission
write:repositoryscope — same as existing write tools.Risk classification
MEDIUM — merging is reversible via revert, but has real consequences.
No confirm param needed (unlike repo_delete) but tool description should be explicit.
Implementation notes
internal/tools/delete_branch: trueby default (consistent with TBD convention)Also fix: pr_files_diff loop bug already resolved
Note: pr_files_diff bug (#25) was already fixed in v0.2. pr_merge is the last
missing tool for a complete PR workflow from claude.ai.
Acceptance criteria
task checkpassespr_mergeregistered in mainPart of
gitea-mcp v0.3 batch alongside:
Already shipped.
pr_mergetool landed in commit284d5e1(feat(tools): pr_merge). I used it from this session — see the merges of e.g. infra commits earlier today, which all went through the corresponding workflow.Verification:
Closes.