get_scm_info
Get SCM information of SonarQube source files. Require See Source Code permission on file's project.
How to use it
get_scm_info is exposed by the Sonarqube MCP Server MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the get_scm_info tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Sonarqube MCP Server
docker run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcpOther tools in Sonarqube MCP Server (39)
Analyze file content with SonarQube analyzers to identify code quality and security issues. Always analyzes the complete file content for accuracy. Optionally filter results to a specific code snippet.
Analyze files in the current working directory using SonarQube for IDE. This tool connects to a running SonarQube for IDE instance to perform code quality analysis on a list of files.
Review a Security Hotspot by changing its status. When marking as REVIEWED, you must specify a resolution (FIXED, SAFE, or ACKNOWLEDGED).
Change the status of a SonarQube issue to "accept", "falsepositive" or to "reopen" an issue.
Create a new webhook for the SonarQube organization or project. Requires 'Administer' permission on the specified project, or global 'Administer' permission.
Get SonarQube measures for a component (project, directory, file).
Trace what functions a given function calls. Useful for impact analysis and understanding execution flow.
Get duplications for a file. Require Browse permission on file's project.
Get line-by-line coverage information for a specific file, including which exact lines are uncovered and which have partially covered branches. This tool helps identify precisely where to add test coverage. Use after identifying files with low coverage via searchfilesbycoverage.
Get the Quality Gate Status for the SonarQube project.
Get source code as raw text from SonarQube. Require 'See Source Code' permission on file.
Get complete source code (signature and body) for a code element by its fully qualified name.
Get the health status of SonarQube Server instance. Returns GREEN (fully operational), YELLOW (usable but needs attention), or RED (not operational).
Get detailed information about SonarQube Server system configuration including JVM state, database, search indexes, and settings. Requires 'Administer' permissions.
Get SonarQube Server system logs in plain-text format. Requires system administration permission.
Get state information about SonarQube Server. Returns status (STARTING, UP, DOWN, RESTARTING, DBMIGRATIONNEEDED, DBMIGRATIONRUNNING), version, and id.
Get the full inheritance hierarchy for a class-like structure (class, interface, enum, record, exception, struct). Essential for understanding inheritance trees and refactoring.
Trace what functions call a given function. Useful for finding all callers and entry points, and understanding what breaks if a signature changes.
List analyzed branches for a project.
List the enterprises available in SonarQube Cloud that you have access to. Use this tool to discover enterprise IDs that can be used with other tools.
List all programming languages supported in this SonarQube instance.
List enterprise portfolios available in SonarQube with filtering and pagination options.
List all pull requests for a project. Use this tool to discover pull requests for PR-decorated analysis (coverage, issues, quality gate). Returns the pull request key/ID which can be used with other tools. For branch-based analysis without pull requests, use listbranches instead.
List all quality gates in my SonarQube.
List all webhooks for the SonarQube organization or project. Requires 'Administer' permission on the specified project, or global 'Administer' permission.
Ping the SonarQube Server system to check if it's alive. Returns 'pong' as plain text.
Run Vortex analysis on a single file. Organization is inferred from MCP configuration (SonarQube Server uses the nil UUID placeholder).
Find code elements by their implementation body using regex patterns. Useful for locating where APIs or patterns are actually used.
Find code elements (classes, methods, interfaces, ...) by their declaration signatures using regex patterns.
Search for software composition analysis issues (dependency risks) of a SonarQube project, paired with releases that appear in the analyzed project, application, or portfolio.
Search for files with code duplications in a SonarQube project. By default, automatically fetches all duplicated files across all pages (up to 10,000 files max). Returns only files with duplications.
Search for files in a project sorted by coverage (ascending - worst coverage first). This tool helps identify files that need test coverage improvements.
Search for SonarQube metrics.
Find SonarQube projects. The response is paginated.
Search for Security Hotspots in a SonarQube project.
Search for SonarQube issues in my organization's projects.
Shows detailed information about a SonarQube rule.
Get detailed information about a specific Security Hotspot, including rule details, code context, flows, and comments.
Enable or disable SonarQube for IDE automatic analysis. When enabled, SonarQube for IDE will automatically analyze files as they are modified in the working directory. When disabled, automatic analysis is turned off.