mcp-sonarcloud
v0.2.1MCP 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")
| Parameter | Type | Description |
|---|---|---|
page | string | Page 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")
| Parameter | Type | Description |
|---|---|---|
component * | string | Project key or component key (e.g., 'my-project' or 'my-project:src/main.py') |
branch | Branch name to retrieve component from (e.g., 'main', 'develop') | |
pullRequest | Pull 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")
| Parameter | Type | Description |
|---|---|---|
component * | string | Project key to traverse (e.g., 'my-project') |
asc | Sort ascending (true) or descending (false). Defaults to true | |
branch | Branch name (e.g., 'main') | |
p | integer | Page number (1-indexed) |
ps | integer | Page size (max 500) |
pullRequest | Pull request ID (e.g., '123') | |
q | Search query to filter component names (case-insensitive) | |
qualifiers | Filter by component qualifiers. Valid values: 'BRC' (branch), 'DIR' (directory), 'FIL' (file), 'TRK' (project), 'UTS' (test file). Example: ['FIL', 'DIR'] | |
sort_fields | Fields to sort by. Valid values: 'name', 'path', 'qualifier'. Example: ['name', 'path'] | |
strategy | Tree 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")
| Parameter | Type | Description |
|---|---|---|
p | integer | Page number (1-indexed) |
projects | List of project keys to search in (e.g., ['my-project', 'another-project']). Can be omitted to search across all projects in organization | |
ps | integer | Page size (max 500) |
pullRequestId | Filter issues by pull request ID (e.g., '123') | |
severities | Comma-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")
| Parameter | Type | Description |
|---|---|---|
project | Project key to filter authors by (e.g., 'my-project'). Omit to search across entire organization | |
ps | integer | Page size - maximum number of authors to return (max 500) |
q | Search 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")
| Parameter | Type | Description |
|---|---|---|
issue * | string | Issue 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")
| Parameter | Type | Description |
|---|---|---|
project | Project key to filter tags by (e.g., 'my-project'). Omit to search across entire organization | |
ps | integer | Page size - maximum number of tags to return (max 500) |
q | Search 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")
| Parameter | Type | Description |
|---|---|---|
analysisId | Analysis ID to check quality gate for. Get this from analysis results or API | |
branch | Branch name to check (e.g., 'main', 'develop') | |
projectId | Numeric project ID (less common, prefer projectKey) | |
projectKey | Project key (e.g., 'my-project'). Most commonly used identifier | |
pullRequest | Pull 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")
| Parameter | Type | Description |
|---|---|---|
gate_id | Quality gate numeric ID. Either name or gate_id required | |
name | Quality 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")
| Parameter | Type | Description |
|---|---|---|
gateId * | integer | Quality gate ID to search projects for. Get this from list_quality_gates() |
page | integer | Page number (1-indexed) |
pageSize | integer | Page size (max 500) |
query | Search query to filter project names (case-insensitive partial match) | |
selected | Filter 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")
| Parameter | Type | Description |
|---|---|---|
project * | string | Project 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")
| Parameter | Type | Description |
|---|---|---|
projectKey * | string | Project key to search hotspots in (e.g., 'my-project') |
branch | Branch name to search (e.g., 'main', 'develop') | |
files | Comma-separated list of file paths to filter by (e.g., 'src/main.java,src/util.java') | |
p | integer | Page number (1-indexed) |
ps | integer | Page size (max 500) |
pullRequest | Pull 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")
| Parameter | Type | Description |
|---|---|---|
hotspot * | string | Hotspot 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…
| Parameter | Type | Description |
|---|---|---|
hotspot * | string | Hotspot key to change status for (e.g., 'AXabc123def456') |
status * | string | New status for the hotspot. Valid values: 'TO_REVIEW' (mark for review), 'REVIEWED' (mark as reviewed, requires resolution parameter) |
resolution | Resolution 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… |