Repository navigation
Description
Describe the feature or problem you’d like to solve
merge_pull_request merges through the REST merge endpoint (client.PullRequests.Merge in pkg/github/pullrequests.go), which has no way to set the author email of the merge commit. For an account with more than one verified email (for example a work and a personal email), GitHub picks the email.
In our case the result was not consistent: four merges made the same way through this tool, from the same account, were recorded with different emails (three with the personal email, one with the work email), and mostly not with the account's primary email. The author email of the commits in the pull request did not matter either.
The web UI lets users pick the email in the merge dialog, and the GraphQL mergePullRequest mutation accepts authorEmail, but there is no way to do this through the MCP server.
This matters most with the remote GitHub MCP server. A local setup can fall back to gh or a direct GraphQL call, but a hosted agent that only has the remote server's tools has no other way to merge, so the email cannot be controlled at all.
Proposed solution
Add an optional author_email parameter to merge_pull_request.
- When it is set, merge through the GraphQL
mergePullRequestmutation withauthorEmail, mapping the existing parameters tocommitHeadline,commitBody,mergeMethodandexpectedHeadOid. - When it is not set, keep the current REST behavior.
The server already uses a GraphQL client for other pull request tools (for example update_pull_request gets one from deps.GetGQLClient for the draft state mutations), so this should not need new plumbing.
This lets agents that merge on a user's behalf keep merge commits attributed to the right email, which matters for organizations that require commits to use a work email.
Example prompts or workflows (for tools/toolsets only)
- "Merge PR Issue: Fix incorrect VS Code installation URL (both buttons point to Insiders) #123 with a merge commit, using my work email as the commit author."
- "Squash and merge PR Issue: Fix incorrect VS Code installation URL (both buttons point to Insiders) #123 and attribute the commit to my noreply email."
- "Merge every approved PR of mine in this repo, always using my work email for the merge commits."
Additional context
Related in that both come from merge_pull_request being REST-only: #3669 (merge queue support).
Activity