How to connect Claude or ChatGPT to GitLab (GitLab MCP server)
Short answer
Use GitLab's own MCP server: https://gitlab.com/api/v4/mcp, or /api/v4/mcp on your instance. It is generally available on every GitLab tier since 19.5. In Claude, add it as a custom connector or run claude mcp add in Claude Code. In ChatGPT, add it as a custom app in developer mode; full read-and-write access needs Business, Enterprise or Edu. Sign in with OAuth: GitLab refuses legacy personal access tokens here.
“Can you check whether my merge request passed?” is now something you can ask an AI assistant and get a real answer to. GitLab 19.5, released on 15 October 2026, made the GitLab MCP server generally available. It is GitLab’s own bridge for AI tools, built on the Model Context Protocol. Here is how to connect Claude and ChatGPT to it, what each one needs, and where it stops being the right tool.
What the GitLab MCP server is
It is an endpoint on your GitLab, /api/v4/mcp, that any MCP-compatible assistant can talk to:
- gitlab.com:
https://gitlab.com/api/v4/mcp - Self-managed or Dedicated:
https://<your-instance>/api/v4/mcp
Once connected, the assistant can work with your GitLab using your permissions: list and read merge requests and their diffs, comment, approve, merge or set auto-merge, and run, retry or cancel pipelines and jobs. Since 19.5 you can also choose which groups of tools (toolsets) it exposes.
It is on every tier — Free, Premium and Ultimate — since GitLab 19.2. On gitlab.com, each user gets 60 requests a minute on Free and 600 on Premium and Ultimate, shared across all their AI tools.
Before you connect: access and sign-in
Two things decide whether the connection works:
- MCP access must be allowed. On gitlab.com it is a setting on the top-level group, controlled by its Owners. GitLab is turning it on by default, but an Owner can switch it off. On self-managed GitLab, an administrator allows it for the instance.
- The right kind of token. The server accepts an OAuth token with the
mcpscope, which is what you get when an assistant signs you in, or a fine-grained personal access token with the MCP tool permission. It refuses legacy personal access tokens and project or group tokens with403 Forbidden, even ones with theapiscope.
In practice, OAuth is the easy path. The assistant registers itself with your GitLab, you approve one request in the browser, and you can revoke it any time under User settings › Applications.
Connect Claude
Claude (web and desktop app). Add GitLab as a custom connector:
- Go to Customize › Connectors, select + Add, then Add custom connector.
- Name it “GitLab” and enter the server URL, for example
https://gitlab.com/api/v4/mcp. - Continue, review the authentication settings, and select Add. Approve the request GitLab shows you.
Custom connectors are available on Claude’s Free plan (one custom connector), Pro, Max, Team and Enterprise. On Team and Enterprise, an Owner adds the connector under Organization settings › Connectors, and members then connect to it. Requests come from Anthropic’s servers, so a self-managed GitLab must be reachable from the internet.
Claude Code. One command, from GitLab’s own docs:
claude mcp add -s user --transport http GitLab https://gitlab.com/api/v4/mcp
Start claude, type /mcp, select GitLab and approve the request in your browser. Because Claude Code runs on your machine, it also reaches a GitLab that is only on your company network or VPN.
Claude Desktop can also run the server locally through mcp-remote (it needs Node.js 20 or later); GitLab’s docs have the exact configuration.
Connect ChatGPT
ChatGPT connects to MCP servers as custom apps in developer mode:
- Who can use it: OpenAI offers full MCP apps, including write actions, on ChatGPT Business, Enterprise and Edu, on the web. Pro users can connect read and fetch MCP servers. It is not available in the mobile apps.
- Turn it on: on Enterprise and Edu, under Settings › Apps › Advanced settings. On Business, a workspace owner or admin enables it under Workspace settings › Permissions & roles › Connected data.
- Add GitLab: go to Apps › Create, enter
https://gitlab.com/api/v4/mcp, choose OAuth, select Scan Tools, complete GitLab’s sign-in, then Create. In a workspace, an admin publishes it for others.
ChatGPT may ask you to confirm actions that change things. OpenAI notes that agent mode does not use custom apps, and that servers on a private network need its Secure MCP Tunnel. GitLab’s own docs don’t cover ChatGPT yet. If the automatic sign-in fails, GitLab lets you pre-register an OAuth application with the mcp scope for clients that can’t register themselves.
Codex (OpenAI’s coding agent) connects from your terminal. GitLab documents codex mcp add GitLab --url "https://gitlab.com/api/v4/mcp", plus one setting in ~/.codex/config.toml, followed by codex mcp login GitLab.
Use it safely
- Grant the least you need. Pick only the toolsets you use. If a fine-grained token is required, limit it to the projects involved.
- Watch for prompt injection. GitLab’s docs warn that an issue or merge request description can carry instructions meant for the AI. Use the tools on projects you trust, and read what the assistant is about to do before you confirm a write.
- Know how to cut it off. Revoke the assistant under User settings › Applications in GitLab, and remove the connector in Claude or ChatGPT.
What an assistant is good for, and what it isn’t
An assistant connected to GitLab is great at questions and quick actions: “summarise !482”, “which of my merge requests are blocked, and why?”, “retry the failed job on main”. It is weaker at two things a phone is often needed for. It doesn’t tell you when it is your turn, because it only acts when you ask. And reading a 300-line diff in a chat bubble is hard work.
That gap is what a GitLab app covers. MergeBell sends a push when a review is requested or your pipeline fails, opens straight onto a phone-sized diff, and puts approve and merge under your thumb. It is free on Google Play for Android, with iPhone coming soon. See also how to review a GitLab merge request on your phone and GitLab token scopes explained.
Frequently asked questions
Can Claude access my GitLab?
Yes, through GitLab's MCP server. Add https://gitlab.com/api/v4/mcp (or your instance's /api/v4/mcp) as a custom connector in Claude, or with claude mcp add in Claude Code, then approve the OAuth request GitLab shows you. Claude can then read merge requests, issues and pipelines and act on them with your permissions.
Can ChatGPT connect to GitLab?
Yes. In ChatGPT, add the GitLab MCP server as a custom app in developer mode. OpenAI offers full MCP apps, including write actions, on ChatGPT Business, Enterprise and Edu on the web; Pro can connect read and fetch MCP servers. Codex, OpenAI's coding agent, connects with codex mcp add.
Is the GitLab MCP server free?
Yes. It moved from Premium to Free in GitLab 19.2 and became generally available in 19.5, on gitlab.com, self-managed and Dedicated. On gitlab.com, requests are limited to 60 a minute per user on Free and 600 on Premium and Ultimate.
Why does the GitLab MCP server return 403?
Usually because of the token. The server accepts an OAuth token with the mcp scope or a fine-grained personal access token with the MCP tool permission, and rejects legacy personal access tokens and project or group tokens with 403. Also check that MCP access is allowed for your top-level group or instance.
Does it work with self-managed GitLab?
Yes, at https://your-instance/api/v4/mcp, once an administrator allows MCP access for the instance. Claude's web app and ChatGPT connect from their own servers, so the instance must be reachable from the internet; on a private network, use Claude Code, Claude Desktop or Codex on a machine that can reach it.
Sources
- GitLab docs — GitLab MCP server
- GitLab docs — GitLab MCP server tools
- GitLab docs — Allow access to the MCP server (top-level groups)
- GitLab 19.5 release notes
- Claude Help Center — Custom connectors using remote MCP
- OpenAI Help Center — Developer mode and full MCP connectors in ChatGPT
Checked against these pages on 17 October 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.
Do this from your phone with MergeBell
Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.
Get MergeBell for AndroidiPhone: email me at launch
On Google Play for Android 12 or later. The iPhone app is coming soon to the App Store. An independent app, not affiliated with GitLab Inc.