All integrations
GitLab logoDeveloper ToolsBuilt-in app and MCP serverFor engineering teams

Run agents with GitLab

The GitLab sign-in clones a gitlab.com repository named in a run's resources; GitLab's MCP server is the connection a run names.

Connect GitLabOpens Settings → Connections in the console.

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

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.

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:

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:

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

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