Add merge queue support to pull request tools (enqueue, dequeue, queue status)

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

メンテナーはふだん 2 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, graphql

調査の方向性

Start by reading the existing pull request tool definitions and their GraphQL request patterns, then check how pull_request_read exposes PR data. Implement the two queue mutations and the status read using the fields listed in the issue. Done means all three operations return the specified queue data, including a clean null when no queue exists; the issue does not name specific files or tests.

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

説明

enhancement tool-proposal
Describe the feature or problem you'd like to solve

There is no way to interact with a branch's merge queue through the MCP server.

merge_pull_request calls the REST merge endpoint. On a base branch protected by a merge queue ruleset, GitHub rejects that call: the only supported path is to enqueue the pull request and let the queue merge it. Today an MCP client has to fall back to gh pr merge --auto or raw GraphQL for that step, which breaks the MCP-first workflow.

This request is intentionally separate from auto-merge (#2411). Auto-merge is a per-PR flag that merges once requirements pass. A merge queue is a branch-level mechanism with its own queue entries, ordering, and state. They use different GraphQL mutations and should be modelled as different tools, even though a client may use both.

Proposed solution

Add merge queue support to the pull_requests toolset:

  1. enqueue_pull_request (write), wrapping enqueuePullRequest

    • owner, repo, pullNumber (required)
    • jump (optional, boolean): place the entry at the front of the queue
    • expectedHeadSha (optional): maps to expectedHeadOid, mirrors the existing merge_pull_request safety parameter
    • Returns the created merge queue entry: position, state, enqueued time, and the solo/jump flags
  2. dequeue_pull_request (write), wrapping dequeuePullRequest

    • owner, repo, pullNumber (required)
    • Returns the removed entry
  3. get_merge_queue_status method on pull_request_read (read), exposing the PR's mergeQueueEntry

    • Returns whether the PR is queued, its position, state (QUEUED, AWAITING_CHECKS, LOCKED, MERGEABLE, UNMERGEABLE), and the estimated time to merge if available
    • Returns null cleanly when the base branch has no merge queue, so clients can decide between merge_pull_request and enqueue_pull_request

Benefits: agents can complete the full PR lifecycle on repositories that require a merge queue without leaving MCP, and can report queue progress back to the user.

Example prompts or workflows (for tools/toolsets only)
  1. "Add PR #XXX to the merge queue once it is approved."
  2. "Is PR #XXX in the merge queue? What position is it in and is anything blocking it?"
  3. "Remove PR #XXX from the merge queue, I need to push a fix first."
  4. "For every approved PR of mine in this repo, enqueue it if the base branch uses a merge queue, otherwise merge it directly."
  5. "This hotfix is urgent, enqueue it at the front of the queue."
Additional context
  • The two mutations are the same ones used by the gh CLI and the web UI, so the semantics are already familiar to users.
  • merge_pull_request could additionally return a clearer error when the base branch requires a merge queue, pointing the client to enqueue_pull_request. That is a nice-to-have on top of the three items above.
  • Merge queue state is currently readable only indirectly, via the merge_queue rule in governance ruleset output. That tells a client the queue exists, but not whether a given PR is in it.
主要言語
Go
スター
34.2k
フォーク
5.3k
平均マージ
5日 18時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

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

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

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

似ている issue

Go の issue をもっと見る

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

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