mcp-sonarcloud

v0.2.1
mcp-sonarcloud Checked 15 hours ago Published 2 months ago

MCP server for SonarCloud

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_my_sonarqube_projects

Paginated project finder; use when you need keys/names before running other SonarCloud tools. Returns a list of projects with their keys and names, plus pagination information. Use the project keys returned here for other tools like search_sonar_issues_in_projects or search_hotspots. Example: search_my_sonarqube_projects(page="1")

ParameterTypeDescription
pagestringPage number to retrieve (1-indexed)

show_component

Return detailed metadata (qualifier, tags, branches) for a specific project/component. Returns component information including name, qualifier (TRK for project, FIL for file, etc.), tags, and available branches. Use this to inspect project metadata or verify component existence. Example: show_component(component="my-project", branch="main")

ParameterTypeDescription
component *stringProject key or component key (e.g., 'my-project' or 'my-project:src/main.py')
branchBranch name to retrieve component from (e.g., 'main', 'develop')
pullRequestPull request ID to retrieve component from (e.g., '123')

component_tree

Traverse modules/files inside a project; supports paging, qualifier filters, and branch/PR context. Returns a hierarchical view of project components (directories, files, modules). Use this to explore project structure or find specific files. Example: component_tree(component="my-project", qualifiers=["FIL"], q="test", branch="main")

ParameterTypeDescription
component *stringProject key to traverse (e.g., 'my-project')
ascSort ascending (true) or descending (false). Defaults to true
branchBranch name (e.g., 'main')
pintegerPage number (1-indexed)
psintegerPage size (max 500)
pullRequestPull request ID (e.g., '123')
qSearch query to filter component names (case-insensitive)
qualifiersFilter by component qualifiers. Valid values: 'BRC' (branch), 'DIR' (directory), 'FIL' (file), 'TRK' (project), 'UTS' (test file). Example: ['FIL', 'DIR']
sort_fieldsFields to sort by. Valid values: 'name', 'path', 'qualifier'. Example: ['name', 'path']
strategyTree traversal strategy. Valid values: 'all' (default), 'children' (direct children only), 'leaves' (files only)

search_sonar_issues_in_projects

Search issues across one or more projects with optional PR, severity, and pagination controls. Returns a list of issues matching the filters, with key details like rule, severity, component, and status. Use this to find code quality issues, bugs, vulnerabilities, or code smells in your projects. Example: search_sonar_issues_in_projects(projects=["my-project"], severities="HIGH,BLOCKER", pullRequestId="123")

ParameterTypeDescription
pintegerPage number (1-indexed)
projectsList of project keys to search in (e.g., ['my-project', 'another-project']). Can be omitted to search across all projects in organization
psintegerPage size (max 500)
pullRequestIdFilter issues by pull request ID (e.g., '123')
severitiesComma-separated impact severity levels. Valid values: 'INFO', 'LOW', 'MEDIUM', 'HIGH', 'BLOCKER'. Example: 'HIGH,BLOCKER'

list_issue_authors

Discover SCM author accounts used in your org/project; useful for reviewer pickers or stats. Returns a list of authors (from source control) who have contributed to issues in the organization or project. Requires SONARCLOUD_ORGANIZATION to be set. Example: list_issue_authors(project="my-project", q="john")

ParameterTypeDescription
projectProject key to filter authors by (e.g., 'my-project'). Omit to search across entire organization
psintegerPage size - maximum number of authors to return (max 500)
qSearch query to filter author names (case-insensitive partial match)

get_issue_changelog

Return the change history (status, assignee, severity edits) for the given issue key. Returns a chronological list of all changes made to an issue, including who made the change and when. Useful for auditing issue lifecycle or understanding how an issue was resolved. Example: get_issue_changelog(issue="AXabc123def456")

ParameterTypeDescription
issue *stringIssue key to retrieve history for (e.g., 'AXabc123def456')

list_issue_tags

List available issue tags (optionally filtered by project or search query) to power tag selectors. Returns a list of tags used on issues in the organization or project. Tags are custom labels that can be applied to issues for categorization. Example: list_issue_tags(project="my-project", q="security")

ParameterTypeDescription
projectProject key to filter tags by (e.g., 'my-project'). Omit to search across entire organization
psintegerPage size - maximum number of tags to return (max 500)
qSearch query to filter tag names (case-insensitive partial match)

get_project_quality_gate_status

Check whether a project/branch/PR passed its assigned quality gate and inspect failing conditions. Returns the quality gate status (OK, ERROR, WARN, NONE) and details of any failing conditions. At least one of analysisId, projectId, or projectKey must be provided. Quality gate status values: - OK: All conditions passed - ERROR: One or more conditions failed - WARN: Warning threshold exceeded (deprecated) - NONE: No quality gate set Example: get_project_quality_gate_status(projectKey="my-project", pullRequest="123")

ParameterTypeDescription
analysisIdAnalysis ID to check quality gate for. Get this from analysis results or API
branchBranch name to check (e.g., 'main', 'develop')
projectIdNumeric project ID (less common, prefer projectKey)
projectKeyProject key (e.g., 'my-project'). Most commonly used identifier
pullRequestPull request ID to check (e.g., '123')

list_quality_gates

Enumerate all gates in the organization along with basic metadata and built-in flags. Returns a list of all quality gates available in the organization, including their ID, name, and whether they are built-in or custom. Requires SONARCLOUD_ORGANIZATION to be set. Example: list_quality_gates()

show_quality_gate

Fetch full gate definition (conditions, allowed actions) so LLMs can explain or compare them. Returns detailed information about a specific quality gate, including all conditions (coverage thresholds, bug counts, etc.) and metadata. Requires SONARCLOUD_ORGANIZATION to be set. Either name or gate_id must be provided. Example: show_quality_gate(name="Sonar way")

ParameterTypeDescription
gate_idQuality gate numeric ID. Either name or gate_id required
nameQuality gate name (e.g., 'Sonar way', 'My Custom Gate'). Either name or gate_id required

search_quality_gates

Page through projects associated with a gate; supports filtering by selection status and name. Returns a list of projects and their association status with the specified quality gate. Useful for understanding which projects use which quality gates. Requires SONARCLOUD_ORGANIZATION to be set. Example: search_quality_gates(gateId=123, selected=True, query="my-project")

ParameterTypeDescription
gateId *integerQuality gate ID to search projects for. Get this from list_quality_gates()
pageintegerPage number (1-indexed)
pageSizeintegerPage size (max 500)
querySearch query to filter project names (case-insensitive partial match)
selectedFilter by association: true=only projects using this gate, false=only projects not using it, null=all projects

get_quality_gate_by_project

Return the gate currently bound to a project so workflows can cross-reference status and rules. Returns information about which quality gate is assigned to the specified project. Use this to determine what quality criteria a project must meet. Requires SONARCLOUD_ORGANIZATION to be set. Example: get_quality_gate_by_project(project="my-project")

ParameterTypeDescription
project *stringProject key to get quality gate for (e.g., 'my-project')

search_hotspots

List hotspots for a project with optional file, branch, or PR filters; returns paging + summaries. Security hotspots are security-sensitive pieces of code that need manual review. Returns a list of hotspots with their status, component, and vulnerability probability. Hotspot status values: - TO_REVIEW: Needs review - REVIEWED: Has been reviewed (with resolution FIXED, SAFE, or ACKNOWLEDGED) Example: search_hotspots(projectKey="my-project", branch="main", files="src/auth.java")

ParameterTypeDescription
projectKey *stringProject key to search hotspots in (e.g., 'my-project')
branchBranch name to search (e.g., 'main', 'develop')
filesComma-separated list of file paths to filter by (e.g., 'src/main.java,src/util.java')
pintegerPage number (1-indexed)
psintegerPage size (max 500)
pullRequestPull request ID to search (e.g., '123')

show_hotspot

Return the full hotspot payload (rule, component, author, status) for a specific key. Returns detailed information about a security hotspot, including the security rule that triggered it, the affected component/file, current status, resolution (if reviewed), and whether you can change its status. Example: show_hotspot(hotspot="AXabc123def456")

ParameterTypeDescription
hotspot *stringHotspot key to retrieve details for (e.g., 'AXabc123def456')

change_hotspot_status

Mark a hotspot TO_REVIEW or REVIEWED (with resolution) so downstream analyses see the new state. This updates the status of a security hotspot after manual review. Status values: - TO_REVIEW: Mark the hotspot as needing review (no resolution required) - REVIEWED: Mark as reviewed (resolution parameter is REQUIRED) Resolution values (required when status=REVIEWED): - FIXED: The vulnerability has been fixed - SAFE: The code is safe and not actually a vulnerability - ACKNOWLEDGED: The risk is acknowledged but accepted Examples: - Mark as reviewed and sa…

ParameterTypeDescription
hotspot *stringHotspot key to change status for (e.g., 'AXabc123def456')
status *stringNew status for the hotspot. Valid values: 'TO_REVIEW' (mark for review), 'REVIEWED' (mark as reviewed, requires resolution parameter)
resolutionResolution when status='REVIEWED' (REQUIRED for REVIEWED status). Valid values: 'FIXED' (vulnerability has been fixed), 'SAFE' (code is safe, not a vulnerability), 'ACKNOWLEDGED' (risk is acknowledged…