💨

Claude Code Actionでインラインレビューを行う

に公開

Claude Code Action (v1)によるレビューの挙動に関して
https://github.com/anthropics/claude-code-action

結果的に公式リポジトリのサンプルを参考にallowedToolsにmcp__github_inline_comment__create_inline_comment を追加することでインラインコメントが出来たが、紆余曲折あったのでメモ

上記の前は mcp__github__create_pending_pull_request_review を経由して mcp__github__add_pull_request_review_comment_to_pending_review で実現していたのだけどうまく動かなくなり、mcp__github_inline_comment__create_inline_commentに変更してみたのだけどうまくいかず。

下記によるとGitHub MCPツールの名称が変更によるものではないかということでしたが
https://github.com/anthropics/claude-code-action/issues/60#issuecomment-3336476555

下記を見る限り github_inline_commentclaude-code-action 側にmcpの実装がありそう。
https://github.com/anthropics/claude-code-action/blob/main/src/mcp/github-inline-comment-server.ts

結果としては最初に書いたように、シンプルにallowedToolsにmcp__github_inline_comment__create_inline_comment を追加しプロンプトで適切にインラインコメントを使うように指示(「具体的な指摘インラインコメントを使用して下さい」程度でmcpの使い方などは指示していない)でうまくいった。

同じPR使いまわしで検証すると変更前をひきづることがあったので、最初うまくいかなかったのはそのせいかもしれないが理由は判明していない。

株式会社ソニックムーブ

Discussion