Add MCP tools for GitHub Stacked PRs (gh stack link / sync / view)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne mit der Überprüfung der vorhandenen Tools create_pull_request und update_pull_request und vergleiche anschließend deren Verhalten bei der Verkettung von Bases mit dem der vorgeschlagenen Operationen get_stack und link_stack. Eine minimale v1 ist vollständig, wenn Agents einen nativen Stack lesen sowie einen Stack aus einer geordneten Liste von Pull Requests oder Branches erstellen oder aktualisieren können, wobei geordnete Layer und der Trunk zurückgegeben werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Go
- Sterne
- 33.1k
- Forks
- 5k
- Ø Merge
- 2 T. 3 Std.
- Gemergte PRs (30 T.)
- 18
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/github-mcp-server
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
github/github-mcp-server#3235 ·
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
github/github-mcp-server#3042 · 2 Kommentare ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
github/github-mcp-server#3032 · 1 Reaktion ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
github/github-mcp-server#2803 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
github/github-mcp-server#2740 ·
Alle Issues in github/github-mcp-server
Ähnliche Issues
-
bug github_actions
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
registrystack/registry-stack#1393 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
JakeChampion/lang#10213 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100