github / github/github-mcp-server

pull_request_read drops merge_commit_sha

オープン 初心者向け
#3,235 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Go
スター
33k
フォーク
5k
平均マージ
2日 1時間
マージ済み PR(30日)
52

説明

### Describe the bug

`pull_request_read` with `method: get` does not return the pull request's `merge_commit_sha`, so there is no way to get from a merged pull request to the commit the merge produced without a second call.

In the source, `GetPullRequest` fetches the full pull request and then returns `convertToMinimalPullRequest(pr)`. `MinimalPullRequest` carries `merged`, `merged_at`, `merged_by`, `head` and `base`, but has no `merge_commit_sha` field, so the value is dropped during conversion. `merge_commit` does not appear anywhere in `pkg/github/pullrequests.go`.

### Affected version

Unknown. Observed through a hosted GitHub MCP integration on 2026-09-06, where the server version is not exposed to me. The code references above are from the repository's default branch on that date and may not match the build that was serving the request.

### Steps to reproduce the behavior

1. Call `pull_request_read` with `method: get` for a merged pull request.
2. Inspect the returned object.

### Expected vs actual behavior

Expected: `merge_commit_sha` is present for a merged pull request, as the REST API returns it.

Actual: the field is absent. Callers fall back to listing commits and matching on merge time or on the pull request number in the commit message, both of which are unreliable on an active branch.

### Logs

None captured beyond the returned object.

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

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

調査の方向性

Start in pkg/github/pullrequests.go, reading GetPullRequest, convertToMinimalPullRequest, and MinimalPullRequest. Add support for retaining the merge commit SHA, then verify that pull_request_read with method get exposes merge_commit_sha for merged pull requests.

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

評価

技術スタック
github, go
領域
api, backend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
84/100

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

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