GitLab MCP Server
MCP server by zereight Community
Connects AI assistants to GitLab so they can work with projects, merge requests, issues, pipelines, wiki, releases, tags and milestones. It suits developers and teams who want agent workflows on GitLab from chat.
Install GitLab MCP Server
Built from the published package, never by AI.
claude mcp add gitlab-mcp-server -- npx -y @zereight/mcp-gitlabRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"gitlab-mcp-server": {
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"gitlab-mcp-server": {
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"gitlab-mcp-server": {
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add gitlab-mcp-server -- npx -y @zereight/mcp-gitlab{
"mcpServers": {
"gitlab-mcp-server": {
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add gitlab-mcp-server npx -y @zereight/mcp-gitlabGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the gitlab-mcp-server block.
About
The GitLab MCP Server, published as @zereight/mcp-gitlab, gives AI assistants structured tools for GitLab. It covers projects, merge requests, issues, pipelines, wiki, releases, tags and milestones. It runs over stdio, SSE or Streamable HTTP, so it can serve local IDE clients or a shared remote server.
By default it loads 40 tools: 38 core tools plus discover_tools and help. The assistant calls discover_tools to activate a category, such as pipelines or wiki, for the current session. Authentication uses a personal access token, a local OAuth browser flow, an MCP OAuth proxy, or per-request remote authorization. It is aimed at developers and teams who use AI agents with GitLab, including self-hosted instances.
Written from the project's README and checked against it.
Tools it gives your assistant
list_merge_request_changed_filesLists the files changed in a merge request as a first review step.get_merge_request_file_diffFetches diffs for merge request files, in batches after the file list.get_pipeline_job_outputReads pipeline job output with pagination.discover_toolsLists tool categories and activates one for the current session.helpAlways-on tool included in the default 40-tool set.execute_graphqlRuns GraphQL queries against GitLab, listed in the total tool count.
What you need
- GitLab personal access token or OAuth setup
- GitLab API URL, for example https://gitlab.com/api/v4 or a self-hosted instance
- npm or Homebrew to install the zereight-mcp-gitlab binary
| Setting | Needed | What it is |
|---|---|---|
GITLAB_Environment variable, secret | Optional | GitLab personal access token for local stdio use. A non-empty value overrides GITLAB_PERSONAL_ACCESS_TOKEN_FILE. One of this token, GITLAB_PERSONAL_ACCESS_TOKEN_FILE, GITLAB_JOB_TOKEN, GITLAB_AUTH_COOKIE_PATH, or GITLAB_USE_OAUTH=true must |
GITLAB_Environment variable | Optional | Path to a file that contains the personal access token. Read once at startup and trimmed. Ignored when GITLAB_PERSONAL_ACCESS_TOKEN or --token is non-empty. A missing, unreadable, or empty file stops startup. Does not replace job token, OAu |
GITLAB_Environment variable, secret | Optional | Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI. |
GITLAB_Environment variable | Optional | Optional path to a GitLab authentication cookie file for cookie-based authentication. |
GITLAB_Environment variable | Optional | Set to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file. |
GITLAB_Environment variable | Optional | GitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT. |
GITLAB_Environment variable | Optional | Command that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID. |
GITLAB_Environment variable | Optional | GitLab API base URL. Use https://gitlab.com/api/v4 for GitLab.com or your self-managed GitLab API URL. Default: https://gitlab.com/api/v4 |
GITLAB_Environment variable | Optional | Optional comma-separated list of GitLab project IDs that this server is allowed to access. |
GITLAB_Environment variable | Optional | Tool exposure. Allowed values are readonly, modify, and full. Unset uses full. readonly keeps read-only tools. modify blocks delete and teardown tools, except that the opt-in gitlab_api_request still allows POST, PUT, and PATCH. |
GITLAB_Environment variable | Optional | Optional comma-separated toolset ids (projects, issues, merge_requests, …). Unset keeps the lean core default plus discover_tools. Do not set all unless you accept loading ~all schemas (~73k tokens). |
GITLAB_Environment variable | Optional | Optional comma-separated list of individual tool names to add on top of enabled toolsets. |
GITLAB_Environment variable | Optional | Optional regular expression used to hide matching tools from the server. |
GITLAB_Environment variable | Optional | Optional comma-separated list of tool names that require explicit approval before execution. |
GITLAB_Environment variable | Optional | Optional comma-separated list of tool names to hide from tools/list. |
NODE_Environment variable | Optional | Set to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates. |
GITLAB_Environment variable | Optional | Optional path to a custom CA certificate file for self-managed GitLab instances. |
GITLAB_Environment variable | Optional | Set to true to mask text tool results and returned errors using built-in or configured rules. Default: false |
GITLAB_Environment variable | Optional | Optional path to a response-masking JSON configuration file. |
GITLAB_Environment variable | Optional | Optional protected server-owned JSON file containing managed masking policies. |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Review the changed files in merge request 123 in group/project.
- Show the output of a failed pipeline job in my project.
- Activate the wiki tools and list the pages in my GitLab project.
Good to know
- Setting GITLAB_TOOLSETS=all loads about 73k schema tokens, so the source advises against it.
- The api toolset (gitlab_api_request) bypasses group and project allowlists and per-tool safety checks, and prompt injection can drive it.
- Destructive tools in the CLI need the --yes flag.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to GitLab MCP Server
All alternatives →Turns GitHub repositories into architecture diagrams, written explanations, Mermaid source and narrated explainer videos. Built for developers who want to understand a codebase, and for AI agents that need to read one.
Mocks, records, and chaos-tests HTTP(S) dependencies for development and testing. One port serves many protocols, including gRPC, WebSockets, and LLM chat APIs. Built for developers and testers who need stand-in services during tests.
Provides MCP server and CLI tools that let AI coding agents build, test and manage iOS and macOS projects with Xcode and simulators. It is aimed at developers working on Apple platform apps.
Creates editable draw.io diagrams in AI chat from Mermaid, PlantUML, CSV or draw.io XML. Built for people who want diagrams from text prompts that stay editable in draw.io.
Indexes your code, git history, tests and decisions on your machine so AI coding agents can query the index instead of re-reading files. Built for developers who want fewer files opened and clearer answers about change risk and code health.
Gives your AI assistant hosted codebase intelligence for repos indexed on repowise.dev. Use it to ask how code works, what a change may break, and which tests to run.
Compare with GitDiagram, mockserver or XcodeBuildMCP
GitLab MCP Server: common questions
Why does the server show only about 40 tools?
The default core toolset is 38 tools plus discover_tools and help. Each listed schema is sent to the model at session start, so the default keeps the token cost low. The assistant can call discover_tools to activate more categories.
What is the difference between local OAuth, MCP OAuth and remote authorization?
Local OAuth opens a browser on the same machine as the server. MCP OAuth is for a public HTTPS server and clients such as Claude.ai. Remote authorization forwards the caller's PAT or job token without an OAuth flow.
How can I reduce large tool responses?
Pass jmespath on a tool call to filter JSON results. You can also set GITLAB_MCP_COMPACT_RESULTS=true so oversized replies become a preview plus a CLI command for the full payload.
How do I install GitLab MCP Server?
In Claude Code run claude mcp add gitlab-mcp-server -- npx -y @zereight/mcp-gitlab. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is GitLab MCP Server the official server?
GitLab MCP Server is a community project by zereight, not verified by a company domain.
Is GitLab MCP Server free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is GitLab MCP Server safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to GitLab MCP Server?
Similar MCP servers: GitDiagram, mockserver, XcodeBuildMCP, draw.io.
Does GitLab MCP Server work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
