
Your agent checks quality gates, explains issues, Security Hotspots and coverage gaps, and analyzes code with SonarQube Cloud or Server.
by sonarsource· Developer toolsUnclaimed · Yours? Claim it
About
Sonar's SonarQube MCP Server connects your agent to the code quality and security data in SonarQube Cloud or SonarQube Server, so it can check your work and fix what SonarQube finds without you leaving the chat. What you can do with it - Check a project's quality gate, on a branch or a pull request, and find out why it's failing before you merge - Search issues across your projects, have them explained, and accept them, mark them false positives or reopen them - Review Security Hotspots and the dependency risks in a project - Find the files with the lowest test coverage and the exact lines left uncovered - Analyze a file or a code snippet with SonarQube's analyzers before you commit - Look up rules, measures, duplications, branches and pull requests How it connects It runs on your machine as the sonarsource/sonarqube-mcp container image (Docker or another OCI runtime), or as a JAR with Java 21 or later. Give it a SonarQube user token as SONARQUBE_TOKEN. On its own, the token connects to SonarQube Cloud, and SONARQUBE_ORG fixes the organization. For SonarQube Server (2025.1 or later) or SonarQube Cloud US, set SONARQUBE_URL as well and pass it into the container with -e SONARQUBE_URL, as the install steps do for SONARQUBE_TOKEN. Sonar also runs the server inside SonarQube Cloud at https://api.sonarcloud.io/mcp, with a smaller, fixed set of tools. Read-only when you want it Set SONARQUBE_READ_ONLY=true to turn off every tool that changes something, such as changing an issue's status. SONARQUBE_TOOLSETS limits which groups of tools load, which keeps the context small. Good to know It sends anonymous usage data to Sonar unless you set TELEMETRY_DISABLED=true. Its Sonar Vortex tools need a Vortex subscription.
Plugins people install alongside SonarQube MCP Server.
4 images
Once it’s added
“My quality gate is failing for my project. Can you help me understand why and fix the most critical issues?”
“I'm about to merge pull request #247 for the web-app project. Can you check if there are any quality issues I should address first?”
“Our code coverage dropped below 70%. Which files have the lowest coverage, and can you help me improve it?”
“Are there any known vulnerabilities in our dependencies? Check this project for dependency risks.”
“I just wrote this authentication function. Can you analyze it for security issues and code quality problems before I commit?”
“Give me a health report for my project: quality gate status, number of bugs, Security Hotspots and code coverage.”
Before you add it
Reads only
Quality gate status for projects, branches and pull requests · Issues, Security Hotspots and dependency risks · Coverage, measures, duplications and rules · Analysis results for files and code snippets
Makes changes · your agent can ask first
Accepts issues, marks them false positives or reopens them · Reviews Security Hotspots by changing their status · Creates webhooks
From people who use it
Step by step
Nothing new reaches your agent until a person has looked at it.
Scanned on every change, and again when our rules improve.
Runs on your machine.
claude_desktop_config.json{
"mcpServers": {
"sonarqube-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"docker.io/sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}Runs on your machine.
Add to VS Codecode --add-mcp '{"name":"sonarqube-mcp-server","command":"docker","args":["run","-i","--rm","-e","SONARQUBE_TOKEN","docker.io/sonarsource/sonarqube-mcp"],"env":{"SONARQUBE_TOKEN":"<SONARQUBE_TOKEN>"}}'copilot mcp add sonarqube-mcp-server --env SONARQUBE_TOKEN=<SONARQUBE_TOKEN> -- docker run -i --rm -e SONARQUBE_TOKEN docker.io/sonarsource/sonarqube-mcp
Runs on your machine.
Add to Cursor.cursor/mcp.json{
"mcpServers": {
"sonarqube-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"docker.io/sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}Runs on your machine.
claude mcp add -e SONARQUBE_TOKEN=<SONARQUBE_TOKEN> sonarqube-mcp-server -- docker run -i --rm -e SONARQUBE_TOKEN docker.io/sonarsource/sonarqube-mcp
Runs on your machine.
codex mcp add --env SONARQUBE_TOKEN=<SONARQUBE_TOKEN> sonarqube-mcp-server -- docker run -i --rm -e SONARQUBE_TOKEN docker.io/sonarsource/sonarqube-mcp
Runs on your machine.
~/.gemini/config/mcp_config.json{
"mcpServers": {
"sonarqube-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"docker.io/sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}Runs on your machine.
gemini mcp add -e SONARQUBE_TOKEN=<SONARQUBE_TOKEN> sonarqube-mcp-server docker run -i --rm -e SONARQUBE_TOKEN docker.io/sonarsource/sonarqube-mcp
Runs on your machine.
Runs on your machine.
opencode mcp add sonarqube-mcp-server --env SONARQUBE_TOKEN=<SONARQUBE_TOKEN> -- docker run -i --rm -e SONARQUBE_TOKEN docker.io/sonarsource/sonarqube-mcp
Runs on your machine.
~/.hermes/config.yaml{
"mcp_servers": {
"sonarqube-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"docker.io/sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}SONARQUBE_TOKENRequiredSecretYour SonarQube USER tokenSONARQUBE_ORGOptionalSecretYour SonarQube Cloud organization key (if using SonarQube Cloud)SONARQUBE_URLOptionalSecretYour SonarQube Server URL (if using SonarQube Server)Replace each <NAME> placeholder with your own value.
Scanned and passed · checked 6 h ago
No reviews yet. Used SonarQube MCP Server? Say how it went.
Write a reviewPlugins people install alongside SonarQube MCP Server.
Matt Pocock's everyday engineering skills: grilling sessions, specs and tickets, TDD, bug diagnosis, code review and writing for agents.
Addy Osmani's engineering workflows for coding agents: spec, plan, build, test, review and ship, with quality gates at each step.
Nobody has shared how they use SonarQube MCP Server yet.
Security scan
Passed
Safe to install in every agent it supports. Runs on your machine.