home / mcp / gitlab mcp server

GitLab MCP Server

First gitlab mcp for you

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_USE_OAUTH": "true",
        "GITLAB_PROJECT_ID": "12345",
        "GITLAB_READ_ONLY_MODE": "false",
        "GITLAB_OAUTH_CLIENT_ID": "YOUR_CLIENT_ID",
        "GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8888/callback",
        "GITLAB_OAUTH_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
        "GITLAB_PERSONAL_ACCESS_TOKEN": "YOUR_GITLAB_TOKEN"
      }
    }
  }
}

You can run the GitLab MCP Server to access GitLab data and perform common actions via a managed MCP interface. It provides various authentication options, transport modes, and toolsets to interact with GitLab programmatically from your editor, IDE, or code assistant.

How to use

To use this MCP server, you connect your MCP client or IDE integration to the server and choose an authentication method that fits your workflow. You can either authenticate with a Personal Access Token for traditional access or enable OAuth2 for browser-based, token-managed sign-in. After configuration, you can request operations such as listing projects, reading files, creating issues or merge requests, managing pipelines, and more, all within the scope you enable.

How to install

Prerequisites you need before installing: Node.js (for running the MCP via npx or npm), and optionally Docker if you prefer containerized deployments.

Install the MCP packages and set up your first configuration using the examples shown in the configuration blocks below. If you are using Docker, ensure Docker is installed and running on your host.

Additional sections

Configuration and security details are available to tailor the server’s behavior to your environment. You can enable OAuth2 for secure sign-in, switch to a read-only mode, and selectively enable toolsets such as issues, merge requests, pipelines, milestones, wiki, releases, and more. You can also configure automatic token refresh, session timeouts, and per-session authorization when remote authorization is enabled.

For multi-user scenarios, you can use remote authorization by passing per-session tokens via HTTP headers. In this mode, each session uses its own token, and tokens are cleaned up when sessions end. This requires Streamable HTTP transport and proper configuration of session timeouts and rate limits.

If you run with Docker, remember that Personal Access Tokens are recommended for containerized environments. OAuth may require browser interaction and a local callback server which can be challenging inside containers.

Connection configurations (MCP server entries)

The server can be connected using multiple explicit configurations. The following stdio configurations show how to start the MCP server with different authentication methods and options. Each entry uses the command and arguments needed to invoke the MCP, along with environment variables described in the configuration blocks.