In short.
GitLab agents is a Cursor Agent SDK guide for developers connecting AI agents to GitLab, and its examples require custom code before they form a working integration. It shows how merge requests, mentions and pipeline failures can start model turns and write results back to a project. Useful implementation details include draft filtering, shared merge request sessions, completion guards and write targets drawn from event state. GitLab.com users on Cursor hosting also get an account-based connection option. The page does not establish SDK version compatibility, operating costs, review accuracy or successful pipeline diagnosis. Nothing was executed, and the integration's behavior was not independently assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete documentation page at [https://cursor.com/docs/agent-sdk/guides/gitlab.md], retained as selected-page.txt and captured at 2026-11-14T21:09:35.360Z. Its source revision is sha256:57fc701db376315487628d9436372a5c1b86388bb2e912f5c7db06a64f71d413. All supplied prose, code examples, replay commands and the sitemap reference are covered. Linked deployment, channel-reference, CLI-reference and sitemap pages are excluded. No explicit license notice appears in the supplied page. Nothing was executed; authentication enforcement, API writes, session behavior, replay behavior and model output quality remain unverified in operation.
The overview
identity
The resource is the GitLab agents documentation guide at [https://cursor.com/docs/agent-sdk/guides/gitlab.md]. It teaches a Cursor Agent SDK integration through TypeScript examples and CLI commands.
The examples import gitlabChannel and related helpers from @grok/agent-sdk/channels/gitlab. The @grok/agent-sdk scope in those imports does not obviously match the Cursor name, and the page provides no installation instructions. This is instructional material for building an agent, rather than a ready-to-install GitLab bot.
assessment
The guide is useful for understanding the path from a GitLab event to a model turn and then to a project update. Its examples address practical details such as avoiding replies to the agent's own notes and ignoring intermediate tool-call completions.
Treat it as an implementation starting point. It does not provide the complete application, write-helper implementations or evidence of review and triage quality.
users
The likely audience is developers and maintainers who want merge request reviews, mention-triggered assistance or investigation of failed pipelines inside GitLab.
Beginners will need familiarity with TypeScript, webhooks, API tokens and application deployment. Experienced developers can focus on event filtering, authentication and session state, but must resolve operational requirements beyond the examples.
capabilities
gitlabChannel exposes onMergeRequest, onNote and onPipeline handlers for GitLab.com or a self-managed GitLab server. The examples fetch merge request diffs, post a finished review as a note, answer notes mentioning the agent and start triage after a pipeline fails.
Events and notes belonging to one merge request resume the same session. The CLI examples also support replaying events against a local agent and saving payloads as fixtures.
Using it
requirements
The webhook approach needs an agent deployment, a configured project list, a project webhook and a matching webhook secret. The guide says ctx.gitlab uses GITLAB_TOKEN for API access. A self-managed GitLab server also needs apiBaseUrl.
For GitLab.com on Cursor hosting, cursorAccount can carry events and ctx.gitlab calls through the signed-in Cursor account. The example write helpers are separately described as using GITLAB_TOKEN. Minimum SDK and runtime versions, token scopes and account or plan requirements are not specified.
The correct installable package name and installation source are not stated on this page; readers should confirm them in Cursor's official installation documentation before installing anything.
mechanism
A GitLab event reaches the channel, and its handler can ignore it by returning null or return a result containing auth or task. Returning a result with an auth field, built in the examples with defaultGitLabAuth(ctx), starts a model turn running as the event sender. A task runs host code and can start the model turn through send.
Completion and failure handlers perform follow-up API writes. Stored event state supplies the project, merge request or commit target. In the pipeline example, host code controls which commit receives the triage status, so the model does not choose the write destination.
setup
Configure gitlabChannel with the permitted projects and a named webhook secret, then point the project webhook at the deployed GitLab channel endpoint using the same secret. Set apiBaseUrl when connecting to self-managed GitLab. The page states that Cursor hosting rejects a wrong webhook secret with HTTP 401 before the agent receives the delivery.
The GitLab.com account-based option on Cursor hosting can replace the project webhook. Add the event handlers needed for the intended workflow and implement the API write helpers. Detailed deployment, secret configuration and handler-reference instructions are linked from the page, but their contents are outside this guide.
example
The merge request example ignores drafts and starts a review only when a request opens, reopens or receives an update with oldrev present. It fetches the latest diffs with listMergeRequestDiffs and passes their JSON representation into the model's context.
When a message completes, the handler skips evaluation sessions, tool-call completions and empty output. It then posts the text through a developer-written postMergeRequestNote helper using the stored project and merge request. The separate note handler ignores the agent's username and responds only when its configured mention appears.
Assessment & evidence
limitations
postMergeRequestNote and setPipelineTriageStatus are helpers the developer must write. The page does not show their implementations or explain retry handling, duplicate deliveries, rate limits, token scopes or comprehensive permission enforcement.
The pipeline example marks triage as successful when the model turn completes and failed when the turn fails. That status does not establish that the original pipeline was repaired or passed. The example supplies a pipeline identifier but does not show how failed-job logs are retrieved.
No execution results, review-accuracy measurements or demonstrated diagnoses are supplied. Operational reliability and output quality remain unassessed.
reasoning
The guide's practical value comes from making event selection and external writes explicit. Developers can see when a model turn starts, which completions cause writes and how the destination comes from event state.
These patterns provide a useful basis for implementation review, but they do not establish production reliability. The recommendation is to use the guide for its integration structure; claims about automation quality would require evidence beyond the supplied examples.
alternatives
The guide offers two connection approaches: project webhooks with configured secrets, or cursorAccount for GitLab.com on Cursor hosting. The account-based approach removes the project-webhook setup for that supported combination.
The page does not compare competing SDKs, ready-made review bots or other GitLab automation approaches. Their relative features, costs and maintenance burden are unknown from this evidence.
evidence
The evidence consists of the complete GitLab agents page at [https://cursor.com/docs/agent-sdk/guides/gitlab.md], including its connection instructions, TypeScript samples and replay commands. It supports descriptions of documented behavior and visible example logic.
The page supplies no measured review accuracy, triage outcomes or end-to-end execution results. Nothing was executed, and linked documentation was not assessed.
Access & freshness
costs
The page provides no prices, free allowances, usage limits or billing terms. Model usage charges, hosting costs and any required GitLab or Cursor plan costs are unknown. A total operating-cost estimate cannot be established from this guide.
rights
The supplied page contains no explicit license or reuse notice for its prose, code examples or SDK. Permission to redistribute those materials is not established by this evidence. Applicable SDK licensing and service terms are also unknown.
freshness
The documentation snapshot was captured on 2026-11-14 at 21:09:35.360 UTC. The page gives no publication date, last-update date or SDK version.
Compatibility with a particular installed release and changes after that capture are unknown. The capture date establishes when the text was retained, rather than when the examples were last validated.
actions
Before adopting the examples, confirm the correct package name and installation source in Cursor's official installation documentation, verify that the intended release exposes the documented imports, choose the appropriate connection method and establish the required permissions. Implement the write helpers and define what a useful review or triage response should contain.
Use a development project to assess event filtering, mention handling, write destinations and completion or failure statuses. The guide proposes agent-sdk dev followed by GitLab replay commands, including failed-pipeline replay and fixture capture. Their execution and results remain unassessed.
