Skip to content

Add issue dependency read/write MCP tools#2751

Open
zwick wants to merge 2 commits into
mainfrom
zwick/issue-dependency-tools
Open

Add issue dependency read/write MCP tools#2751
zwick wants to merge 2 commits into
mainfrom
zwick/issue-dependency-tools

Conversation

@zwick

@zwick zwick commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Add two feature-flagged MCP tools for issue dependencies: issue_dependency_read (list an issue's blocked-by / blocking relationships) and issue_dependency_write (add / remove a blocked-by or blocking relationship).

Why

github-mcp-server had no way to read or edit issue dependencies, although the GitHub API supports them and the gh CLI shipped the verbs in v2.94.0. This closes that MCP gap.

Refs #2391, #950

What changed

  • issue_dependency_readget_blocked_by / get_blocking via the GraphQL 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. Rejects a self-dependency before any API round-trip.
  • Both tools gated behind a new issue_dependencies feature flag — opt-in (user-enableable via --features / X-MCP-Features, auto-enabled in insiders mode) and kept out of the default toolset, mirroring the file_blame precedent.

MCP impact

  • New tool added — two flag-gated dependency tools. Fixed-context cost added 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, writes use the documented dependency mutations.

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 (feature-flags and insiders-features docs)

Split out from #2726, which now contains only the always-on issue_readget_parent method.

zwick and others added 2 commits June 17, 2026 16:31
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>
Reject a write where the subject and related issue are identical before
resolving node IDs or issuing a mutation, avoiding two API round-trips.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zwick zwick marked this pull request as ready for review June 22, 2026 17:29
@zwick zwick requested a review from a team as a code owner June 22, 2026 17:29
Copilot AI review requested due to automatic review settings June 22, 2026 17:29
@zwick zwick self-assigned this Jun 22, 2026

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 a new, opt-in “issue dependencies” capability to the GitHub MCP Server by introducing two feature-flagged MCP tools for reading and mutating native GitHub issue dependency edges (blocked-by / blocking) via GraphQL, including snapshots, tests, and generated docs updates.

Changes:

  • Added issue_dependency_read (cursor-paginated) to list blockedBy / blocking relationships for an issue via GraphQL connections.
  • Added issue_dependency_write to add/remove dependency edges via addBlockedBy / removeBlockedBy, resolving issue numbers to node IDs in a single aliased query and rejecting self-dependencies early.
  • Introduced the issue_dependencies feature flag and documented the newly gated tools in generated docs.
Show a summary per file
File Description
pkg/github/tools.go Registers the new dependency tools in the overall tool inventory (feature-gated).
pkg/github/issue_dependencies.go Implements issue_dependency_read + issue_dependency_write using GraphQL queries/mutations and cursor pagination.
pkg/github/issue_dependencies_test.go Adds tool schema snapshot tests and behavioral tests for read/write operations and validation paths.
pkg/github/feature_flags.go Introduces FeatureFlagIssueDependencies and wires it into allowed + insiders feature flag sets.
pkg/github/toolsnaps/issue_dependency_read_ff_issue_dependencies.snap Adds the toolsnap for the feature-flagged read tool schema.
pkg/github/toolsnaps/issue_dependency_write_ff_issue_dependencies.snap Adds the toolsnap for the feature-flagged write tool schema.
docs/insiders-features.md Generated docs: documents the new issue_dependencies gated tools under insiders.
docs/feature-flags.md Generated docs: documents the new issue_dependencies flag and its gated tools.

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 0

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