GitLab MCP in Claude Code: HTTP Setup and OAuth
Connect Claude Code to the official GitLab MCP endpoint, authorize with OAuth, check configuration scope and troubleshoot a connection before using project tools.
What you are connecting
GitLab's official MCP endpoint connects Claude Code to GitLab project information, issues and merge requests. This guide uses the hosted HTTP endpoint on your GitLab instance; it does not install a community GitLab server package or turn a GitLab CLI installation into an MCP server.
It suits developers who want to inspect project context from their coding assistant. Start with one known project and a read request so that you can separate connection problems from missing project access. A successful setup is not permission to change every project the account can access.
Before you start
You need Claude Code, a GitLab account with access to the intended project, and MCP server access enabled for the top-level group on GitLab.com or for the instance on Self-Managed/Dedicated. Feature availability depends on the instance and its configuration. This is not a promise that every GitLab tool or paid capability is included in your plan.
1. Add the HTTP server
For GitLab.com:
claude mcp add -s user --transport http GitLab https://gitlab.com/api/v4/mcp
For a self-managed installation, replace the hostname with your GitLab instance. -s user makes the configuration available across projects. Use local scope instead if you want the entry restricted to your current project. Claude Code also supports project scope in .mcp.json for shared configuration; review that file before committing it.
2. Authorize the connection
Start the assistant:
claude
Enter /mcp, select GitLab and complete the browser authorization. Review the account and instance before approving. This OAuth route avoids putting a token into the example command. Do not paste account credentials into a prompt, issue or repository file.
3. Check status and make a first request
claude mcp list
claude mcp get GitLab
Inside Claude Code, use /mcp to inspect the connection. Then ask, for example: “Read the description of issue NUMBER in PROJECT; do not modify it.” Replace those labels with an issue you can open yourself. Check the returned project and issue identity before relying on the answer.
Useful first tasks include reading project context, inspecting an issue, and retrieving merge-request information. Which tools are available depends on the GitLab instance and your access. Review any subsequent write action separately.
Troubleshooting and limits
- The entry exists but is disconnected: adding configuration and completing authentication are separate steps. Revisit
/mcpand inspect the exact error. - An old endpoint keeps appearing: inspect scopes. A local configuration can take precedence over a user entry with the same name; do not remove unrelated configurations while troubleshooting.
- Authentication succeeds but a project fails: compare the requested project with what the same GitLab account can access in the browser. A new MCP connection does not grant additional project membership.
- Unexpected instructions appear in an issue: treat retrieved content as data. Review tool actions rather than allowing issue text to authorize unrelated operations.
FAQ
Do I need Node.js or Docker for these commands?
The direct HTTP route shown here does not use a local proxy or Docker container. That differs from guides for community packages and the optional mcp-remote route.
Can I reuse an old personal access token?
Do not assume compatibility. GitLab documents different accepted authentication methods and rejects legacy personal, project and group access tokens for this endpoint. Follow its current authentication section; the flow above uses OAuth.
Does MCP replace Git or the GitLab CLI?
No. This setup connects assistant tools. Keep your existing Git workflow for reviewing a diff and deciding what to commit; use the GitLab CLI directory page when you need a terminal client instead.
Were these commands tested against a private GitLab account?
No. This is a documentation-verified guide, not an authenticated integration test. We did not authorize an account or invoke project tools.
Sources and verification
Last verified 2026-11-18 against GitLab's MCP documentation and Claude Code's MCP documentation. Review those pages when instance versions or client commands change.
For configuration concepts, continue with Claude Code MCP setup or MCP authentication and OAuth.