GitLab MCP server

Integrates with GitLab to enable repository management, file operations, issue tracking, and merge request handling using a TypeScript implementation configured with a personal access token.
Back to servers
Provider
Harsh Maur
Release date
Mar 18, 2025
Language
TypeScript
Package
Stats
889 downloads
1 star

The GitLab MCP Server allows your Claude AI assistant to interact with GitLab repositories, providing access to issues, merge requests, and other GitLab resources through the Model Context Protocol standard.

Installation

Using Smithery (Recommended)

For Claude Desktop users, you can install the GitLab MCP Server automatically via Smithery:

npx -y @smithery/cli install @harshmaur/gitlab-mcp --client claude

Manual Installation

You can run the server directly with npx:

npx @harshmaur/gitlab-mcp

Configuration

Required Environment Variables

Before running the server, you need to set the following environment variables:

GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token
GITLAB_API_URL=your_gitlab_api_url  # Default: https://gitlab.com/api/v4

Usage

With Claude App, Cline, or Roo Code

When using with Claude App and similar clients, set up your API key and URLs in your configuration:

{
  "mcpServers": {
    "GitLab communication server": {
      "command": "npx",
      "args": ["-y", "@harshmaur/gitlab-mcp"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "your_gitlab_api_url"
      }
    }
  }
}

With Cursor

When using with Cursor, you can set up environment variables and run the server as follows:

env GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token GITLAB_API_URL=your_gitlab_api_url npx @harshmaur/gitlab-mcp

Configuration Parameters

  • GITLAB_PERSONAL_ACCESS_TOKEN: Your GitLab personal access token
  • GITLAB_API_URL: Your GitLab API URL (Default: https://gitlab.com/api/v4)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later