code-review-mcp
v2.0.0MCP Server for GitHub/GitLab code review - enables AI assistants to review pull requests and merge requests
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_review_rules
Get code review rules (builtin + custom project rules). Call this before starting a review to load all applicable rules.
| Parameter | Type | Description |
|---|---|---|
include_builtin | boolean | Whether to include builtin rules (default: true) |
lang | string | Language filter for builtin rules. 'zh' for Chinese, 'en' for English. If omitted, all builtin rules are returned. |
get_pr_info
Get PR/MR detailed information including title, description, author, and branches
| Parameter | Type | Description |
|---|---|---|
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path (e.g., owner/repo or group/project) |
host | string | GitLab host for self-hosted instances (default: gitlab.com) |
get_pr_changes
Get PR/MR code changes (diff) with optional file extension filtering. Supports pagination for large PRs.
| Parameter | Type | Description |
|---|---|---|
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
file_extensions | array | Filter files by extensions (e.g., ['.py', '.js']) |
host | string | GitLab host for self-hosted instances |
list_pr_comments
List existing comments on a PR/MR, including inline review comments and general comments. Useful for checking existing discussions before adding new ones.
| Parameter | Type | Description |
|---|---|---|
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
get_file_content
Get the full content of a file from the repository. Useful for understanding complete context when reviewing diffs.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Path to the file in the repository |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
ref | string | Branch, tag, or commit SHA (default: default branch) |
get_pr_commits
Get the list of commits in a PR/MR. Useful for understanding change progression and identifying which commit introduced an issue.
| Parameter | Type | Description |
|---|---|---|
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
add_inline_comment
Add inline comment to a specific code line in PR/MR
| Parameter | Type | Description |
|---|---|---|
comment * | string | Comment content |
file_path * | string | Path to the file |
line * | integer | Line number to comment on |
line_type * | string | Line type: 'old' for deleted line, 'new' for added line |
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
add_pr_comment
Add a general comment to PR/MR
| Parameter | Type | Description |
|---|---|---|
comment * | string | Comment content |
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
batch_add_comments
Batch add multiple inline comments and optionally a general comment
| Parameter | Type | Description |
|---|---|---|
inline_comments * | array | List of inline comments to add |
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
pr_comment | string | Optional general PR/MR comment |
resolve_discussion
Resolve a discussion thread on a PR/MR (GitLab only). For GitHub, use submit_review with 'approve' action instead.
| Parameter | Type | Description |
|---|---|---|
discussion_id * | string | Discussion/thread ID to resolve |
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
host | string | GitLab host for self-hosted instances |
submit_review
Submit a formal review decision on a PR/MR. GitHub: approve, request_changes, comment. GitLab: approve, unapprove.
| Parameter | Type | Description |
|---|---|---|
action * | string | Review action. GitHub: approve/request_changes/comment. GitLab: approve/unapprove. |
pr_id * | integer | PR/MR number |
provider * | string | Code hosting provider |
repo * | string | Repository path |
body | string | Review body/comment (optional for approve) |
host | string | GitLab host for self-hosted instances |