Skip to content

Add issue dependency tools and issue_read get_parent#2726

Draft
zwick wants to merge 2 commits into
mainfrom
zwick/issue-dependencies-mcp
Draft

Add issue dependency tools and issue_read get_parent#2726
zwick wants to merge 2 commits into
mainfrom
zwick/issue-dependencies-mcp

Conversation

@zwick

@zwick zwick commented Jun 17, 2026

Copy link
Copy Markdown

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_read tool.

Why

github-mcp-server could read an issue's children (issue_readget_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 the gh CLI shipped the dependency verbs in v2.94.0; this closes the MCP gap.

Refs #2391, #950

What changed

  • issue_read → new get_parent method — reads the GraphQL Issue.parent (upward counterpart to get_sub_issues); returns a null parent when the issue isn't a sub-issue. Always-on, mirroring get_sub_issues.
  • issue_dependency_readget_blocked_by / get_blocking via the Issue.blockedBy / Issue.blocking connections, cursor-paginated.
  • issue_dependency_writeadd / remove × blocked_by / blocking via the addBlockedBy / removeBlockedBy mutations. Accepts issue numbers (resolved to node IDs in one aliased query); blocking is the inverse of blocked_by with subject/related swapped.
  • Both dependency tools gated behind a new issue_dependencies feature 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 the file_blame precedent (present in both AllowedFeatureFlags and InsidersFeatureFlags).

MCP impact

  • Tool schema or behavior changed — issue_read gains a get_parent method (negligible schema cost).
  • New tool added — two flag-gated dependency tools. Added fixed-context cost to the default toolset is 0 (gated); combined schema is ~700–900 tokens when the flag is enabled.

Prompts tested (tool changes only)

Security / limits

  • Auth / permissions considered — requires repo scope; reads are read-only.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Updated (README for get_parent; feature-flags / insiders docs for the dependency tools)

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>
Copilot AI review requested due to automatic review settings June 17, 2026 20:31
@zwick zwick requested a review from a team as a code owner June 17, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (GraphQL Issue.blockedBy / Issue.blocking) with cursor pagination.
  • Introduces issue_dependency_write (GraphQL addBlockedBy / removeBlockedBy) resolving issue numbers to node IDs in a single aliased query.
  • Adds the issue_dependencies feature 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

Comment thread pkg/github/feature_flags.go
@zwick zwick marked this pull request as draft June 17, 2026 20:39
@zwick zwick self-assigned this Jun 17, 2026
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>
@zwick zwick changed the title Add issue dependency read/write MCP tools Add issue dependency tools and issue_read get_parent Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants