Skip to content

Search

Full-text search, one action per kind of result: code, merge requests, issues, commits, milestones, notes, projects, snippets, users and wiki pages. Each searches a project or a group when given one, and the whole instance otherwise. search_type asks for a search backend, basic, advanced or zoekt, and GitLab refuses one the instance has not enabled. Every action only reads.

  • “Search the code of group platform for parseConfig”
  • “Find merge requests that mention the login bug”
  • “Which issues mention timeout in project 42?”
  • Dynamic, the default surface: call gitlab_execute_action with action set to the action’s ID, such as search.code, and its parameters in params. gitlab_find_action finds an ID from a description of the task.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): call gitlab_search with action set to the action’s name, such as code, and its parameters in params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): call the action’s own tool, such as gitlab_search_code, with its parameters as the arguments.

Every tier serves the whole group, on self-managed instances and on GitLab.com alike.

Read-only actions: 10 of 10, the ones a deployment in read-only mode keeps. A token with read_api and not api is served 10 of the 10.

The description of each action, and of each of its parameters, is the text the server serves for it on the default surface, quoted as served. The token lines say what GitLab 19.5.0 requires of a token for the requests each action sends; on an instance with Admin Mode turned on, an action only an administrator may run also needs admin_mode.

ActionIndividual
search.codegitlab_search_code
search.commitsgitlab_search_commits
search.issuesgitlab_search_issues
search.merge_requestsgitlab_search_merge_requests
search.milestonesgitlab_search_milestones
search.notesgitlab_search_notes
search.projectsgitlab_search_projects
search.snippetsgitlab_search_snippets
search.usersgitlab_search_users
search.wikigitlab_search_wiki

Search code blobs across global, group, or project scope. Returns: matching blobs with file path, basename, ref, the line the snippet starts on, the snippet, project ID, and pagination metadata. On basic search a file that matched by its path also carries its blob ID, and its snippet is the start of the file rather than the lines around a match. On exact search such a file carries its path in place of a snippet. num_context_lines (0 to 20) sets the lines around each match on advanced and exact search, and regex chooses between a regular expression and literal text on exact search. See also: search.projects, repository.file_get, repository.tree.

  • Meta-tool: gitlab_search, action code
  • Individual tool: gitlab_search_code
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query text (param ‘query’ not ‘search’)
group_idstringnoGroup ID or URL-encoded path (optional)
num_context_linesintegernoLines of context GitLab sends around a code match, up to this many on each side, 0 to 20. Honored by advanced and exact code search (search_type advanced or zoekt), which send 2 and 1 by default, though exact search only from GitLab 19.5. GitLab Enterprise 18.11 and later refuses it on basic search, which a project search of a ref other than the default branch always runs, unless the token carries the mcp scope. Earlier releases and Community Edition ignore it
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
refstringnoBranch or tag name to search in (default: default branch)
regexbooleannoSearch the query as a regular expression (true) or as literal text (false). Honored by exact code search alone (search_type zoekt), which reads the query as a regular expression when this is left out. GitLab Enterprise 18.9 and later refuses it on any other backend, false included, and so on a project search of a ref other than the default branch, which always runs basic search, unless the token carries the mcp scope. Earlier releases and Community Edition ignore it
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search commit messages across global, group, or project scope. Returns: matching commits with short and full SHA, title, message, author, and committed date plus pagination metadata. See also: search.code, repository.commit_get, repository.file_history.

  • Meta-tool: gitlab_search, action commits
  • Individual tool: gitlab_search_commits
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
refstringnoBranch or tag whose commits a project search reads (default: the default branch). Group and instance searches do not take it
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search issues across global, group, or project scope. Returns: matching issues with title, state, labels, assignees, author, and web URL plus pagination metadata. See also: search.merge_requests, issue.list, issue.get.

  • Meta-tool: gitlab_search, action issues
  • Individual tool: gitlab_search_issues
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query text (param ‘query’ not ‘search’)
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search merge requests across global, group, or project scope. Returns: matching merge requests with title, state, author, source and target branches, and web URL plus pagination metadata. See also: search.issues, merge_request.list, merge_request.get.

  • Meta-tool: gitlab_search, action merge_requests
  • Individual tool: gitlab_search_merge_requests
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query text (param ‘query’ not ‘search’)
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search milestones across global, group, or project scope. Returns: matching milestones with title, description, state, start and due dates, and web URL plus pagination metadata. See also: project.milestone_list, project.milestone_get, search.issues.

  • Meta-tool: gitlab_search, action milestones
  • Individual tool: gitlab_search_milestones
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search note bodies within one project. Returns: matching notes with body, author, noteable type and ID, system and internal flags, and timestamps plus pagination metadata. See also: search.issues, search.merge_requests, issue.note_list.

  • Meta-tool: gitlab_search, action notes
  • Individual tool: gitlab_search_notes
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Global Search: Use at project (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
project_idstringyesProject ID or URL-encoded path
querystringyesSearch query string
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search projects globally or within a group by name, path, or description. Returns: matching projects with namespace, visibility, default branch, and web URL plus pagination metadata. See also: project.get, project.list, search.code.

  • Meta-tool: gitlab_search, action projects
  • Individual tool: gitlab_search_projects
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
group_idstringnoGroup ID or URL-encoded path. Omit for a global search
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search snippet titles globally. Returns: matching snippets with title, file name, description, visibility, author, project ID, web and raw URLs, and timestamps plus pagination metadata. See also: search.code, search.projects.

  • Meta-tool: gitlab_search, action snippets
  • Individual tool: gitlab_search_snippets
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search users across global, group, or project scope. Returns: matching users with ID, username, name, state, avatar URL, and web URL plus pagination metadata. See also: user.get, user.list, project.members.

  • Meta-tool: gitlab_search, action users
  • Individual tool: gitlab_search_users
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.

Search wiki blobs across global, group, or project scope. Returns: the file of each matching wiki page with its path (the page slug plus the format’s extension), ref, the line the snippet starts on, the snippet, its project ID and, from advanced search, its group ID (a page of a group wiki carries the group alone), and pagination metadata. On basic search a page whose file matched by its path also carries its blob ID, and its snippet is the start of the page. See also: search.code, wiki.list, wiki.get, group.wiki_get.

  • Meta-tool: gitlab_search, action wiki
  • Individual tool: gitlab_search_wiki
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: one of: Global Search: Use at project or Global Search: Use at group or Global Search: Use at user (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
querystringyesSearch query string
group_idstringnoGroup ID or URL-encoded path (optional)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
project_idstringnoProject ID or URL-encoded path (optional)
refstringnoBranch or tag of the wiki repository a project search reads (default: the default branch). Group and instance searches do not take it
search_typestring (basic, advanced, zoekt)noSearch backend to request. Use ‘basic’ for GitLab’s default search, ‘advanced’ for Elasticsearch/OpenSearch-backed search, or ‘zoekt’ for Zoekt-based search. The requested backend must be enabled on the GitLab instance.