# GitLab MCP server for engineering teams

> A manager's playbook for a GitLab MCP server for engineering teams: one governed address in Cursor, with merging and pipeline control blocked.

**TL;DR** GitLab's connector in Elaichi is a native MCP connector: GitLab builds and runs the MCP server and its tools, and Elaichi handles sign-in, restrictions and the audit log in front of it. Each engineer connects their own GitLab account, so reads and writes run with their permissions. Block accept_merge_request, add_commit, send_duo_session_input and the rest for most roles, and keep the reads open.

## The situation

Your engineers already have Cursor. Some of them have wired up a GitLab MCP server on their own laptop, with their own token. The rest have not. You cannot see which. When someone asks Cursor why the pipeline on the release branch is red, the answer is good enough that the habit sticks. The habit spreads faster than any decision you make about it.

The question is not whether to allow it. The question is whether every engineer reaches GitLab as themselves, through one address you can audit. Merging and pipeline changes should be off for people whose job does not include them.

This is a playbook for a **GitLab MCP server for engineering teams** that runs through Elaichi. GitLab builds and runs the MCP server. Elaichi handles sign-in, access and audit in front of it.

## What a native MCP connector means here

The [GitLab connector](/connectors/gitlab/) in Elaichi is a native MCP connector. GitLab builds and runs the MCP server and its tools. Elaichi sits in front: it checks restrictions and OAuth scopes before a call leaves, and writes every call that runs to the audit log.

That distinction matters when something breaks. If a GitLab tool returns the wrong shape, that is GitLab's server. Elaichi's connector page in the console carries GitLab's support contact for exactly that reason. Elaichi does not write, test or fix a native MCP connector's tools. GitLab documents its own MCP server and the tools it exposes (checked November 2026, [GitLab's MCP server documentation](https://docs.gitlab.com/user/model_context_protocol/mcp_server/)).

What Elaichi does own is the part your security reviewer will ask about. MCP (Model Context Protocol) is the standard way an AI assistant calls tools in other apps. One address serves every organization: https://api.elaichi.ai/mcp, the same string for Claude, ChatGPT, Cursor and Microsoft Copilot. Which organization and which person a client reaches comes from the OAuth grant behind its token, not from the URL. The MCP specification sets out how that authorization works (checked November 2026, [the MCP specification on authorization](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization)).

The connector carries 47 tools and signs in with OAuth. Each engineer completes GitLab's own sign-in. A call through their connection therefore reaches GitLab with their GitLab permissions. GitLab's own roles decide what that account can do in each project (checked November 2026, [GitLab's permissions documentation](https://docs.gitlab.com/user/permissions/)). A protected branch they cannot push to stays protected. A project they cannot see stays invisible. The same per-person shape is what makes [HubSpot's MCP server respect each person's permissions](/blog/hubspot-mcp-server-user-permissions/).

## Which tools to leave open

Start from the reads, because the reads are the reason anyone wants this. For an engineering team working in Cursor, these are the tools that answer the questions people actually ask:

- `list_projects` and `get_project`, to find a repository by name rather than by guessing the path.
- `list_merge_requests` and `get_merge_request`, for "what is waiting on me" and "what changed in MR 412".
- `list_pipelines`, `get_pipeline` and `get_job`, for the red pipeline question.
- `list_commits` and `get_repository_file`, so the agent can read the code it is reasoning about instead of inventing it.
- `list_work_items` and `search`, for issues and for finding things by text.

That set covers triage, review preparation and debugging. None of it changes anything in GitLab. An engineer can ask Cursor to summarize the last ten commits on a branch, then open the file that keeps appearing in them. That needs nothing beyond this list.

## Which tools to block for most roles

Block the tools that change the repository, the review record or the issue trail. For a default engineering role, that means:

- `accept_merge_request`, which merges.
- `add_commit` and `add_branch`, which write to the repository.
- `fork_repository`, which creates a copy outside the review path you expect.
- `save_merge_request`, which changes the merge request record itself.
- `save_merge_request_review`, which writes a review on a merge request.
- `manage_pipeline`, which updates a pipeline's metadata or deletes a pipeline, and `save_pipeline`.
- `save_vulnerability` and `save_work_item`, which edit security and issue records.
- `link_work_items`, which changes the relationships between issues.
- `attach_scan_profile`, which changes security scanning configuration.
- `save_note`, which posts comments as the engineer.
- `start_duo_session` and `send_duo_session_input`, the second of which can answer or approve a pending Duo plan or tool call.

The argument for blocking `save_note` is the one people push back on. A comment feels harmless. It is not harmless when a model writes it under a human's name in a review thread other people treat as a human's judgment. If your team decides that review comments from an agent are acceptable, leave `save_note` open deliberately, after saying so out loud. The same question comes up for [Slack across a whole company](/blog/connect-slack-to-claude-for-the-whole-company/), where posting as a person is the tool everybody argues about.

The same applies to `send_duo_session_input`. Leaving it open means an agent can approve a pending Duo plan or tool call on the engineer's behalf. Say that out loud if you choose to leave it open.

Be firm about merging. GitLab's own protected-branch rules already stop most of it. But the rule is per project and per person, and it drifts. A restriction on the role is one place to look.

## How to write the restriction for a GitLab MCP server for engineering teams

In Elaichi, restriction targets are role or user only; the organization default is the absence of a rule, which means allow everything. To hold a whole engineering team to reads, write the rule on the role those engineers hold, or on each member.

Use a block rule naming those fifteen tools on the GitLab connector. A block list is the right shape here, because an allow rule changes everything. In Elaichi, once a role carries any allow rule, every connector and tool none of its allow rules names is blocked for that role. If your engineers also reach Sentry, Datadog and Slack through Elaichi, an allow rule on GitLab alone would cut them off from all three.

The trade-off runs the other way too. In Elaichi, a layer with only block rules has no allowlist, so everything it does not block passes it. If GitLab's server adds a tool later, your block list does not cover it until someone adds it. Read [MCP tool allowlist vs blocklist](/blog/allowlist-vs-blocklist-mcp-tools/) before you choose.

Two details about how blocks match. Elaichi stores each named tool's operation beside its name when the rule is saved. A block rule matches by name or by operation, so renaming a tool cannot slip it past a block. And a block on a connector also blocks every fork that declares descent from it. The mechanics are in [why blocks match tool names but allows don't](/blog/block-matches-name-allow-matches-operation/).

Writing and editing restrictions needs the restriction:manage permission and a plan that includes restrictions, which Gold and Black both do. A rule aimed at a single member also needs restriction:override.

## What engineers see when a blocked tool is refused

A restricted tool is left out of the tools Elaichi offers a client and cannot be called. Search still names it, flagged restricted, with no schema.

The refusal tells the caller whether the block comes from their role or from their own account. It also says an admin can lift it through an access request. It does not name the rule, who wrote it, or what else it covers. From the client, a grant with mcp:read or mcp:tools can file that request. Only a person in the Elaichi console can approve or deny it, under Governance, Access requests, and no AI surface can decide one.

That loop matters for a team. An engineer who genuinely needs `manage_pipeline` for a release does not file a ticket and wait a day. They ask from Cursor, and you approve or deny in the console. Approving creates an access grant that lifts that one connector or tool for that one person. Every other rule on their role keeps applying, including rules you add later.

## Setting it up with Cursor

Before anything else, a GitLab administrator or group owner has to turn on access to the GitLab MCP server. Nobody can connect until that is done (checked November 2026, [GitLab's MCP server documentation](https://docs.gitlab.com/user/model_context_protocol/mcp_server/)).

Cursor is one of the clients Elaichi's authorization server is written for. Cursor reads MCP servers from `.cursor/mcp.json` in a project and `~/.cursor/mcp.json` in the home directory. A remote server entry is defined with a `url` field (checked October 2026, [Cursor's MCP documentation](https://cursor.com/docs/mcp)). The value is https://api.elaichi.ai/mcp, the same for everyone.

From there each engineer signs in through their browser, picks the organization and approves the scopes on Elaichi's own consent screen. There is no client ID, secret or header to paste. Clients register themselves through OAuth dynamic client registration. The walkthrough is in [connect Elaichi to Cursor for a whole team](/blog/cursor-mcp-one-endpoint-vs-per-developer/).

If your team uses another client, the requirements are the same for all of them. A client needs OAuth dynamic client registration, PKCE with S256, and a browser sign-in. A client supporting those three should connect. Test it with one engineer before you tell forty people it works.

On the GitLab side, each engineer connects their own GitLab account through GitLab's OAuth 2.0 provider (checked November 2026, [GitLab's OAuth 2.0 documentation](https://docs.gitlab.com/api/oauth2/)). A connection someone shares runs on its owner's account, which is the wrong shape here. You want each engineer's own connection, so their own GitLab permissions apply and the audit log names the right person.

## What the audit log gives you afterwards

Every call that reaches execution is written to the audit log with the person, the connector, the connection and the MCP client. For a call from Cursor, the surface is recorded as mcp. The OAuth client's id is recorded too, so the console can name the client.

The row records what the call touched: the resource type, and the id taken from the one URL path argument that names the object. It records whether approval was required and how it was given, the outcome, and a result count for list and search calls. It does not record argument names or an argument count.

A call Elaichi refused at the scope check writes no entry, because that refusal happens before any executor runs. So the audit log is a record of what ran, not a complete record of what was attempted. Say that plainly when someone asks.

Audit history is kept for 90 days. For longer, forward it to your own log service. Logging destinations come with the Black plan, and Datadog is the destination that delivers.

## When you do not need this

Suppose your whole engineering team is four people who all have the same GitLab permissions, and nobody has installed an MCP server yet. Skip the restriction layer for now. Let people connect GitLab's own server directly and see what they actually use. Calls a client makes to GitLab's server directly do not pass through Elaichi, so Elaichi does not govern them. At four people you can see the whole picture by asking.

The case for one governed address starts when the answers diverge. A contractor should read but not merge. A new hire's access has to arrive and leave with their membership. A reviewer asks who ran what last quarter and you have nowhere to look. [When you don't need an MCP gateway yet](/blog/when-you-dont-need-an-mcp-gateway/) walks through the threshold honestly.

State one limit before anyone assumes otherwise. In Elaichi, connected tools are never listed one by one, however few there are. And Elaichi's MCP endpoint has no prompt-injection defense of its own: nothing on that path scans tool results for injection or second-guesses a call. A repository file or a merge request description carrying instructions is still a risk your client has to handle. [MCP tool poisoning](/blog/mcp-tool-poisoning/) covers what does and does not limit it.

For the wider picture of coding agents across an engineering org, see [MCP for coding agents](/blog/coding-agents-company-tools/) and the companion setup for [Claude Code with Jira, GitHub and Slack](/blog/claude-code-jira-github-slack-per-engineer/). For the governance layer underneath all of this, start at [MCP governance](/blog/mcp-governance/).

## FAQ

### Does Elaichi write and maintain the GitLab MCP tools?

No. GitLab is a native MCP connector in Elaichi's catalog, which means GitLab builds and runs the MCP server and its tools. Elaichi handles sign-in, access and audit in front of it. Reports about the tools themselves go to GitLab's support contact, shown on the connector's page in the Elaichi console.

### Can I stop engineers merging from Cursor but still let them read merge requests?

Yes. Write a block rule on the engineers' role naming the write tools on the GitLab connector, including accept_merge_request, add_commit, add_branch, save_merge_request, save_merge_request_review and manage_pipeline. Read tools such as list_merge_requests, get_merge_request, list_pipelines and get_repository_file are unaffected, because a block rule only blocks what it names.

### Whose GitLab permissions apply when an engineer asks Cursor about a repository?

The permissions of whoever's GitLab account the connection was made with. Each engineer connects GitLab with their own sign-in, so a project they cannot see in GitLab stays invisible through the connector. A connection someone shares runs on its owner's account instead, which is why per-person connections are the right shape for an engineering team.

### How long does a restriction change take to reach everyone?

Restriction, role and team-membership changes take effect within about two minutes. Revoking a share, disconnecting an account, removing a member and suspending a member are different: those stop working on the next call.

### What happens when an engineer needs a blocked tool for a release?

They can file an access request from their AI client, as long as the grant holds mcp:read or mcp:tools. An admin approves or denies it in the Elaichi console under Governance, Access requests; no AI client can decide one. Approving creates an access grant that lifts that one connector or tool for that one person, leaving every other rule on their role in place.

## Read next

- [Claude Code with Jira, GitHub and Slack, per engineer](/blog/claude-code-jira-github-slack-per-engineer/) — How to set up Claude Code with Jira, GitHub and Slack through one MCP address, so each engineer acts as themselves and destructive tools stay blocked.
- [HubSpot MCP server that respects user permissions](/blog/hubspot-mcp-server-user-permissions/) — A HubSpot MCP server respects each user's own permissions. Elaichi's HubSpot connector adds role-level blocks on delete tools and one cross-app audit log.
- [Connect Slack to Claude for the whole company](/blog/connect-slack-to-claude-for-the-whole-company/) — Connect Slack to Claude for the whole company: per-person connections, which Slack tools to block per role, and what the audit log keeps.
