GitLab MCP server code security tools

  • Tier: Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

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

These tools are part of the code_security toolset. Use them to list, read, and update vulnerabilities, and attach security scan profiles to projects and groups.

For a list of all tools, see GitLab MCP server tools.

list_vulnerabilities

Lists security vulnerabilities in a GitLab project, with optional filters and cursor pagination. Returns paginated vulnerability metadata. To get full details for a single vulnerability, use get_vulnerability.

Requires the security dashboard feature to be enabled.

This tool is listed only when the licensed feature is available for you. For more information, see select tool groups.

ParameterTypeRequiredDescription
project_full_pathstringYesFull path of the project (for example, namespace/project or group/subgroup/project).
severityarray of stringsNoFilter by severity level. Omit to include vulnerabilities of any severity. One or more of CRITICAL, HIGH, MEDIUM, LOW, INFO, or UNKNOWN.
report_typearray of stringsNoFilter by security report type. Omit to include all report types. For example, SAST, DAST, or DEPENDENCY_SCANNING.
statearray of stringsNoFilter by vulnerability state. Omit to include vulnerabilities in any state. One or more of CONFIRMED, DETECTED, DISMISSED, or RESOLVED.
firstintegerNoNumber of vulnerabilities to return for forward pagination. Default is 20, maximum is 100.
afterstringNoCursor for forward pagination. Use pageInfo.endCursor from a previous response.

Example:

List critical and high severity vulnerabilities in project gitlab-org/gitlab

get_vulnerability

Returns comprehensive details for a single vulnerability, including title, state, description, severity, identifiers, and the context behind its state (dismissal reason, state comment, and the users who confirmed or dismissed it).

This tool is listed only when the licensed feature is available for you. For more information, see select tool groups.

With a fine-grained personal access token, these nested objects need their own permission:

Without these permissions, the tool still succeeds but returns null for those fields.

ParameterTypeRequiredDescription
vulnerability_idstringYesNumeric ID of the vulnerability (for example, 567).

Example:

Get full details for vulnerability 567

save_vulnerability

Performs write operations on a vulnerability in a GitLab project.

This tool is listed only when the licensed feature is available for you. For more information, see select tool groups.

ParameterTypeRequiredDescription
actionstringYesOperation to perform. One of dismiss, confirm, revert_to_detected, update_severity, or create_issue.
vulnerability_idstringYesNumeric ID of the vulnerability (for example, 567).
commentstringNoExplanation for the action. Required when action is update_severity.
dismissal_reasonstringNoReason for dismissal. One of ACCEPTABLE_RISK, FALSE_POSITIVE, MITIGATING_CONTROL, USED_IN_TESTS, or NOT_APPLICABLE. Use only when action is dismiss.
severitystringNoNew severity level. One of INFO, UNKNOWN, LOW, MEDIUM, HIGH, or CRITICAL. Required when action is update_severity.
project_full_pathstringNoFull path of the project (for example, namespace/project). Required when action is create_issue.

Examples:

  • Dismiss a vulnerability:

    Dismiss vulnerability 123 with reason FALSE_POSITIVE
  • Confirm a vulnerability:

    Mark vulnerability 456 as confirmed
  • Revert to detected:

    Revert vulnerability 789 back to detected state
  • Update severity:

    Change severity of vulnerability 321 to CRITICAL with comment "Reassessed based on new intel"
  • Create an issue:

    Create an issue for vulnerability 654 in project gitlab-org/gitlab

attach_scan_profile

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

This tool is listed only when the licensed feature is available for you. For more information, see select tool 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`.