GitLab
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
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
Maintainer
Works with
Installation
NPM
npx -y @modelcontextprotocol/server-gitlabManual Installation
npx -y @modelcontextprotocol/server-gitlabConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-mcpInstall dependencies and build
Install Node.js dependencies and compile the TypeScript source to JavaScript.
npm install
npm run buildCreate 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.
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-hostedConfigure 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.
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.
GitLab Alternatives — Similar Version Control Servers
Looking for alternatives to GitLab? Here are other popular version control servers you can use with Claude, Cursor, and VS Code.
Ruiyu MA
★ 30.1kConnect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
GitMCP
★ 8.1kTransforms any GitHub repository or GitHub Pages site into a documentation hub for AI assistants using the Model Context Protocol. It allows AI tools to access real-time code and documentation to prevent hallucinations and provide accurate API usage
GitHub Codemunch
★ 1.8kA token-efficient MCP server for exploring GitHub repositories using tree-sitter AST parsing to extract symbol signatures and summaries. It enables users to search and retrieve specific code components while significantly reducing token consumption c
Azure DevOps MCP Server
★ 1.7kThis server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standard
GitHub Official
★ 1.2kOfficial GitHub integration with comprehensive API coverage
Azure DevOps
★ 367Enables interaction with Azure DevOps through Cursor chat, providing tools to manage builds, pipelines, work items, sprints, and board operations. Supports secure authentication via Personal Access Tokens and allows natural language-driven DevOps tas
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.
Set Up GitLab in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.