正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

GitLab MCP server tools

  • Tier: Free, Premium, Ultimate
  • 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 GitLab 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.
assignee_idsarray of integersNoArray of IDs of merge request assignees. Set to 0 or an empty value to unassign all assignees.
reviewer_idsarray of integersNoArray of IDs of merge request reviewers. Set to 0 or an empty value to unassign all reviewers.
descriptionstringNoDescription of the merge request.
labelsarray of stringsNoArray of label names. Set to an empty string to unassign all labels.
milestone_idintegerNoID of the milestone.

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 GitLab 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 GitLab 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 GitLab 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

create_merge_request_note

Adds a comment or reply to a discussion on a GitLab merge request as the authenticated user.

ParameterTypeRequiredDescription
urlstringNoURL of the GitLab merge request. Required if project_id and merge_request_iid are missing.
project_idstringNoID or URL-encoded path of the project. Required if url is missing.
merge_request_iidintegerNoInternal ID of the merge request. Required if url is missing.
bodystringYesContent of the note. Lines cannot start with / to avoid triggering quick actions (for example, /merge).
discussion_idstringNoGlobal ID of the discussion to reply to (in the format gid://gitlab/Discussion/<id>). If missing, creates a new top-level note.

Example:

Reply "Thanks, fixed in the latest push" to merge request 42 in project gitlab-org/gitlab

get_merge_request_notes

Retrieves the notes (comments and system notes) for a specific GitLab merge request.

ParameterTypeRequiredDescription
urlstringNoURL of the GitLab merge request. Required if project_id and merge_request_iid are missing.
project_idstringNoID or URL-encoded path of the project. Required if url is missing.
merge_request_iidintegerNoInternal ID of the merge request. Required if url is missing.
afterstringNoCursor for forward pagination.
beforestringNoCursor for backward pagination.
firstintegerNoNumber of notes to return for forward pagination.
lastintegerNoNumber of notes to return for backward pagination.

Each returned note includes its discussion ID, so related notes can be grouped into threads.

Example:

Show me all comments on merge request 5 in project gitlab-org/gitlab

get_pipeline_jobs

Retrieves the jobs for a specific GitLab 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

get_job_log

Retrieves the trace (log output) for a specific CI/CD job.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
job_idintegerYesID of the job.

Example:

Show me the log output for job 88 in project gitlab-org/gitlab

manage_pipeline

Manages CI/CD pipelines in a GitLab project.

ParameterTypeRequiredDescription
idstringYesID or URL-encoded path of the project.
listbooleanNoIf true, lists all pipelines in a project.
refstringNoBranch or tag name. If set, creates a new pipeline on a branch or tag. Optional for filtering lists.
pipeline_idintegerNoID of the pipeline. If only this parameter is set, deletes a pipeline and all related data.
retrybooleanNoIf true and pipeline_id is set, retries failed or canceled pipeline jobs.
cancelbooleanNoIf true and pipeline_id is set, cancels all jobs in a running pipeline.
namestringNoName of the pipeline. If this parameter and pipeline_id are set, updates the pipeline metadata.
variablesarrayNoPipeline variables in array format ([{key, value, variable_type}]).
inputshashNoPipeline input parameters as key-value pairs.
pageintegerNoCurrent page number. Default is 1.
per_pageintegerNoNumber of items per page. Default is 20.

Examples:

  • List pipelines:

    List all pipelines for project gitlab-org/gitlab
  • Create a pipeline:

    Create a pipeline on the main branch for project gitlab-org/gitlab
  • Update a pipeline:

    Rename pipeline 12345 to "My deploy pipeline" in project gitlab-org/gitlab
  • Retry a pipeline:

    Retry failed jobs in pipeline 12345 for project gitlab-org/gitlab
  • Cancel a pipeline:

    Cancel pipeline 12345 in project gitlab-org/gitlab
  • Delete a pipeline:

    Delete pipeline 12345 in project gitlab-org/gitlab

create_workitem_note

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

ParameterTypeRequiredDescription
bodystringYesContent of the note.
urlstringNoURL for the work item. 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 the Reporter, Developer, Maintainer, or Owner 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

get_workitem_notes

Retrieves all notes (comments) for a specific GitLab work item.

ParameterTypeRequiredDescription
urlstringNoURL for the work item. 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.
afterstringNoCursor for forward pagination.
beforestringNoCursor for backward pagination.
firstintegerNoNumber of notes to return for forward pagination.
lastintegerNoNumber of notes to return for backward pagination.

Example:

Show me all comments on work item 42 in project gitlab-org/gitlab

Links a work item to one or more other work items with a relationship type.

ParameterTypeRequiredDescription
work_items_idsarray of stringsYesGlobal IDs of the work items to link to (in the format gid://gitlab/WorkItem/<id>). Maximum 10 items.
urlstringNoURL for the source work item. 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 source work item. Required if url is missing.
link_typestringNoType of relationship. One of relates_to, blocks, or blocked_by. Default is relates_to. The blocks and blocked_by types require GitLab Premium or Ultimate.

Example:

Mark work item 42 in project gitlab-org/gitlab as blocked by work item 40

get_saved_view_work_items

Retrieves a saved view and its list of work items from a namespace. The tool applies the filters and the sort order in the saved view to the returned work items.

ParameterTypeRequiredDescription
saved_view_idstringYesGlobal ID of the saved view (in the format gid://gitlab/WorkItems::SavedViews::SavedView/<id>).
urlstringNoURL for the namespace (project or group). Required if group_id or project_id is 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.
afterstringNoCursor for forward pagination.
firstintegerNoNumber of work items to return. Maximum 100.

Example:

Show me the work items in this saved view: <URL>

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

search_labels

Searches for labels in a GitLab project or group.

ParameterTypeRequiredDescription
full_pathstringYesFull path of the project or group (for example, group/project).
is_projectbooleanYesWhether to search in a project (true) or group (false).
searchstringNoSearch term to filter labels by title.

When you search group labels, the results include labels from ancestor and descendant groups.

Example:

Show me all labels in project gitlab-org/gitlab
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed

The availability of this feature is controlled by a feature flag. For more information, see the history.

Searches for relevant code snippets in a GitLab project. For more information, including setup and enablement, see semantic code search.

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.

For best results, describe the functionality or behavior you’re interested in rather than using generic keywords or specific function or variable names.

Example:

How are authorizations managed in this project?

attach_scan_profile

Attaches the given security scan profile to the specified projects, or to all projects under the specified groups.

ParameterTypeRequiredDescription
security_scan_profile_idstringYesGlobal ID of the security scan profile (for example, gid://gitlab/Security::ScanProfile/1).
project_idsarray of stringsNoArray of global IDs of projects (for example, [gid://gitlab/Project/1]). This is required unless group_ids is provided.
group_idsarray of stringsNoArray of global IDs of groups (for example, [gid://gitlab/Group/1]). This is required unless project_ids is provided.

Example:

Attach `gid://gitlab/Security::ScanProfile/1` to all projects under `gid://gitlab/Group/1`.