A GitLab AI agent that reviews merge requests
Mention the agent on an issue. It reads the diff of the merge request, comments on the lines, approves it or asks for changes, and reports back on the issue.
GitLab puts planning, source control and CI/CD in one platform, on gitlab.com or on your own server.
- Tools
- 13: Review merge requests and merge them; list, create, update and comment on issues
- Key
- Access token
- Edition
- Free in Community
- Starts on
- Delegate, mention, chat or a schedule
- Board
- One-way or two-way issue sync
See each call the agent makes to GitLab
Every GitLab tool call is a step of the run, with what the agent sent and what came back.
- Agent
- @reviewer · Internal
- Trigger
- Mention
- Started
- Nov 21, 11:32
- Run
- #418
Result
Both review threads on !57 are resolved and it is approved, with one note on a test. The summary is in a reply on WEB-231.
What the agent did
- 11:32:08get_issue{"key":"WEB-231"}
- 11:32:11gitlab_list_merge_request_threads{"project":"acme/shop","mergeRequest":57}
- 11:32:14gitlab_list_merge_request_files{"mergeRequest":57}
- 11:33:02gitlab_resolve_merge_request_thread{"thread":"6a9c1f…"}
- 11:33:04gitlab_resolve_merge_request_thread{"thread":"b07e42…"}
- 11:33:21gitlab_review_merge_request{"event":"approve"}
- 11:33:36add_comment{"issue":"WEB-231"}
- 11:33:42The merge request is approved, and the summary is on WEB-231.
gitlab_review_merge_request11:33:21
Input{
"project": "acme/shop",
"mergeRequest": 57,
"event": "approve",
"body": "Both comments are fixed.",
"comments": [{
"path": "src/cart/discount.test.ts",
"newLine": 31,
"body": "Add the guest cart here too."
}]
}Output{ "event": "approve", "comments": 1 }13 GitLab tools for merge requests and issues
Each tool is its own switch. An agent can review a merge request and still not merge it.
Issues
List Issues
List issues in a GitLab project, most recently created first.
gitlab_list_issuesCreate Issue
Create an issue in a GitLab project.
gitlab_create_issueUpdate Issue
Update an issue in a GitLab project: change its title or markdown body, or close and reopen it.
gitlab_update_issueComment Issue
Comment on an issue in a GitLab project.
gitlab_comment_issueMerge requests
List Merge Requests
List merge requests in a GitLab project, most recently created first.
gitlab_list_merge_requestsGet Merge Request
Read a merge request in a GitLab project: its markdown description, state, branches, head commit and merge status.
gitlab_get_merge_requestList Merge Request Files
List the files a GitLab merge request changes, with the unified diff of each file.
gitlab_list_merge_request_filesReview Merge Request
Submit a review of a GitLab merge request: approve it, request changes, or only comment.
gitlab_review_merge_requestList Merge Request Threads
List the comment threads of a GitLab merge request: the comments on lines of its diff and on the merge request itself, with whether each thread is resolved.
gitlab_list_merge_request_threadsReply Merge Request Thread
Reply in a comment thread of a GitLab merge request.
gitlab_reply_merge_request_threadResolve Merge Request Thread
Resolve a comment thread of a GitLab merge request, or reopen it with resolved false.
gitlab_resolve_merge_request_threadAccept Merge Request
Merge a GitLab merge request into its target branch.
gitlab_accept_merge_requestComment Merge Request
Comment on a GitLab merge request.
gitlab_comment_merge_requestConnect GitLab once for the team
Create an access token
A personal, project or group token with the api scope. A fine-grained token needs the Work Item and Merge Request permissions. It reaches only the projects the account can access.
Add it to the team
Leave the instance URL empty for gitlab.com, or enter your GitLab Self-Managed or Dedicated address. It’s a Plan checks the token before you save it.
Pick the tools
Add the GitLab tools for the team, then turn on the ones each agent may use.
Search tools
acme bot
Add credentialGitLab code review you can hand an agent
Mention
Mention @reviewer with a merge request link: it reads the diff and comments on the lines.
Column
When an issue moves to Ready to merge, @release merges its merge request if GitLab allows it.
Schedule
Every Monday at 9:00, @triage closes the GitLab issues that were fixed last week and says why.
GitLab project management with issue sync
Connect a repository to a project, and its issues come to the board. People and agents work on them there like on any other issue. The sync is free and needs no agent.
Set up for open-source maintainers- One-way sync
- New GitLab issues appear on the board. Close or reopen one there, and the repository issue follows.
- Two-way sync
- The same, and edits, labels, closing and reopening in the repository also update the board issue.
- Import
- Bring the open issues of the repository over at once. Issues already on the board are skipped.
- Labels
- Map each repository label to a project label or an issue type.
- Comments
- Copy new repository comments to the board issue. Comments made on the board stay there.
- Merge requests
- Branches, merge requests and their checks show on the issue they name. “Fixes KEY-42” closes it when the merge request merges into the default branch.
GitLab comes with the free edition
GitLab and 14 more integrations, on every agent trigger: delegate, mention, chat and schedules.
HTTP tools for services not on the list, agent workflows, and an agent that starts on every new issue.
See ProGitLab AI agent FAQ
Is this GitLab Duo?
No. GitLab Duo is GitLab’s own AI. This agent runs in your issue tracker, on the AI model you choose, and reaches GitLab through its API.
Does AI code review work with GitLab Self-Managed?
Yes, and with gitlab.com and GitLab Dedicated. Requesting changes needs GitLab 19.2 or newer; an older GitLab gets the comments without the block.
Can the agent approve and merge?
Yes, if you turn those tools on and the token’s account may approve. GitLab refuses a merge while its own rules block it, such as a failed pipeline or a missing approval.
Does it sync GitLab issues with the board?
Yes, through the repository connection in the project settings. New GitLab issues appear on the board, and an issue closed on the board closes in the repository. With two-way sync, edits, labels and state in the repository also update the board.
Is this the GitLab MCP server?
No. The agent calls the GitLab API with the team’s token. An external agent such as Claude Code, connected over MCP with an agent’s key, gets the same GitLab tools.
Does my GitLab need to be public?
No. Your It’s a Plan server calls it over https. If its address is private, name the host in SSRF_ALLOWED_HOSTS on that server.
Does the agent see my GitLab token?
No. It is stored encrypted on your server. The agent calls a tool by name and gets back only what the tool returns.
What does it cost?
The GitLab tools are free in the Community edition. You pay your AI provider for the model.
More integrations
- Jina AIRead a page as markdown, search the web and fact-check a statement.
- FirecrawlScrape, crawl and map websites, and pull structured data from pages.
- TelegramSend a message to a Telegram chat from your bot.
- SlackRead channels and threads, post messages and reply from your bot.
- ThreadsPublish posts, answer replies and read insights.
- InstagramPublish posts and reels, answer comments and read insights.
- NotionSearch, read and write Notion pages and answer their comments.
- BaserowRead, create, update and delete rows in your tables.
- Gitea / ForgejoReview and merge pull requests and work with issues on your own Git server.
- GitHubReview and merge pull requests, and work with issues and discussions.
- PDFRead a PDF from a link as markdown, with pdf-inspector. Needs no key.
- KeenableSearch the web and read pages. Works without a key.
- DataForSEOGet Google results, keyword data, backlinks and page audits.
- KieGenerate images, video, music and speech with Veo, Kling, Nano Banana and Suno.
- ExaPROSearch the web, read pages and answer with sources.
Give your first merge request to an agent
Try the free edition on your computer with one setup command.
Or deploy to Railway in one click