Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add update_pull_request_comment and delete_pull_request_comment tools

未关闭
#2,448 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
github, go
领域
api, tooling

调研方向

首先定位现有的 add_reply_to_pull_request_comment 工具及其 GitHub API 请求模式。使用所述的 REST 端点和参数添加匹配的更新和删除工具,然后验证每个工具都如描述的那样针对经过身份验证的用户的评论,并支持更新所请求的请求体。

由索引模型根据 Issue 内容生成。

描述

Describe the feature or problem you'd like to solve

The MCP server provides add_reply_to_pull_request_comment for PR review comments, but there is no way to edit or delete an existing review comment. The only available mutation is adding a new reply underneath an existing comment.

When an agent needs to correct or retract a review comment it previously posted, the current workaround is to post a new reply — leaving the stale original visible and creating thread noise. The alternative is falling back to gh api with PATCH/DELETE on /repos/{owner}/{repo}/pulls/comments/{id}, bypassing the MCP server entirely.

Proposed solution

Add two new tools that map to the existing GitHub REST API endpoints:

update_pull_request_comment
  • REST API: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}
  • Parameters: owner, repo, comment_id (number), body (string — new body text)
  • Auth constraint: Can only update comments authored by the authenticated user
  • Equivalent gh command: gh api repos/{owner}/{repo}/pulls/comments/{id} -X PATCH -f body="..."
delete_pull_request_comment
  • REST API: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}
  • Parameters: owner, repo, comment_id (number)
  • Auth constraint: Can only delete comments authored by the authenticated user
  • Equivalent gh command: gh api repos/{owner}/{repo}/pulls/comments/{id} -X DELETE

Both endpoints are already documented in the GitHub REST API and require no new upstream features.

Additional context

This gap caused a real-world problem: an agent posted review replies that should have been edits to the original comments. The discussion_r{N} URL identifier ≠ the API comment id (a separate but related confusion — see #2235 for a different comment-reading gap), and without an edit tool the agent defaulted to the only mutation available — add_reply — producing thread noise instead of correcting the original.

Having edit/delete tools also enables agents to clean up their own mistakes programmatically, which is important for production reliability.

主要语言
Go
星标
33.1k
派生
5k
平均合并
2 天 1 小时
30 天内合并 PR
25

贡献指南

打开贡献指南

从这里开始

  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 摘要。