GitLab MCP server tools

  • Tier: Premium, Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Status: Beta

To provide feedback on this feature, leave a comment on issue 561564.

The GitLab MCP server provides a set of tools that integrate with your existing GitLab workflows. You can use these tools to interact directly with GitLab and perform common GitLab operations.

get_mcp_server_version

Returns the current version of the GitLab MCP server.

Example:

What version of the GitLab MCP server am I connected to?

create_issue

Creates a new issue in a GitLab project.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
titlestringYesTitle of the issue.
descriptionstringNoDescription of the issue.
assignee_idsarray of integersNoArray of IDs of assigned users.
milestone_idintegerNoID of the milestone.
labelsarray of stringsNoArray of label names.
confidentialbooleanNoSets the issue to confidential. Default is false.
epic_idintegerNoID of the linked epic.

Example:

Create a new issue titled "Fix login bug" in project 123 with description
"Users cannot log in with special characters in password"

get_issue

Retrieves detailed information about a specific GitLab issue.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
issue_iidintegerYesInternal ID of the issue.

Example:

Get details for issue 42 in project 123

create_merge_request

Creates a merge request in a project.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
titlestringYesTitle of the merge request.
source_branchstringYesName of the source branch.
target_branchstringYesName of the target branch.
target_project_idintegerNoID of the target project.

Example:

Create a merge request in project gitlab-org/gitlab titled "Bug fix broken specs"
from branch "fix/specs-broken" into "master" and enable squash

get_merge_request

Retrieves detailed information about a specific GitLab merge request.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
merge_request_iidintegerYesInternal ID of the merge request.

Example:

Get details for merge request 15 in project gitlab-org/gitlab

get_merge_request_commits

Retrieves the list of commits in a specific merge request.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
merge_request_iidintegerYesInternal ID of the merge request.
per_pageintegerNoNumber of commits per page.
pageintegerNoCurrent page number.

Example:

Show me all commits in merge request 42 from project 123

get_merge_request_diffs

Retrieves the diffs for a specific merge request.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
merge_request_iidintegerYesInternal ID of the merge request.
per_pageintegerNoNumber of diffs per page.
pageintegerNoCurrent page number.

Example:

What files were changed in merge request 25 in the gitlab project?

get_merge_request_pipelines

Retrieves the pipelines for a specific merge request.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
merge_request_iidintegerYesInternal ID of the merge request.

Example:

Show me all pipelines for merge request 42 in project gitlab-org/gitlab

get_pipeline_jobs

Retrieves the jobs for a specific CI/CD pipeline.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
pipeline_idintegerYesID of the pipeline.
per_pageintegerNoNumber of jobs per page.
pageintegerNoCurrent page number.

Example:

Show me all jobs in pipeline 12345 for project gitlab-org/gitlab

create_workitem_note

Creates a new note (comment) on a GitLab work item.

ParameterTypeRequiredDescription
bodystringYesContent of the note.
urlstringNoGitLab URL for the work item (for example, https://gitlab.com/namespace/project/-/work_items/42). Required if group_id or project_id and work_item_iid are missing.
group_idstringNoID or path of the group. Required if url and project_id are missing.
project_idstringNoID or path of the project. Required if url and group_id are missing.
work_item_iidintegerNoInternal ID of the work item. Required if url is missing.
internalbooleanNoMarks the note as internal (visible only to users with at least the Reporter role for the project). Default is false.
discussion_idstringNoGlobal ID of the discussion to reply to (in the format gid://gitlab/Discussion/<id>).

Example:

Add a comment "This looks good to me" to work item 42 in project gitlab-org/gitlab

Searches for a term across the entire GitLab instance with the search API. This tool is available for global, group, and project search. Available scopes depend on the search type.

ParameterTypeRequiredDescription
scopestringYesSearch scope (for example, issues, merge_requests, or projects).
searchstringYesSearch term.
group_idstringNoID or URL-encoded path of the group you want to search.
project_idstringNoID or URL-encoded path of the project you want to search.
statestringNoState of search results (for issues and merge_requests).
confidentialbooleanNoFilters results by confidentiality (for issues). Default is false.
fieldsarray of stringsNoArray of fields you want to search (for issues and merge_requests).
order_bystringNoAttribute to order results by. Default is created_at for basic search and relevance for advanced search.
sortstringNoSort direction for results. Default is desc.
per_pageintegerNoNumber of results per page. Default is 20.
pageintegerNoCurrent page number. Default is 1.

Example:

Search issues for "flaky test" across GitLab
  • Offering: GitLab.com

Searches for relevant code snippets in a project.

This tool is available only for projects with GitLab Duo turned on. Project files must be indexed into vector embeddings.

If this tool is invoked for a project without vector embeddings, indexing is triggered ad-hoc and the agent uses a different tool. This tool then becomes available after a few minutes.

ParameterTypeRequiredDescription
semantic_querystringYesSearch query for the code.
project_idstringYesID or path of the project.
directory_pathstringNoPath of the directory (for example, app/services/).
knnintegerNoNumber of nearest neighbors used to find similar code snippets. Default is 64.
limitintegerNoMaximum number of results to return. Default is 20.

Example:

How are authorizations managed in this project?