Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 94
  • 2.1k stars
  • 166k a week
  • MIT
  • Updated

Install GitLab MCP Server

Built from the published package, never by AI.

claude mcp add gitlab-mcp-server -- npx -y @zereight/mcp-gitlab

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install GitLab MCP Server in Claude Code

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
SettingNeededWhat it is
GITLAB_PERSONAL_ACCESS_TOKENEnvironment variable, secretOptionalGitLab 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_PERSONAL_ACCESS_TOKEN_FILEEnvironment variableOptionalPath 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_JOB_TOKENEnvironment variable, secretOptionalOptional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.
GITLAB_AUTH_COOKIE_PATHEnvironment variableOptionalOptional path to a GitLab authentication cookie file for cookie-based authentication.
GITLAB_USE_OAUTHEnvironment variableOptionalSet to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file.
GITLAB_OAUTH_CLIENT_IDEnvironment variableOptionalGitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT.
GITLAB_OAUTH_TOKEN_SCRIPTEnvironment variableOptionalCommand that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID.
GITLAB_API_URLEnvironment variableOptionalGitLab 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_ALLOWED_PROJECT_IDSEnvironment variableOptionalOptional comma-separated list of GitLab project IDs that this server is allowed to access.
GITLAB_PERMISSION_MODEEnvironment variableOptionalTool 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_TOOLSETSEnvironment variableOptionalOptional 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_TOOLSEnvironment variableOptionalOptional comma-separated list of individual tool names to add on top of enabled toolsets.
GITLAB_DENIED_TOOLS_REGEXEnvironment variableOptionalOptional regular expression used to hide matching tools from the server.
GITLAB_TOOL_POLICY_APPROVEEnvironment variableOptionalOptional comma-separated list of tool names that require explicit approval before execution.
GITLAB_TOOL_POLICY_HIDDENEnvironment variableOptionalOptional comma-separated list of tool names to hide from tools/list.
NODE_TLS_REJECT_UNAUTHORIZEDEnvironment variableOptionalSet to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates.
GITLAB_CA_CERT_PATHEnvironment variableOptionalOptional path to a custom CA certificate file for self-managed GitLab instances.
GITLAB_MASKING_ENABLEDEnvironment variableOptionalSet to true to mask text tool results and returned errors using built-in or configured rules. Default: false
GITLAB_MASKING_CONFIGEnvironment variableOptionalOptional path to a response-masking JSON configuration file.
GITLAB_MASKING_POLICY_FILEEnvironment variableOptionalOptional 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

A

No 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 →

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.

GitLab MCP Server Install

Add to stack

Loading.