GitLab MCP Server

Manage GitLab repos, issues, merge requests, and code from your AI assistant

By Anthropic (official) official git code

The GitLab MCP Server connects Claude and other MCP-compatible agents directly to the GitLab API. Search repositories, open issues, create merge requests, read and write file contents, and manage branches — all from within your AI chat session. Works with both gitlab.com and self-hosted GitLab instances.

Installation & Configuration

Add this block to your claude_desktop_config.json (or your agent framework's MCP config file):

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gitlab"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

The GITLAB_API_URL environment variable is optional and defaults to https://gitlab.com/api/v4. Override it to point at your self-hosted instance.

Config file location:

Generate a Personal Access Token: GitLab → User Settings → Access Tokens → create a token with api scope (or read_api for read-only).

Available Tools (10)

Use Cases

Gotchas

Security Note

A token with api scope can read and write to every repo in your account, create/delete branches, open MRs, and fork projects. Treat it like a password. Prefer a project-scoped token with the minimum required permissions, and never commit the token value to any repository.

Source & Documentation

GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/gitlab

Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io

MCP Setup Pack — $15
20 ready-to-paste server configs + installer + doctor script
Get the Pack →
← Back to MCP Server Directory