Add issue dependency tools and issue_read get_parent#2726
Draft
zwick wants to merge 2 commits into
Draft
Conversation
Add two feature-flagged tools for issue blocked-by / blocking relationships, gated behind the issue_dependencies flag so they stay off the default tool surface (auto-enabled for insiders only): - issue_dependency_read: get_blocked_by / get_blocking via the Issue.blockedBy / Issue.blocking GraphQL connections, cursor-paginated. - issue_dependency_write: add / remove x blocked_by / blocking via the addBlockedBy / removeBlockedBy mutations. Accepts issue numbers and resolves them to node IDs in a single aliased query; "blocking" is the inverse of "blocked_by" with the subject/related roles swapped. Closes the MCP gap behind the gh CLI dependency verbs (cli/cli#13057). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new feature-flagged MCP tools to read and modify GitHub Issue dependency relationships (blocked-by / blocking) using GraphQL connections and the addBlockedBy / removeBlockedBy mutations, filling a gap not covered by existing issue relationship tools.
Changes:
- Introduces
issue_dependency_read(GraphQLIssue.blockedBy/Issue.blocking) with cursor pagination. - Introduces
issue_dependency_write(GraphQLaddBlockedBy/removeBlockedBy) resolving issue numbers to node IDs in a single aliased query. - Adds the
issue_dependenciesfeature flag, tests, toolsnap snapshots, and regenerated docs sections.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/tools.go | Registers the new issue dependency tools in the overall tool inventory (feature-flag gated). |
| pkg/github/issue_dependencies.go | Implements read/write tools and supporting GraphQL query/mutation helpers. |
| pkg/github/issue_dependencies_test.go | Adds schema snapshot validation and behavior tests for the new tools. |
| pkg/github/feature_flags.go | Introduces the issue_dependencies flag and wires it into feature-flag sets. |
| pkg/github/toolsnaps/issue_dependency_read_ff_issue_dependencies.snap | Adds the flag-gated schema snapshot for the read tool. |
| pkg/github/toolsnaps/issue_dependency_write_ff_issue_dependencies.snap | Adds the flag-gated schema snapshot for the write tool. |
| docs/insiders-features.md | Documents the new issue_dependencies flag/tools in insiders features (generated section). |
| docs/feature-flags.md | Documents the new issue_dependencies flag/tools in feature flags (generated section). |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 1
Add an upward parent read to issue_read, the counterpart to the existing downward get_sub_issues. Uses the GraphQL Issue.parent field and returns a null parent when the issue is not a sub-issue. Kept always-on (not feature gated) to mirror get_sub_issues; the dependency tools remain flag-gated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add MCP support for issue relationships not previously reachable: read/write of an issue's blocked-by / blocking dependencies, plus reading an issue's parent. The dependency tools are gated behind a feature flag; the parent read is a method on the existing
issue_readtool.Why
github-mcp-servercould read an issue's children (issue_read→get_sub_issues) but had no way to read its parent, and no way to read or edit dependencies at all. The GitHub API supports both, and theghCLI shipped the dependency verbs in v2.94.0; this closes the MCP gap.Refs #2391, #950
What changed
issue_read→ newget_parentmethod — reads the GraphQLIssue.parent(upward counterpart toget_sub_issues); returns a null parent when the issue isn't a sub-issue. Always-on, mirroringget_sub_issues.issue_dependency_read—get_blocked_by/get_blockingvia theIssue.blockedBy/Issue.blockingconnections, cursor-paginated.issue_dependency_write—add/remove×blocked_by/blockingvia theaddBlockedBy/removeBlockedBymutations. Accepts issue numbers (resolved to node IDs in one aliased query);blockingis the inverse ofblocked_bywith subject/related swapped.issue_dependenciesfeature flag — an opt-in flag (user-enableable via--features/X-MCP-Features, and auto-enabled in insiders mode), kept out of the default toolset. Mirrors thefile_blameprecedent (present in bothAllowedFeatureFlagsandInsidersFeatureFlags).MCP impact
issue_readgains aget_parentmethod (negligible schema cost).Prompts tested (tool changes only)
issue_read/get_parentget_blocked_byget_blockingadd+blocked_byremove+blockingSecurity / limits
reposcope; reads are read-only.Tool renaming
Lint & tests
./script/lint./script/testDocs
get_parent; feature-flags / insiders docs for the dependency tools)