Summary
Backport the issue_graph tool from upstream PR github#1511 (tracking issue: github#1510).
For autonomous agents this collapses N+1 issue traversal calls into one, returning a complete graph of epics, tasks, sub-issues, and linked PRs.
What the tool does
BFS traversal from a root issue/PR following:
- Sub-issues (native GitHub sub-issue relationship)
- Linked PRs (closing references)
- Parent epics (tracked-in)
Returns a flat node+edge list optimized for LLM consumption.
Parameters:
owner (required)
repo (required)
issue_number (required): int
focus (optional): "epic" or "batch" — filters traversal direction
cross_repo (optional, bool): follow references into other repos
Backport approach
- Fetch the upstream diff:
curl https://github.com/github/github-mcp-server/pull/1511.diff
- Read it carefully — the PR was generated by Copilot against an older main, expect drift
- Implement the tool manually in
pkg/github/issues.go or a new pkg/github/issue_graph.go
- Register in the
issues toolset
Key implementation notes
- Sub-issues use the
subIssues GraphQL connection — requires sub-issues beta header. Find where beta headers are added in the codebase (look for sub-issues or betas.go)
- The BFS traversal should have a depth/node limit to prevent runaway queries (upstream uses 50 nodes)
- Cross-repo references need careful handling — only follow if
cross_repo=true
- Output format: flat array of
{id, type, title, state, url, relationships: [{type, target_id}]}
Reference
Upstream PR diff: https://github.com/github/github-mcp-server/pull/1511.diff
Upstream issue: github#1510
Files to Modify
pkg/github/issues.go or new pkg/github/issue_graph.go
pkg/github/issues_test.go or new pkg/github/issue_graph_test.go
- toolset registration for
issues toolset
Summary
Backport the
issue_graphtool from upstream PR github#1511 (tracking issue: github#1510).For autonomous agents this collapses N+1 issue traversal calls into one, returning a complete graph of epics, tasks, sub-issues, and linked PRs.
What the tool does
BFS traversal from a root issue/PR following:
Returns a flat node+edge list optimized for LLM consumption.
Parameters:
owner(required)repo(required)issue_number(required): intfocus(optional):"epic"or"batch"— filters traversal directioncross_repo(optional, bool): follow references into other reposBackport approach
curl https://github.com/github/github-mcp-server/pull/1511.diffpkg/github/issues.goor a newpkg/github/issue_graph.goissuestoolsetKey implementation notes
subIssuesGraphQL connection — requiressub-issuesbeta header. Find where beta headers are added in the codebase (look forsub-issuesorbetas.go)cross_repo=true{id, type, title, state, url, relationships: [{type, target_id}]}Reference
Upstream PR diff: https://github.com/github/github-mcp-server/pull/1511.diff
Upstream issue: github#1510
Files to Modify
pkg/github/issues.goor newpkg/github/issue_graph.gopkg/github/issues_test.goor newpkg/github/issue_graph_test.goissuestoolset