Skip to content

Feature: Add in_reply_to support for replying to existing PR review comment threads #2240

@siddhant-nigam

Description

@siddhant-nigam

Problem

The add_comment_to_pending_review tool currently creates new standalone review comments at a file/line position. There is no way to create a threaded reply to an existing review comment — the GitHub REST API supports this via POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies, but this endpoint is not exposed through any MCP tool.

Why this matters

When AI agents (Claude Code, Copilot, etc.) are used to resolve PR review comments, they need to reply inside the existing conversation thread so reviewers see the response in context. Without in_reply_to support:

  • Replies appear as separate, disconnected comments on the same file — not inside the original thread
  • Reviewers have to manually correlate which new comment addresses which original feedback
  • Automated PR resolution workflows (common in Claude Code, Cursor, etc.) produce messy, hard-to-follow PRs
  • The workaround is to extract the PAT from the MCP server's Docker container and call curl directly, which defeats the purpose of having an MCP abstraction

Proposed Solution

Option A: Add in_reply_to parameter to add_comment_to_pending_review

Add an optional in_reply_to parameter (the numeric comment ID) to the existing tool:

{
  "name": "add_comment_to_pending_review",
  "parameters": {
    "in_reply_to": {
      "description": "The numeric ID of the review comment to reply to. When provided, creates a threaded reply instead of a new standalone comment. The path, line, side, and subjectType parameters are ignored when in_reply_to is set.",
      "type": "number"
    }
  }
}

Option B: Add a new reply_to_pull_request_review_comment tool

A dedicated tool that maps directly to POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies:

{
  "name": "reply_to_pull_request_review_comment",
  "parameters": {
    "owner": { "type": "string", "required": true },
    "repo": { "type": "string", "required": true },
    "pullNumber": { "type": "number", "required": true },
    "commentId": { "type": "number", "required": true, "description": "The numeric ID of the review comment to reply to" },
    "body": { "type": "string", "required": true, "description": "The reply text" }
  }
}

Current Workaround

Users must extract the PAT from the running MCP server container and call the GitHub API directly:

# Extract PAT from the MCP server's Docker container
PAT=$(docker inspect <container_id> --format '{{range .Config.Env}}{{println .}}{{end}}' | grep GITHUB_PERSONAL_ACCESS_TOKEN | cut -d= -f2)

# Reply to a review comment thread
curl -s -X POST \
  -H "Authorization: token $PAT" \
  -H "Accept: application/vnd.github+json" \
  "https://api.github.com/repos/OWNER/REPO/pulls/PR/comments/COMMENT_ID/replies" \
  -d '{"body":"reply text"}'

This is fragile, bypasses the MCP abstraction layer, and requires users to know Docker internals.

GitHub API Reference

Use Cases

  1. AI-powered PR review resolution — Claude Code / Cursor / Copilot resolve review comments and need to reply in-thread
  2. Automated review bots — Bots that address feedback and confirm fixes in the original thread
  3. Code review workflows — Any MCP client that needs to participate in PR review conversations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions