An MCP server that enables integration with SonarQube Server or Cloud for code quality and security.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Sonarqube MCP Server.
analyze_code_snippetAnalyze 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.
projectKeyThe SonarQube project key - _Required String_ _(Ignored when `SONARQUBE_PROJECT_KEY` is defined)_
filePathProject-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_
fileContentComplete file content as a string. Required when workspace is not mounted - _String_
codeSnippetCode snippet to filter issues (must match content in fileContent) - _String_
languageLanguage of the code (e.g., 'java', 'python', 'js', 'ts', 'tsx', 'jsx') - _String_
The SonarQube MCP Server is a Model Context Protocol (MCP) server that enables seamless integration with SonarQube Server or Cloud for code quality and security. It also supports the analysis of code snippet directly within the agent context.
π Important: Your SonarQube token is a sensitive credential. Follow these security practices:
When using CLI commands:
When using configuration files:
The fastest way to get started is the SonarQube MCP Server Configuration Generator β an interactive tool that produces a ready-to-use configuration for your preferred AI agent client.
If you prefer to configure things yourself, the simplest method is to use our container image at sonarsource/sonarqube-mcp. Use sonarsource/sonarqube-mcp for automatic updates (with --pull=always), or pin to a version tag (e.g., sonarsource/sonarqube-mcp:1.19.0.2785) for reproducible deployments. Read below if you want to build it locally.
Note: While the examples below use
docker, any OCI-compatible container runtime works (e.g., Podman, nerdctl). Simply replacedockerwith your preferred tool.
SonarQube MCP Server is available in the Antigravity MCP Store. Follow these instructions:
SonarQube and select InstallFor SonarQube Cloud US, set the URL to https://sonarqube.us.
Alternatively, you can manually configure the server via mcp_config.json:
In the Agent Side Panel, click the three dots (...) -> MCP Store -> Manage MCP Servers -> View raw config, and add the following:
For SonarQube Cloud US, manually add "SONARQUBE_URL": "https://sonarqube.us" to the env section and "-e", "SONARQUBE_URL" to the args array.
For SonarQube Cloud US, add --env SONARQUBE_URL=https://sonarqube.us to the command.
Manually edit the configuration file at ~/.codex/config.toml and add the following configuration:
For SonarQube Cloud US, add "SONARQUBE_URL" = "https://sonarqube.us" to the env section and "-e", "SONARQUBE_URL" to the args array.
For SonarQube Cloud US, manually add "SONARQUBE_URL": "https://sonarqube.us" to the env section in your MCP configuration after installation.
Note: The Gemini CLI extension has moved to the sonarqube-agent-plugins repository. Please install it from there going forward.
You can install our MCP server extension by using the following command:
You will need to set the required environment variables before starting Gemini:
Environment Variables Required:
For SonarQube Cloud:
SONARQUBE_TOKEN - Your SonarQube Cloud tokenSONARQUBE_ORG - Your organization keySONARQUBE_URL - (Optional) Set to https://sonarqube.us for SonarQube Cloud USFor SonarQube Server:
SONARQUBE_TOKEN - Your SonarQube Server USER tokenSONARQUBE_URL - Your SonarQube Server URLOnce installed, the extension will be installed under <home>/.gemini/extensions/sonarqube/gemini-extension.json.
After starting Copilot CLI, run the following command to add the SonarQube MCP server:
You will have to provide different information about the MCP server, you can use tab to navigate between fields.
For SonarQube Cloud US, add -e, SONARQUBE_URL to Arguments and SONARQUBE_URL=https://sonarqube.us to Environment Variables.
The configuration file is located at ~/.copilot/mcp-config.json.
GitHub Copilot coding agent can leverage the SonarQube MCP server directly in your CI/CD.
To add the secrets to your Copilot environment, follow the Copilot documentation. Only secrets with names prefixed with COPILOT_MCP_ will be available to your MCP configuration.
In your GitHub repository, navigate under Settings -> Copilot -> Coding agent, and add the following configuration in the MCP configuration section:
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sonarqube-mcp-server)<a href="https://allmcps.com/mcp/sonarqube-mcp-server"><img src="https://allmcps.com/api/badge/sonarqube-mcp-server?style=directory" alt="Sonarqube MCP Server on AllMCPs" /></a>