# Run agents with GitLab

GitLab AI agents on Rush: the GitLab sign-in clones a gitlab.com repository into a run, and GitLab's MCP server is the connection a run names.

[Connect GitLab](https://cloud.getrush.ai/console/settings/?section=connections) in the console under Settings → Connections.

## What an agent can do in GitLab

Work on repositories and open merge requests.

Work with GitLab projects: search and read issues, merge requests, pipelines and code, and create issues and merge request comments.

## Jobs on Rush that use GitLab

- [What Changed in This Release, in Words Support Can Use? A Payroll Software Company Briefs Its Support Team on Each GitLab Release](https://getrush.ai/run/brief-support-on-each-release/gitlab/)
- [Report Stale GitLab Merge Requests](https://getrush.ai/run/merge-request-report/gitlab/)
- [Find Flaky GitLab Pipeline Jobs](https://getrush.ai/run/pipeline-failure-report/gitlab/)

## How GitLab connects

GitLab is a built-in app: you sign in on GitLab's own page, through Rush's own app, so you register no OAuth app.

GitLab also lists a remote MCP server, published by GitLab, at `https://gitlab.com/api/v4/mcp`, a separate connection from the sign-in. Connecting it signs in through the MCP OAuth flow on GitLab's side.

From GitLab: [GitLab's MCP documentation](https://docs.gitlab.com/user/model_context_protocol/mcp_server/).

Connect it once in the console under Settings → Connections, or from your server with `POST /me/connections`. The sign-in finishes in a browser signed in to the console as the same person, and a link not finished within 10 minutes expires.

The GitLab sign-in is not named in a run's `connections`; a run that names it is refused `CONNECTION_NOT_READY`. It is the account that clones a `https://gitlab.com/<group>/<project>` repository in the run's `resources` (`…/-/tree/<branch>` at a branch). Rush checks before the run starts that the account can push there and the branch exists. With no GitLab sign-in the run is refused `CONNECTION_NOT_READY`; with two, the resource names one as its `connection`, or the run is refused `CONNECTION_AMBIGUOUS`. A saved agent may name one GitLab sign-in, and its runs clone with that account unless the resource names another; a run of it with no gitlab.com repository fails `CONNECTION_UNAVAILABLE`.

The MCP server is the connection a run names: connect it as `gitlab-mcp` and send `"connections": ["gitlab-mcp"]`, or its id from `GET /me/connections`, and the agent can use GitLab's MCP tools. A name that matches the sign-in too is refused: `CONNECTION_NOT_READY` when it matches the sign-in alone, `CONNECTION_AMBIGUOUS` when it matches both.

The GitLab MCP server, the connection a run names:

```http
POST https://api.phoenix.so/me/connections

{
  "type": "mcp",
  "name": "gitlab-mcp",
  "url": "https://gitlab.com/api/v4/mcp"
}
```

It is named `gitlab-mcp`, apart from the sign-in, so a run that names it matches the server alone.

The GitLab sign-in, the account that clones a repository:

```http
POST https://api.phoenix.so/me/connections

{
  "type": "app",
  "name": "gitlab"
}
```

## Whose GitLab account the agent uses

Your GitLab connection is personal: it belongs to the person who signed in. A run started in the console uses that person's GitLab, and a run started with an API key uses the GitLab of the member who created the key.

To act for your own app's users, make each user an agent from your template and show them, signed in to your app, the sign-in link `POST /o/{org}/agents/{agent}/connections` returns. They sign in to their own GitLab, and that agent's runs use their account and nothing else: never yours, never another user's.

## More Developer Tools integrations

- [n8n](https://getrush.ai/integrations/n8n/)
- [Postman](https://getrush.ai/integrations/postman/)
- [Jam](https://getrush.ai/integrations/jam/)

## Frequently asked questions

### How do I connect GitLab to Rush?

Open Settings → Connections in the console and connect GitLab, or send `POST /me/connections` with `{"type":"mcp","name":"gitlab-mcp","url":"https://gitlab.com/api/v4/mcp"}` and open the `authorize_url` it returns while signed in to the console. The connection reads `pending` until the sign-in finishes, then `connected`.

### How does a run use my GitLab account?

As the account that clones a gitlab.com repository the run names in `resources` (`https://gitlab.com/<group>/<project>`). It is not named in `connections`, which refuses it with `CONNECTION_NOT_READY`. To give the agent GitLab's MCP tools, name the MCP server instead: `"connections": ["gitlab-mcp"]`, or its id.

### What can an agent do in GitLab?

Work on repositories and open merge requests. Work with GitLab projects: search and read issues, merge requests, pipelines and code, and create issues and merge request comments. 3 published jobs use it; this page lists them.

### Can my app's users connect their own GitLab?

Yes. Make each user an agent from your template, and they sign in to their own GitLab through the link `POST /o/{org}/agents/{agent}/connections` returns. That agent's runs use their account alone.

## Keep reading

- [AI agents for engineering teams: every job and app for them](https://getrush.ai/solutions/engineering/)
- [How connections work: sign in once, then every run that names a connection gets it](https://getrush.ai/docs/concepts/connections/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Pricing: one price per member, hours shared by the team](https://getrush.ai/pricing/)
- [How Rush compares with other cloud agents](https://getrush.ai/compare/)
- [Every app and MCP server Rush connects to](https://getrush.ai/integrations/)
