GitLab

v7.2.0Version Controlstable

This repository contains an implementation of a Model Context Protocol (MCP) server that exposes a subset of the [GitLab REST API](https://docs.gitlab.com/ee/api/) as callable tools. It is implemented in TypeScript using the official MCP SDK and runs

mcpmodel-context-protocolmcp-servergitlabgitlab-api
Share:
50
Stars
0
Downloads
0
Weekly
0/5

What is GitLab?

GitLab is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this repository contains an implementation of a model context protocol (mcp) server that exposes a subset of the [gitlab rest api](https://docs.gitlab.com/ee/api/) as callable tools. it is implemented...

This repository contains an implementation of a Model Context Protocol (MCP) server that exposes a subset of the [GitLab REST API](https://docs.gitlab.com/ee/api/) as callable tools. It is implemented in TypeScript using the official MCP SDK and runs

This server falls under the Version Control category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • create_or_update_file
  • search_repositories
  • create_repository
  • get_file_contents
  • push_files

Use Cases

GitLab REST API integration
Repository and CI/CD management
EllGree

Maintainer

LicenseMIT License
Languagetypescript
Versionv7.2.0
UpdatedOct 23, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @modelcontextprotocol/server-gitlab

Manual Installation

npx -y @modelcontextprotocol/server-gitlab

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use GitLab

The GitLab MCP server exposes a broad subset of the GitLab REST API as callable tools, letting AI assistants manage issues, merge requests, pipelines, files, and releases directly inside your editor or chat client. It connects to any GitLab instance — cloud or self-hosted — using a Personal Access Token with api scope. Teams use it to automate code review workflows, query CI/CD pipeline status, search repositories, and post inline MR comments without leaving their AI assistant.

Prerequisites

  • Node.js 18 or higher installed
  • GitLab Personal Access Token with 'api' scope (Settings → Access Tokens in GitLab)
  • Git installed to clone the repository
  • An MCP-compatible client such as Claude Desktop or Claude Code
1

Clone the repository

Clone the gitlab-mcp repository from GitHub and enter the project directory.

git clone https://github.com/EllGree/gitlab-mcp.git
cd gitlab-mcp
2

Install dependencies and build

Install Node.js dependencies and compile the TypeScript source to JavaScript.

npm install
npm run build
3

Create a GitLab Personal Access Token

In GitLab, go to your user Settings → Access Tokens. Create a token with the 'api' scope. Copy the token — you will need it in the next step. If using a self-hosted GitLab instance, note your instance URL as well.

4

Set environment variables

Export your GitLab credentials so the server can authenticate. GITLAB_API_URL is optional and defaults to https://gitlab.com.

export GITLAB_PERSONAL_ACCESS_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
export GITLAB_API_URL=https://gitlab.com  # optional, change for self-hosted
5

Configure your MCP client

Add the server entry to your MCP client config, pointing to the built index.js file. Use the absolute path to the cloned repository.

6

Verify the connection

Start your MCP client and confirm the gitlab server appears in the connected servers list. Try a simple query such as listing your projects to confirm authentication is working.

GitLab Examples

Client configuration

Add this to your claude_desktop_config.json (Claude Desktop) or ~/.claude/settings.json (Claude Code). Replace the path with the absolute path where you cloned the repo.

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": ["/absolute/path/to/gitlab-mcp/index.js"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx",
        "GITLAB_API_URL": "https://gitlab.com"
      }
    }
  }
}

Prompts to try

Example prompts that exercise the GitLab MCP tools once connected.

- "List all open merge requests assigned to me in the my-org/backend project"
- "Show me the diff for MR !42 in my-org/backend"
- "Search for usages of deprecated_function in the my-org/frontend repository"
- "Get the latest CI/CD pipeline status for the main branch of my-org/api"
- "Create a comment on issue #100 in my-org/backend saying the fix has been deployed"

Troubleshooting GitLab

Authentication error: 401 Unauthorized

Verify that GITLAB_PERSONAL_ACCESS_TOKEN is set correctly and that the token has the 'api' scope. Tokens with only 'read_api' scope cannot perform write operations.

Connection refused when using a self-hosted GitLab instance

Set GITLAB_API_URL to your instance's API base URL, e.g. https://gitlab.mycompany.com. Ensure the server running the MCP process can reach that host over the network.

Module not found error when starting the server

Run 'npm install && npm run build' again from the gitlab-mcp directory. The index.js file is generated by the build step and will not exist in a fresh clone.

Frequently Asked Questions about GitLab

What is GitLab?

GitLab is a Model Context Protocol (MCP) server that this repository contains an implementation of a model context protocol (mcp) server that exposes a subset of the [gitlab rest api](https://docs.gitlab.com/ee/api/) as callable tools. it is implemented in typescript using the official mcp sdk and runs It connects AI assistants to external tools and data sources through a standardized interface.

How do I install GitLab?

Install via npm with the command: npx -y @modelcontextprotocol/server-gitlab. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with GitLab?

GitLab works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is GitLab free to use?

Yes, GitLab is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Version Control MCP Servers

Explore all version control servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-gitlab"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use GitLab?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides