Skip to content

Add ability to reply to individual pull request review comments #1323

@rhythmatician

Description

@rhythmatician

Describe the feature or problem you'd like to solve

Currently, the GitHub MCP Server doesn't provide a way to reply directly to individual pull request review comment threads. When Copilot or other reviewers leave inline comments on a PR, there's no way for an AI agent to respond to those specific threads - only to create new general PR comments or start new reviews.

This makes it difficult to have threaded conversations about specific code review feedback, which is a core GitHub workflow pattern.

Proposed solution

Add a new tool/method to reply to existing review comment threads, similar to GitHub's REST API endpoint:

POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/replies

This would enable AI agents to:

  • Respond directly to review feedback in-thread
  • Acknowledge and explain how comments were addressed
  • Ask clarifying questions about specific review suggestions
  • Maintain conversation context at the code level

Suggested tool signature:

reply_to_review_comment({
  owner: string,
  repo: string,
  comment_id: number,  // The review comment ID to reply to
  body: string         // Reply text (supports markdown)
})

Example prompts or workflows (for tools/toolsets only)

1. Addressing Code Review Feedback

"Reply to each of Copilot's review comments explaining how I addressed them"

Agent reads review comments, checks commits, then replies to each thread:

  • Comment r2467180584 → "✅ Addressed in commit a4622b9 by adding threading.Lock..."
  • Comment r2467180592 → "✅ Added clear_jwks_cache() public API..."

2. Requesting Clarification

"Ask the reviewer to clarify what they mean in comment r2467263520"

Agent replies: "Could you provide an example of the preferred import structure? Should all typing imports be grouped together or mixed with standard library?"

3. Acknowledging and Deferring

"Acknowledge the performance concern in comment r2467180578 but explain we'll address it in a follow-up PR"

Agent replies: "Good catch! This is a valid concern. Created Issue #150 to track adding connection pooling. Will address in next sprint."

4. Batch Response to Review

"For each unresolved review comment, reply with the commit that fixed it"

Agent iterates through review comments, checks git history, replies to each with specific commit SHA and explanation.

5. Interactive Code Review Dialogue

"If the reviewer suggests an alternative approach in any comment, ask them to elaborate"

Agent reads review, identifies suggestions, replies asking for examples or rationale.

Additional context

Current Workaround:
Right now we have to add a single general PR comment listing all responses:

## Review Comment Responses

### Comment r2467180584
✅ Addressed by adding threading.Lock

### Comment r2467180592  
✅ Added public API clear_jwks_cache()

This works but loses the threaded context and makes it harder for reviewers to track which specific code lines are being discussed.

GitHub API Reference:

Real-world use case:
I just addressed 5 Copilot review comments in Johnson-Gage-Inspection-Inc/core-api#145 and wanted to reply to each thread individually, but had to work around the limitation.

Benefits:

  • ✅ Maintains conversation context at code level
  • ✅ Enables proper GitHub code review workflow
  • ✅ Makes review/response history easier to follow
  • ✅ Integrates with GitHub's notification system
  • ✅ Allows AI agents to participate fully in code review discussions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions