home / mcp / gitlab mcp server

Gitlab MCP Server

Provides an MCP interface to manage GitLab resources across projects, merge requests, pipelines, and more via CQRS and multiple transports.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "structured-world-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@structured-world/gitlab-mcp"
      ],
      "env": {
        "GITLAB_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "https://gitlab.com"
      }
    }
  }
}

You can run an MCP server that connects to GitLab to expose 44 tools across 18 entity types using a CQRS architecture, OAuth 2.1, and multiple transport modes. This server lets you manage GitLab resources such as projects, merge requests, pipelines, wikis, and more through a consistent MCP interface while supporting multiple instances, transport options, and fine-grained configuration.

How to use

You will integrate this MCP server with an MCP client to query data and issue commands against GitLab resources. Use the per-instance configuration to connect to one or more GitLab instances, each with its own OAuth setup and rate limits. Choose a transport mode that fits your environment: stdio for local development, SSE or StreamableHTTP for networked deployments.

How to install

Prerequisites: Node.js version 24 or higher. You will also need a GitLab access token with the required scopes and the GitLab API URL for each instance.

1) Create a configuration file that defines how to start the MCP server for GitLab.

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@structured-world/gitlab-mcp"],
      "env": {
        "GITLAB_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "https://gitlab.com"
      }
    }
  }
}

Additional setup and usage notes

Configure per-instance settings to connect to multiple GitLab instances. You can enable or disable tool groups, apply filters to actions, and customize tool descriptions to fit your workflow.

Docker users can run the latest image in HTTP or stdio modes. The HTTP mode exposes a server URL for MCP clients, while the stdio mode runs locally with the provided environment variables.

Key feature highlights include auto-discovery of GitLab configuration from remotes, read-only mode for safe production operation, and fine-grained controls for security and performance.

Configuration and security

Use environment variables to supply sensitive data and per-instance settings. Support for TLS/HTTPS is available for production deployments. Securely manage OAuth credentials and tokens per GitLab instance.

Fine-grained control lets you enable or disable tool groups, filter specific actions, and customize descriptions to match your organization’s terminology.

Examples and deployment notes

Example deployment commands are available in the Docker section for HTTP and stdio modes. You can run the image ghcr.io/structured-world/gitlab-mcp:latest and pass the appropriate environment variables for your GitLab instance.

Troubleshooting and notes

If you encounter issues, verify that the GitLab token and API URL are correct for each instance. Confirm network access to the GitLab API and ensure the selected transport mode is compatible with your environment.