key
File key (e.g. myproject:src/foo/Bar.java) - Required String
How to use it
key is exposed by the Sonarqube MCP Server MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the key 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.
Branch name used to retrieve the latest analysis context - Required String
Change the status of a SonarQube issue to "accept", "falsepositive" or to "reopen" an issue.
Code snippet to filter issues (must match content in fileContent) - String
Enable or disable the automatic analysis - Required Boolean
Optional enterprise key to filter results - String
List of absolute file paths to analyze - Required String[]
Complete file content as a string. Required when workspace is not mounted - String
Project-relative path of the file to analyze (e.g., src/main/java/MyClass.java). Used when the workspace is mounted at /app/mcp-workspace - String
Optional list of file paths to filter - String[]
Defines in which scope the file originates from: 'MAIN' or 'TEST' (default: MAIN) - String
First line to analyze (1-based, default: 1) - Number
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.
Comma-separated list of specific Security Hotspot keys to retrieve - String[]
Optional list of software qualities to filter by. Possible values: MAINTAINABILITY, RELIABILITY, SECURITY - String[]
Optional issue key to fetch a specific issue - String
Optional list of issue statuses to filter by. Possible values: OPEN, CONFIRMED, FALSEPOSITIVE, ACCEPTED, FIXED, INSANDBOX - String[]
Language of the code (e.g., 'java', 'python', 'js', 'ts', 'tsx', 'jsx') - String
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.
Maximum coverage threshold (0-100). Only return files with coverage <= this value - Number
Show only hotspots assigned to me - Boolean
Page index (1-based, default: 1) - Number
Page size (default: 100, max: 500) - Number
The SonarQube project key - Required String (Ignored when SONARQUBEPROJECTKEY is defined)
Optional list of SonarQube project keys - String[]
Optional pull request key/ID. Use listpullrequests to discover valid keys - String
Optional resolution filter: FIXED, SAFE, ACKNOWLEDGED - String
Run Vortex analysis on SonarQube Cloud for a single file. Organization is inferred from MCP configuration.
Scope of the file: MAIN or TEST (default: MAIN) - String
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 in a project sorted by coverage (ascending - worst coverage first). This tool helps identify files that need test coverage improvements.
Search for Security Hotspots in a SonarQube project.
Search for SonarQube issues in my organization's projects.
Optional list of severities to filter by. Possible values: INFO, LOW, MEDIUM, HIGH, BLOCKER - String[]
Filter hotspots created since the leak period (new code) - Boolean
New issue's status - Required Enum {"accept", "falsepositive", "reopen"}
Last line to analyze (inclusive). If not specified, all lines are returned - Number
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.