code-review-mcp

v2.0.0
code-review-mcp Checked 1 day ago Published 3 months ago

MCP 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.

ParameterTypeDescription
include_builtinbooleanWhether to include builtin rules (default: true)
langstringLanguage 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

ParameterTypeDescription
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path (e.g., owner/repo or group/project)
hoststringGitLab 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.

ParameterTypeDescription
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
file_extensionsarrayFilter files by extensions (e.g., ['.py', '.js'])
hoststringGitLab 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.

ParameterTypeDescription
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab 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.

ParameterTypeDescription
file_path *stringPath to the file in the repository
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances
refstringBranch, 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.

ParameterTypeDescription
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances

add_inline_comment

Add inline comment to a specific code line in PR/MR

ParameterTypeDescription
comment *stringComment content
file_path *stringPath to the file
line *integerLine number to comment on
line_type *stringLine type: 'old' for deleted line, 'new' for added line
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances

add_pr_comment

Add a general comment to PR/MR

ParameterTypeDescription
comment *stringComment content
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances

batch_add_comments

Batch add multiple inline comments and optionally a general comment

ParameterTypeDescription
inline_comments *arrayList of inline comments to add
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances
pr_commentstringOptional 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.

ParameterTypeDescription
discussion_id *stringDiscussion/thread ID to resolve
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
hoststringGitLab host for self-hosted instances

submit_review

Submit a formal review decision on a PR/MR. GitHub: approve, request_changes, comment. GitLab: approve, unapprove.

ParameterTypeDescription
action *stringReview action. GitHub: approve/request_changes/comment. GitLab: approve/unapprove.
pr_id *integerPR/MR number
provider *stringCode hosting provider
repo *stringRepository path
bodystringReview body/comment (optional for approve)
hoststringGitLab host for self-hosted instances