Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view)
維護者通常 1 天內回覆
評估
研究方向
先檢視現有的 create_pull_request 和 update_pull_request 工具,然後將它們的 base 鏈結行為與提議的 get_stack 和 link_stack 操作進行比較。當 agents 能夠讀取原生 stack,並根據依序排列的 pull request 或 branch 清單建立或更新 stack,同時傳回有序的 layer 和 trunk 時,最小 v1 即告完成。
由索引模型根據 Issue 內容生成。
描述
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.
Example
link_stack(
owner: "org",
repo: "app",
base: "develop", # trunk
pull_numbers: [7609, 7797, 7810, 7815, …] # bottom → top
)
→ { stack_number: 7928, prs: [...] }
get_stack(owner, repo, stack_number: 7928)
→ ordered layers with number, head, base, mergeable, reviewDecision
- 主要語言
- Go
- 星號
- 33.3k
- 分支
- 5.1k
- 平均合併
- 22 小時 46 分鐘
- 30 天內合併 PR
- 17
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
pull_request_read drops merge_commit_sha可能已有人在做 @thejdubb02 於 28 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 · 1 則留言 ·
維護者通常 1 天內回覆
-
Add guidance on GitHub autolinked reference formatting for AI agents可能重新可做 關聯的 PR 已關閉且未合併。 未關閉enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
維護者通常 1 天內回覆
-
Incorrect install documentation leads to error "error: unknown option '-e'"可能已有人在做 @syf2211 於 57 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
維護者通常 1 天內回覆
-
get_discussion and get_discussion_comments accept calls with missing required parameters instead of returning a validation error可能已有人在做 @rodboev 於 107 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
維護者通常 1 天內回覆
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 90/100
FootprintAI/Containarium#2338 ·
維護者通常 1 天內回覆
-
[Bug]: core doesn't build standalone on dev since a17068054 (go-mp3 require dropped, go.sum pruned)未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
SagerNet/sing-openvpn#11 ·
-
priority: P3 type: devops
難度 2/5 1-3 小時 新手友好度 75/100
jiegui2025/hwspec#57 ·
維護者通常 1 天內回覆