Support standalone inline PR review comments

未關閉
#3,485 3 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github, go

研究方向

Start by reading the existing pull request review and comment tool implementations and their tests to see how they handle GitHub API parameters and validation. Then compare that workflow with the REST endpoint described in the issue. Done means a tool can create a standalone inline comment with the listed location parameters, without creating or submitting a review.

由索引模型根據 Issue 內容生成。

描述

enhancement
Describe the feature or problem you'd like to solve

GitHub's UI allows posting an inline PR comment using "Add single comment", without starting or submitting a pull request review.

With github-mcp-server, the currently supported workflow for inline comments appears to be review-oriented:

  1. Create a pending review
  2. Add comments using add_comment_to_pending_review
  3. Submit the review

This makes sense when an agent is performing a complete code review, but not every inline observation necessarily represents a review.

For example, an agent may simply want to leave a comment such as:

Consider extracting this into a separate method.

on a specific line and continue its workflow.

Currently, doing this requires creating and subsequently submitting a review, which introduces additional state and has different semantics from GitHub's native "Add single comment" functionality.

Proposed solution

Expose a tool for creating a standalone inline pull request review comment, for example:

create_pull_request_review_comment

The tool could map to GitHub's existing REST API:

POST /repos/{owner}/{repo}/pulls/{pull_number}/comments

and accept the corresponding parameters such as:

  • repository
  • pull request number
  • comment body
  • commit SHA
  • file path
  • line / side
  • optional start line / start side for multi-line comments

This would allow both workflows:

  • Standalone inline comment — equivalent to GitHub's "Add single comment"
  • Pending review comments — comments intentionally grouped into a review
Example prompts or workflows (for tools/toolsets only)

An agent inspecting a PR notices one localized issue and wants to comment directly on the relevant line:

This timeout is hard-coded. Should this use the configured request timeout instead?

The desired behavior would be to publish that comment immediately on the relevant line, without creating a pending review or requiring a subsequent review submission.

Additional context

I noticed that github-mcp-server explicitly supports and encourages the pending-review workflow, so the absence of standalone inline comments may be an intentional design decision.

If so, it would be useful to understand whether there is a technical, security, or agent-workflow reason for not exposing GitHub's standalone inline-comment API.

This request is not intended to change or replace add_comment_to_pending_review. It is about exposing the separate GitHub capability for cases where an agent wants to publish an individual inline comment without creating a review.

主要語言
Go
星號
34.4k
分支
5.3k
平均合併
3 天 10 小時
30 天內合併 PR
11

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。