Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyProgramming

GitLab MCP Server

Lets your AI agent work with GitLab projects, merge requests, issues, pipelines, wikis and releases.

2.1k stars on GitHubby zereightLicense MITUpdated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

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

What to fill in

NameWhat it isRequired
GITLAB_PERSONAL_ACCESS_TOKENGitLab 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 be set. Create a token with the GitLab scopes the tools need, such as api or read_api.No
GITLAB_PERSONAL_ACCESS_TOKEN_FILEPath 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, OAuth, cookie, or remote authorization.No
GITLAB_JOB_TOKENOptional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.No
GITLAB_AUTH_COOKIE_PATHOptional path to a GitLab authentication cookie file for cookie-based authentication.No
GITLAB_USE_OAUTHSet to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file.No
GITLAB_OAUTH_CLIENT_IDGitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT.No
GITLAB_OAUTH_TOKEN_SCRIPTCommand that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID.No
GITLAB_API_URLGitLab API base URL. Use https://gitlab.com/api/v4 for GitLab.com or your self-managed GitLab API URL.No
GITLAB_ALLOWED_PROJECT_IDSOptional comma-separated list of GitLab project IDs that this server is allowed to access.No
GITLAB_PERMISSION_MODETool exposure. Allowed values are readonly, modify, and full. Unset uses full. readonly keeps read-only tools. modify blocks delete and teardown tools.No
GITLAB_TOOLSETSOptional 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).No
GITLAB_TOOLSOptional comma-separated list of individual tool names to add on top of enabled toolsets.No
GITLAB_DENIED_TOOLS_REGEXOptional regular expression used to hide matching tools from the server.No
GITLAB_TOOL_POLICY_APPROVEOptional comma-separated list of tool names that require explicit approval before execution.No
GITLAB_TOOL_POLICY_HIDDENOptional comma-separated list of tool names to hide from tools/list.No
NODE_TLS_REJECT_UNAUTHORIZEDSet to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates.No
GITLAB_CA_CERT_PATHOptional path to a custom CA certificate file for self-managed GitLab instances.No
GITLAB_MASKING_ENABLEDSet to true to mask text tool results and returned errors using built-in or configured rules.No
GITLAB_MASKING_CONFIGOptional path to a response-masking JSON configuration file.No
GITLAB_MASKING_POLICY_FILEOptional protected server-owned JSON file containing managed masking policies.No
GITLAB_MASKING_WORKSPACE_DIRDirectory used to resolve response-masking configuration paths.No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

List the changed files in merge request 123 of group/project.
Show me the output of the failed pipeline job.

What it is

This server connects your agent to GitLab through its REST and GraphQL API. It starts with 40 tools and can activate more by category, up to 288 in total. It supports gitlab.com and self-hosted instances, and a read-only mode.

What it can do

  • list_merge_request_changed_files and get_merge_request_file_diff: review a merge request in two steps
  • get_pipeline_job_output: read job logs with pagination
  • discover_tools: activate more tool categories
  • help
  • execute_graphql
  • Projects, issues, wiki, releases, tags and milestones
  • jmespath option to shrink big results

When to use

  • β€ΊWhen you want your agent to review a merge request file by file.
  • β€ΊWhen a pipeline fails and you want the job log without opening GitLab.
  • β€ΊWhen you want to manage issues and milestones from chat.

What you need

A GitLab personal access token (or OAuth), and Node.js 20 or newer. Install with npm install -g @zereight/mcp-gitlab, then use the zereight-mcp-gitlab binary.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

How many tools does it show?

40 by default (38 core plus discover_tools and help). 288 exist in total.

Should I load all tools?

No. The readme says not to set GITLAB_TOOLSETS=all, which costs about 73k schema tokens. Use discover_tools instead.

How do I sign in?

With GITLAB_PERSONAL_ACCESS_TOKEN, local OAuth, MCP OAuth for Claude.ai, or per-request remote authorization.

Does it work with self-hosted GitLab?

Yes, set GITLAB_API_URL to your instance.

Can I use it without MCP?

Yes. A Skill and CLI path does the same workflows in a terminal with zereight-mcp-gitlab.

Is the api toolset safe?

The readme warns it bypasses allowlists and safety checks and can be driven by prompt injection. Enable it only on purpose.

If it does not work

  • β€ΊCheck that the token is set and that GITLAB_API_URL is correct, for example https://gitlab.com/api/v4.
  • β€ΊCheck your Node.js version is 20 or newer.
  • β€ΊUse a URL-encoded project path such as group%2Fproject for project_id.

5 new skills a week. 1 minute to read.