Add support for 'merge pull request' #54

Closed
opened 2026-01-23 15:49:33 +00:00 by c6sepl6p · 4 comments
c6sepl6p commented 2026-01-23 15:49:33 +00:00 (Migrated from codeberg.org)

Thx for this great mcp tool!

It would be great if you could add the API endpoint that allows the AI to merge a pull request.
I think it should be /repos/{owner}/{repo}/pulls/{index}/merge

Thx for this great mcp tool! It would be great if you could add the API endpoint that allows the AI to merge a pull request. I think it should be `/repos/{owner}/{repo}/pulls/{index}/merge`
goern commented 2026-01-30 07:26:17 +00:00 (Migrated from codeberg.org)

Hi @c6sepl6p, thanks for the feature request!

I've started working on this. Here's the proposal — does this match what you had in mind?

Proposal: merge_pull_request MCP tool

What it does: Adds a new merge_pull_request tool that wraps the Forgejo API endpoint POST /repos/{owner}/{repo}/pulls/{index}/merge.

Exposed options:

  • Merge style (merge, squash, rebase)
  • Title and message for the merge commit
  • Delete branch after merge
  • Force merge (even if checks fail)
  • Merge when checks succeed (auto-merge)

Impact: Additive change only — no modifications to existing tools. The forgejo SDK already supports this endpoint, so it's straightforward to implement.

The full proposal is tracked in openspec/changes/merge-pull-request/proposal.md on the main branch.

Let me know if this covers your use case or if you'd want anything adjusted!

Hi @c6sepl6p, thanks for the feature request! I've started working on this. Here's the proposal — does this match what you had in mind? ## Proposal: `merge_pull_request` MCP tool **What it does:** Adds a new `merge_pull_request` tool that wraps the Forgejo API endpoint `POST /repos/{owner}/{repo}/pulls/{index}/merge`. **Exposed options:** - **Merge style** (merge, squash, rebase) - **Title** and **message** for the merge commit - **Delete branch after merge** - **Force merge** (even if checks fail) - **Merge when checks succeed** (auto-merge) **Impact:** Additive change only — no modifications to existing tools. The forgejo SDK already supports this endpoint, so it's straightforward to implement. The full proposal is tracked in `openspec/changes/merge-pull-request/proposal.md` on the `main` branch. Let me know if this covers your use case or if you'd want anything adjusted!
c6sepl6p commented 2026-01-30 16:02:10 +00:00 (Migrated from codeberg.org)

thx, i looked into the openspec/changes/merge-pull-request/proposal.md, looks good to me!

thx, i looked into the `openspec/changes/merge-pull-request/proposal.md`, looks good to me!
goern commented 2026-01-31 08:11:37 +00:00 (Migrated from codeberg.org)

merge_pull_request tool — now available

Hey @c6sepl6p, the merge_pull_request tool has been implemented. Here's a quick how-to:

Parameters

Parameter Required Description
owner yes Repository owner
repo yes Repository name
index yes PR number
style yes merge, rebase, rebase-merge, or squash
title no Custom merge commit title
message no Custom merge commit message
delete_branch_after_merge no Delete head branch after merge (default: false)
force_merge no Merge even if checks haven't passed (default: false)
merge_when_checks_succeed no Schedule merge for when all checks pass (default: false)

Examples

Simple merge:

{ "owner": "myorg", "repo": "myproject", "index": 42, "style": "merge" }

Squash with custom message and branch cleanup:

{
  "owner": "myorg", "repo": "myproject", "index": 42,
  "style": "squash",
  "title": "feat: add new feature",
  "message": "Detailed description of the change",
  "delete_branch_after_merge": true
}

Auto-merge when CI passes:

{
  "owner": "myorg", "repo": "myproject", "index": 42,
  "style": "merge",
  "merge_when_checks_succeed": true
}

Would you mind giving it a try and letting us know if it works for your use case? Available in the next release.

## `merge_pull_request` tool — now available Hey @c6sepl6p, the `merge_pull_request` tool has been implemented. Here's a quick how-to: ### Parameters | Parameter | Required | Description | |-----------|----------|-------------| | `owner` | yes | Repository owner | | `repo` | yes | Repository name | | `index` | yes | PR number | | `style` | yes | `merge`, `rebase`, `rebase-merge`, or `squash` | | `title` | no | Custom merge commit title | | `message` | no | Custom merge commit message | | `delete_branch_after_merge` | no | Delete head branch after merge (default: false) | | `force_merge` | no | Merge even if checks haven't passed (default: false) | | `merge_when_checks_succeed` | no | Schedule merge for when all checks pass (default: false) | ### Examples **Simple merge:** ```json { "owner": "myorg", "repo": "myproject", "index": 42, "style": "merge" } ``` **Squash with custom message and branch cleanup:** ```json { "owner": "myorg", "repo": "myproject", "index": 42, "style": "squash", "title": "feat: add new feature", "message": "Detailed description of the change", "delete_branch_after_merge": true } ``` **Auto-merge when CI passes:** ```json { "owner": "myorg", "repo": "myproject", "index": 42, "style": "merge", "merge_when_checks_succeed": true } ``` Would you mind giving it a try and letting us know if it works for your use case? Available in the next release.
c6sepl6p commented 2026-02-11 08:49:58 +00:00 (Migrated from codeberg.org)

Hey, didn't come to test it until now. Wanted to thank you for the great implementation!

Hey, didn't come to test it until now. Wanted to thank you for the great implementation!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp#54
No description provided.