GitLab

The GitLab connector gives AI agents full visibility into repositories, issues, merge requests, CI/CD pipelines, and source code — all via the GitLab REST API using OAuth 2.0. Your credentials are stored encrypted in MCPGate's vault and are never exposed to the AI client.

Required scopes#

MCPGate requests the following OAuth scopes when you connect a GitLab account.

ScopePurpose
read_userRead the authenticated user profile
read_apiRead projects, issues, MRs, pipelines, and files
write_repositoryCreate and update issues and merge requests

Tool reference#

The GitLab connector exposes 13 tools: 10 read and 3 write.

ToolCategoryDescription
gitlab_list_projectsreadList GitLab projects accessible to the authenticated user
gitlab_get_projectreadGet a specific GitLab project by ID or path
gitlab_list_issuesreadList issues for a GitLab project
gitlab_list_mrsreadList merge requests for a GitLab project
gitlab_get_mrreadGet a specific merge request by project and MR IID
gitlab_list_pipelinesreadList CI/CD pipelines for a GitLab project
gitlab_get_pipelinereadGet a specific pipeline by project and pipeline ID
gitlab_read_filereadRead a file from a GitLab repository
gitlab_search_codereadSearch for code across GitLab projects
gitlab_list_branchesreadList branches for a GitLab project
gitlab_create_issuewriteCreate a new issue in a GitLab project
gitlab_update_issuewriteUpdate an existing GitLab issue
gitlab_create_mrwriteCreate a new merge request in a GitLab project

Common guardrail recipes#

Read-only access#

Enable only the ten read tools and deny gitlab_create_issue, gitlab_update_issue, and gitlab_create_mr. Useful for code-review assistants and pipeline monitors that should observe but never modify.

Contribute preset#

Enable read tools plus gitlab_create_issue and gitlab_create_mr. Deny gitlab_update_issue. This allows the AI to raise new issues and open MRs but not retroactively modify existing ones.

Restrict to specific projects#

Apply the allow_values template to all write tools. Target the project_id field and provide a list of numeric project IDs or namespace/project paths the agent is permitted to modify.

Troubleshooting#

  • Project ID vs. pathgitlab_get_project and most write tools accept either a numeric project ID (e.g. 123) or a URL-encoded path (e.g. namespace%2Frepo). Numeric IDs are more stable across renames.
  • MR IID vs. ID — GitLab merge requests have both a global id and a project-scoped iid. The connector uses mr_iid (the project-scoped number shown in the GitLab UI).
  • Pipeline access requires CI scope — On self-managed GitLab instances, some pipeline operations may require the read_builds scope. Re-connect to request the extended scope if pipeline tools return 403.