You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view) #2905
Describe the feature or problem you’d like to solve
Agents that manage stacked / dependent PRs (each PR’s base is the branch below it) can already create and re-base-point individual PRs via create_pull_request / update_pull_request, but they have no first-class way to:
Discover or read a GitHub native stack (the stack object / annotations created by gh stack link / gh stack submit)
Create or update that stack as a unit
Cascade-rebase / sync the tower when trunk moves (gh stack sync / gh stack rebase)
Merge bottom-up with stack-aware ordering
Today the only path to native stacks is the gh stack CLI extension (github/gh-stack), which many agent environments intentionally don’t expose (token stays on a host proxy; container gh is stubbed; agents talk to GitHub through this MCP).
Proposed solution
Add a small stack toolset (or extend pull_requests) that mirrors the operations agents already need from gh stack, without shelling out:
Tool
Purpose
list_stacks / get_stack
Resolve a stack by number, PR number, or head branch; return ordered PRs + trunk
link_stack
Create/update a stack from an ordered list of PR numbers or branches (gh stack link)
update_stack
Reorder / reparent / drop layers
sync_stack
Cascade-rebase onto trunk + push with lease semantics (gh stack sync) — or return structured rebase instructions if server-side git is out of scope
merge_stack
Merge bottom-up, stopping on the first non-mergeable layer
Minimum useful v1: read + link (get_stack, link_stack). Agents can already do Path-B base-chaining with update_pull_request(base=…); what’s missing is the native stack object and a single call that wires N PRs correctly.
Activity
feat(pull_requests): add MCP tools for GitHub Stacked PRs (github#2905)
feat(pull_requests): add MCP tools for GitHub Stacked PRs (github#2905)
leuasseurfarrelds247-arch commentedon Sep 3, 2026
leuasseurfarrelds247-arch commentedon Sep 3, 2026
0957ac62fbc4eff659b374d3588d6adf9b0b62e0pkg/githubpkg/github/toolsnaps/pull_request_stack_write.snappkg/github/tools.go/toolset_instructions.go