Add auto-merge support to pull request tools

オープン
#2,411 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
github, go, graphql
領域
api, backend, tooling

調査の方向性

Start at the existing merge_pull_request tool and compare its pull request inputs with the GitHub GraphQL enablePullRequestAutoMerge mutation. Implement the proposed auto-merge operation with owner, repo, pullNumber, and mergeMethod handling; determine from the surrounding pull request tools whether disablePullRequestAutoMerge belongs in scope. Done means MCP clients can enable auto-merge without falling back to the gh CLI.

索引モデルが issue の本文から書いたものです。

説明

[!Note]
Responses generated with Claude

Describe the feature or problem you'd like to solve

There is no MCP equivalent for enabling auto-merge on a pull request (gh pr merge --auto --squash). This is a common workflow step after CI passes and approvals are in place.

Currently the only way to enable auto-merge via MCP clients is to fall back to gh CLI, which breaks the MCP-first workflow pattern and causes permission prompt friction in tools like Claude Code.

Proposed solution

Add an enable_auto_merge method (or similar) to the pull request write tools. The GitHub GraphQL API exposes the enablePullRequestAutoMerge mutation:

mutation($pullRequestId: ID!, $mergeMethod: PullRequestMergeMethod!) {
  enablePullRequestAutoMerge(input: {
    pullRequestId: $pullRequestId
    mergeMethod: $mergeMethod
  }) {
    pullRequest { autoMergeRequest { enabledAt mergeMethod } }
  }
}

Parameters:

  • owner (required): Repository owner
  • repo (required): Repository name
  • pullNumber (required): PR number
  • mergeMethod (optional): MERGE, SQUASH, or REBASE (default to repo setting)

A corresponding disablePullRequestAutoMerge mutation exists and could be included.

Example prompts or workflows
  1. "Enable auto-merge on PR #123 with squash"
  2. "Once CI passes, auto-merge this PR"
  3. "Set up auto-merge for all my approved PRs"
Additional context

The existing merge_pull_request tool handles immediate merges, but auto-merge is a distinct operation — it queues the merge to happen automatically once all required status checks and approvals are satisfied. This is particularly useful in CI-heavy repos where PRs can't be merged until checks complete.

主要言語
Go
スター
33.1k
フォーク
5k
平均マージ
2日 1時間
マージ済み PR(30日)
25

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/github-mcp-server のほかの issue

github/github-mcp-server の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。