Title: Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view) · Issue #2905 · github/github-mcp-server · GitHub
Open Graph Title: Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view) · Issue #2905 · github/github-mcp-server
X Title: Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view) · Issue #2905 · github/github-mcp-server
Description: 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...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/github/github-mcp-server/issues/2905
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view)","articleBody":"## Describe the feature or problem you’d like to solve\n\nAgents 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:\n\n1. Discover or read a GitHub **native stack** (the stack object / annotations created by `gh stack link` / `gh stack submit`)\n2. Create or update that stack as a unit\n3. Cascade-rebase / sync the tower when trunk moves (`gh stack sync` / `gh stack rebase`)\n4. Merge bottom-up with stack-aware ordering\n\nToday 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).\n\n## Proposed solution\n\nAdd a small **stack toolset** (or extend `pull_requests`) that mirrors the operations agents already need from `gh stack`, without shelling out:\n\n| Tool | Purpose |\n|---|---|\n| `list_stacks` / `get_stack` | Resolve a stack by number, PR number, or head branch; return ordered PRs + trunk |\n| `link_stack` | Create/update a stack from an ordered list of PR numbers or branches (`gh stack link`) |\n| `update_stack` | Reorder / reparent / drop layers |\n| `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 |\n| `merge_stack` | Merge bottom-up, stopping on the first non-mergeable layer |\n\nMinimum 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.\n\n## Example\n\n```text\nlink_stack(\n owner: \"org\",\n repo: \"app\",\n base: \"develop\", # trunk\n pull_numbers: [7609, 7797, 7810, 7815, …] # bottom → top\n)\n→ { stack_number: 7928, prs: [...] }\n\nget_stack(owner, repo, stack_number: 7928)\n→ ordered layers with number, head, base, mergeable, reviewDecision","author":{"url":"https://github.com/kirill578","@type":"Person","name":"kirill578"},"datePublished":"2026-07-18T15:00:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2905/github-mcp-server/issues/2905"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eaf82ab4-bea9-fdd9-21cf-531db6e66bf2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB54:C5F3E:6D07AA:96FF14:6A61B3D0 |
| html-safe-nonce | 0580c70252bc81306ebb4daf536195e4667ed3f6166963d2cc4a524d1e9a52c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjU0OkM1RjNFOjZEMDdBQTo5NkZGMTQ6NkE2MUIzRDAiLCJ2aXNpdG9yX2lkIjoiMTU4MTg4MDMxNzEwNzYxNDY3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4ecb7799f8da32b4e932327c9e48c4f73301c9a9b9558d1a0a4886dbcc4d9b19 |
| hovercard-subject-tag | issue:4918760721 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/2905/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0d6944c4795f20135c2bf24065a8dea06c578b907e60b71d40d736348169225/github/github-mcp-server/issues/2905 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0d6944c4795f20135c2bf24065a8dea06c578b907e60b71d40d736348169225/github/github-mcp-server/issues/2905 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kirill578 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9 |
| turbo-cache-control | no-preview |
| go-import | github.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 942771284 |
| octolytics-dimension-repository_nwo | github/github-mcp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 942771284 |
| octolytics-dimension-repository_network_root_nwo | github/github-mcp-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac296ae7f21856f1f92adbad22f870b6fbb4b907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width