CodeRabbitはAIコードレビューサービスです。GitHubやGitLab、BitBucketなどさまざまなGitリポジトリサービスと連携し、PRを自動レビューします。そんなCodeRabbitでは、コードレビュー時のコンテキストとして、MCPサーバーへの接続が可能です。
CodeRabbit Documentation - MCP Server
このMCPサーバー連携機能で、どういったデータが送られてくるのか紹介します。
対象のMCPサーバーについて
今回はBacklogのMCPサーバーを利用しています。
この時に立てたMCPサーバーへ、どういったリクエストが来るのかを調べました。
登録時
MCPサーバーを登録した際のリクエストです。 clientInfo.name == CodeRabbit となっています。 POST / に送られてきます。
{
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {
"name": "CodeRabbit",
"version": "1.0.0"
}
},
"jsonrpc": "2.0",
"id": 0
}
次も POST / です。
{
"method": "notifications/initialized",
"jsonrpc": "2.0"
}
その後、 GET / がきました(おそらく疎通確認用で、定期的に送られてきます)。さらにリクエストは続いて、 POST / に提供されるツールの取得リクエストがきます。
{
"method": "tools/list",
"jsonrpc": "2.0",
"id": 1
}
ここまでで接続完了します。
レビュー時
PRを登録して、CodeRabbitによるレビューが開始すると、再度 POST / が送られてきます。 keyword は、PRのタイトルに入っているキーワードになります。
{
"method": "tools/call",
"params": {
"name": "get_issues",
"arguments": {
"keyword": "bookmarks",
"count": 10
}
},
"jsonrpc": "2.0",
"id": 5
}
これに対して、適切な情報を返却してレビュー時のコンテキストに利用されます。
さらに、以下のようなリクエストも送られてきました。
{
"method": "tools/call",
"params": {
"name": "get_myself",
"arguments": {}
},
"jsonrpc": "2.0",
"id": 3
}
2つ目。
{
"method": "tools/call",
"params": {
"name": "get_project_list",
"arguments": {}
},
"jsonrpc": "2.0",
"id": 2
}
get_issues だけでなく、 get_issue も来ます。 issueKey はBacklogの課題IDです。
{
"method": "tools/call",
"params": {
"name": "get_issue",
"arguments": {
"issueKey": "MOONGIFT-3"
}
},
"jsonrpc": "2.0",
"id": 8
}
選択されている機能について
Backlog MCPでは、以下の44の機能があります。基本的にget系の機能が呼ばれています。場合によっては get_issue_comments も呼ばれそうです。
- get_space
Returns information about the Backlog space - get_users
Returns list of users in the Backlog space - get_myself
Returns information about the authenticated user - get_project_list
Returns list of projects - add_project
Creates a new project - get_project
Returns information about a specific project - update_project
Updates an existing project - delete_project
Deletes a project - get_issue
Returns information about a specific issue - get_issues
Returns list of issues - count_issues
Returns count of issues - add_issue
Creates a new issue in the specified project. - update_issue
Updates an existing issue - delete_issue
Deletes an issue - get_issue_comments
Returns list of comments for an issue - add_issue_comment
Adds a comment to an issue - get_priorities
Returns list of priorities - get_categories
Returns list of categories for a project - get_custom_fields
Returns list of custom fields for a project - get_issue_types
Returns list of issue types for a project - get_resolutions
Returns list of issue resolutions - get_watching_list_items
Returns list of watching items for a user - get_watching_list_count
Returns count of watching items for a user - get_wiki_pages
Returns list of Wiki pages - get_wikis_count
Returns count of wiki pages in a project - get_wiki
Returns information about a specific wiki page - add_wiki
Creates a new wiki page - get_git_repositories
Returns list of Git repositories for a project - get_git_repository
Returns information about a specific Git repository - get_pull_requests
Returns list of pull requests for a repository - get_pull_requests_count
Returns count of pull requests for a repository - get_pull_request
Returns information about a specific pull request - add_pull_request
Creates a new pull request - update_pull_request
Updates an existing pull request - get_pull_request_comments
Returns list of comments for a pull request - add_pull_request_comment
Adds a comment to a pull request - update_pull_request_comment
Updates a comment on a pull request - get_documents
Gets a list of documents in a project. - get_document_tree
Gets the document tree of a project. - get_document
Gets information about a document. - get_notifications
Returns list of notifications - count_notifications
Returns count of notifications - reset_unread_notification_count
Reset unread notification count - mark_notification_as_read
Mark a notification as read
まとめ
もし自社サービスとCodeRabbitを連携させたい場合には、処理名を get_issue のようにすると良さそうです。また、検索キーワードも送られてくるので、それに合わせてコンテキストを返却すると、より良いレビューが実現できるでしょう。
ぜひ活用してください!