Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context
The SonarQube MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with SonarQube Server or Cloud. It also enables the analysis of code snippet directly within the agent context.
SonarQube MCP Server can be launched in two ways:
Run the following Gradle command to clean the project, download analyzers, and build the application:
./gradlew clean build -x test
The JAR file will be created in build/libs/
.
To create the Docker image, run the buildDocker
task:
./gradlew clean buildDocker -x test
Once the application is built locally (either as a JAR or a Docker image), you can use the following buttons to simplify the installation process within VS Code.
Alternatively, you can manually copy and paste the MCP configurations. Below are example snippets.
{
"sonarqube-mcp-server-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarqube-mcp-server:<version>"
],
"env": {
"SONARQUBE_TOKEN": "<token>",
"SONARQUBE_ORG": "<org>"
}
}
}
{
"sonarqube-mcp-server": {
"command": "java",
"args": [
"-jar",
"<path_to_sonarqube_mcp_server_jar>"
],
"env": {
"STORAGE_PATH": "<path_to_your_mcp_storage>",
"PLUGINS_PATH": "<path_to_your_sonar_analyzers>",
"SONARQUBE_TOKEN": "<token>",
"SONARQUBE_ORG": "<org>"
}
}
}
Depending on your environment, you should provide specific environment variables.
To enable full functionality, the following environment variables must be set before starting the server:
Environmment variable | Description |
---|---|
SONARQUBE_TOKEN | Your SonarQube Cloud token |
SONARQUBE_ORG | Your SonarQube Cloud organization key |
Environmment variable | Description |
---|---|
SONARQUBE_TOKEN | Your SonarQube Server USER token |
SONARQUBE_URL | Your SonarQube Server URL |
On top of the previous SonarQube environments, you should add the following variable when running the MCP Server via a JAR:
Environmment variable | Description |
---|---|
STORAGE_PATH | An absolute path to a writable directory where SonarQube MCP Server will store its files (e.g., for creation, updates, and persistence) |
PLUGINS_PATH | An optional absolute path to a folder containing the SonarQube analyzers. If none is provided, analysis is disabled |
codeSnippet
- Code snippet or full file content - Required Stringlanguage
- Optional language of the code snippet - Stringq
- Optional pattern to match language keys/names against - Stringchange_sonar_issue_status - Change the status of a SonarQube issue to "accept", "falsepositive" or to "reopen" an issue
key
- Issue key - Required Stringstatus
- New issue's status - Required Enum {"accept", "falsepositive", "reopen"}search_sonar_issues_in_projects - Search for SonarQube issues in my organization's projects
projects
- Optional list of Sonar projects - String[]pullRequestId
- Optional Pull Request's identifier - Stringcomponent
- Optional component key to get measures for - Stringbranch
- Optional branch to analyze for measures - StringmetricKeys
- Optional metric keys to retrieve (e.g. nloc, complexity, violations, coverage) - String[]pullRequest
- Optional pull request identifier to analyze for measures - Stringp
- Optional 1-based page number (default: 1) - Integerps
- Optional page size. Must be greater than 0 and less than or equal to 500 (default: 100) - Integerpage
- Optional page number - Stringget_quality_gate_status_for_project - Get the Quality Gate Status for the project
analysisId
- Optional analysis ID - Stringbranch
- Optional branch key - StringprojectId
- Optional project ID - StringprojectKey
- Optional project key - StringpullRequest
- Optional pull request ID - Stringlist_quality_gates - List all quality gates in the organization
list_rule_repositories - List rule repositories available in SonarQube
language
- Optional language key - Stringq
- Optional search query - Stringshow_rule - Shows detailed information about a SonarQube rule
key
- Rule key - Required StringThis server collects anonymous usage data and sends it to SonarSource to help improve the product. No source code or IP address is collected, and SonarSource does not share the data with anyone else. Collection of telemetry can be disabled with the following system property or environment variable: TELEMETRY_DISABLED=true
. Click here to see a sample of the data that are collected.
Copyright 2025 SonarSource.
Licensed under the SONAR Source-Available License v1.0
Retrieving and analyzing issues from Sentry.io
Create crafted UI components inspired by the best 21st.dev design engineers.
Connect to any function, any language, across network boundaries using AgentRPC.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.
Enable AI agents to interact with the Atla API for state-of-the-art LLMJ evaluation.
Bring the full power of BrowserStack’s Test Platform to your AI tools, making testing faster and easier for every developer and tester on your team.
Flag features, manage company data, and control feature access using Bucket.
Manage Buildkite pipelines and builds.
A Model Context Protocol server for generating visual charts using AntV.