approve_mr
Approve a merge request. The authenticated user must have permission to approve.
Works a GitLab merge request the way a reviewer does — inline discussions, replies, resolve, approve, ready — plus pipelines, job logs, issues and diffs.
LABSCO SUMMARY
Pipelines and job traces sit in the same server, so a red CI run can be read and re-run without leaving the conversation. Two practical notes: project listings return minimal fields by default and need simple=false when you want everything, and the token variable is NPM_CONFIG_TOKEN, which npm also consumes — keep it scoped to this server's env block.
A typed MCP server over the GitLab API, authenticated with a personal access token, covering the review workflow rather than only listing and commenting.
A GitLab personal access token carrying the api, read_user and read_repository scopes. The server reads it from NPM_CONFIG_TOKEN — a name npm also reads, so set it inside the server's own env block rather than exporting it in your shell. GITLAB_BASE_URL points at a self-hosted instance. Run it over stdio with npx -y @alosies/gitlab-mcp-server. An optional config file — gitlab-mcp.json in the working directory, ~/.gitlab-mcp.json, or a path given via --config or GITLAB_MCP_CONFIG — sets a default project, page size and timeout, and environment variables always override it.
One command plus a key — npx -y @alosies/gitlab-mcp-server, then supply credentials
USE CASES
Read the diff, leave an inline discussion on the lines that matter, then resolve it once it is addressed.
Find the pipeline, list its jobs, then tail the failing job's log rather than downloading all of it.
Create it against the target branch, and mark it draft until it is worth reviewing.
Check who still needs to approve, add your approval, then mark it ready.
Read the diff between the refs directly, without opening a merge request first.
List the project's labels first, then create the issue using them.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
approve_mrApprove a merge request. The authenticated user must have permission to approve.
cancel_pipelineCancel a running pipeline
create_issueCreate a new issue
create_merge_requestCreate a new merge request
create_mr_discussionCreate a new discussion on a merge request. Can be a general discussion or an inline comment on the diff. Supports embedding images/files via attachments parameter.
create_mr_discussion_noteAdd a new note to an existing merge request discussion thread
create_mr_noteAdd a new top-level comment to a merge request. Supports embedding images/files via attachments parameter.
create_pipelineCreate a new pipeline
delete_mr_discussion_noteDelete a note from a merge request discussion
delete_mr_noteDelete a top-level note (comment) from a merge request
delete_pipelineDelete a pipeline
get_branch_diffsGet the changes/diffs between two branches or commits in a GitLab project
get_commitGet details of a specific commit
get_commit_diffGet changes/diffs of a specific commit
get_issueGet details of a specific issue
get_job_logsGet the log (trace) file of a specific job
get_job_traceGet job trace with options for partial logs, tail mode, and line limits
get_merge_requestGet details of a merge request. Either merge_request_iid or source_branch must be provided.
get_merge_request_diffsGet the changes/diffs of a merge request. Either merge_request_iid or source_branch must be provided.
get_mr_approvalsGet the approval status of a merge request, including who has approved, how many approvals are needed, and approval rules.
get_mr_templateGet a specific merge request description template by name
get_pipelineGet details of a specific pipeline
get_pipeline_variablesGet variables of a pipeline
get_projectGet details of a specific project
get_project_commitsList repository commits with filtering options
get_userGet current user information
list_issuesList issues in a project
list_merge_request_diffsList merge request diffs with pagination support. Either merge_request_iid or source_branch must be provided.
list_merge_requestsList merge requests in a project
list_mr_discussionsList discussions (threaded comments including inline code comments) on a merge request. Use unresolved_only=true to fetch only unresolved discussions (saves tokens).
list_mr_notesList all notes (comments) on a merge request
list_mr_templatesList available merge request description templates in a project
list_pipeline_jobsList jobs in a pipeline
list_pipelinesList pipelines in a project
list_project_branchesList branches in a project
list_project_labelsList all labels available in a project. Useful for discovering valid label names before adding them to issues or merge requests.
list_project_uploadsList files that have been uploaded to a project
list_projectsList GitLab projects with minimal info by default (to reduce token usage from 40k+ to much less). Use simple=false for full project details when needed.
mark_mr_as_draftMark a merge request as draft (work in progress, not ready for review)
mark_mr_as_readyMark a merge request as ready (remove draft status, ready for review)
reply_to_mr_discussionReply to an existing discussion thread on a merge request
resolve_mr_discussionMark a discussion on a merge request as resolved
retry_pipelineRetry a failed pipeline
unapprove_mrRemove your approval from a merge request.
unresolve_mr_discussionMark a discussion on a merge request as unresolved
update_merge_requestUpdate an existing merge request. Either merge_request_iid or source_branch must be provided.
update_mr_discussion_noteModify an existing merge request discussion note
update_mr_labelsAdd or remove labels from a merge request. More convenient than update_merge_request for label-only changes.
update_mr_noteUpdate the content of an existing top-level note (comment) on a merge request. Supports embedding images/files via attachments parameter.
upload_project_fileUpload a file to a GitLab project. Returns a markdown string and URL that can be embedded in MR comments, issue descriptions, etc.
BEFORE YOU INSTALL
50 tools when we connected. The tool reference omits nine tools, including approve_mr, update_mr_labels and upload_project_file. Writes need a token with the api scope.
CONTEXT COST
Rated by the size of the 50 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y @alosies/gitlab-mcp-server{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@alosies/gitlab-mcp-server"
],
"env": {
"NPM_CONFIG_TOKEN": "<YOUR_NPM_CONFIG_TOKEN>"
}
}
}
}npm install -g @alosies/gitlab-mcp-serverThen use this in Claude Desktop:
{
"mcpServers": {
"gitlab": {
"command": "gitlab-mcp-server",
"env": {
"NPM_CONFIG_TOKEN": "<YOUR_NPM_CONFIG_TOKEN>"
}
}
}
}git clone https://github.com/Alosies/gitlab-mcp-server.git
cd gitlab-mcp-server
npm install
npm run buildThen use this in Claude Desktop:
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"<YOUR_PATH_TO_GITLAB_MCP_SERVER>/dist/index.js"
],
"env": {
"NPM_CONFIG_TOKEN": "<YOUR_NPM_CONFIG_TOKEN>"
}
}
}
}<YOUR_PATH_TO_GITLAB_MCP_SERVER> is the full path of your clone.
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@alosies/gitlab-mcp-server"
],
"env": {
"NPM_CONFIG_TOKEN": "<YOUR_NPM_CONFIG_TOKEN>",
"GITLAB_BASE_URL": "<YOUR_GITLAB_URL>"
}
}
}
}<YOUR_GITLAB_URL> is the address of your self-hosted GitLab, starting with https://.