CODE SECURITY / SonarSource
SonarQube MCP Server
Inspect SonarQube issues and quality gates, with optional analysis and write tools controlled by toolsets and read-only mode.
“Analyze code quality and security with SonarQube Server or Cloud directly in AI assistants.”
01 / THE REASONING
Why this made the selection.
- Connects existing SonarQube findings to a coding workflow instead of treating generated fixes as analysis evidence.
- Documents separate toolset and read-only controls for local and per-request HTTP use.
- The pinned README connects an agent to SonarQube Server or Cloud, and it can also analyze a code snippet in the conversation.
- Read-only mode and per-request toolset headers can only shrink the tool set that the process was started with.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- Pinned SonarQube setup and access-control documentation
- Actual SSAL v1.0 licence at the same revision
- Java 21 build toolchain
- README.md
- LICENSE
- Round 2 reread of acquired publisher setup and permission evidence; see immutable wave review.
Our findings
- The actual SSAL licence restricts external AI interaction, while the same-revision README explicitly permits documented MCP use. The Java toolchain specifies version 21.
- Read-only mode and toolset selection are cumulative; HTTP request headers cannot expand the server-level tool scope.
- The server talks to SonarQube Server or Cloud with a user token, and it can analyze snippet content in the agent context.
- SONARQUBE_READ_ONLY=true is the documented read-only switch. Per-request SONARQUBE_TOOLSETS and SONARQUBE_READ_ONLY headers can only reduce that scope, never expand it.
- The README says not to hardcode the token. On Linux, a container cannot reach the IDE's embedded server on localhost without --network=host.
- The Cloud US connection requires SONARQUBE_URL=https://sonarqube.us in addition to the account's applicable Cloud configuration.
Not established by this review
- Installation, authentication and live tool execution were not tested.
- Service availability, security isolation and package/container parity with source were not tested.
- The server was not started and its tools were not called.
- A pin does not verify transitive dependencies.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Connect a server deliberately.
- The README's client commands span several lines, so no one-line command is reproduced. Add the README's docker run block to the client configuration with SONARQUBE_TOKEN and either SONARQUBE_ORG (Cloud) or SONARQUBE_URL (Server).
- Set SONARQUBE_READ_ONLY=true and a narrow SONARQUBE_TOOLSETS if the agent should not change issues. Do not commit the token.
Before you start
- Docker or another OCI runtime
- A SonarQube Cloud or Server user token
Documented configuration example
Use the client and authentication context described in the setup guidance. Configuration formats vary between hosts.
{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": [
"run",
"--init",
"--pull=always",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<your-token>",
"SONARQUBE_ORG": "<your-org>"
}
}
}
} 04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/SonarSource/sonarqube-mcp-server/blob/8cbd65c79da3b5ee2b24150efcc870dd95fed9e8/README.md
Supports: install, configExample, access, limitations, review, license
https://github.com/SonarSource/sonarqube-mcp-server/blob/8cbd65c79da3b5ee2b24150efcc870dd95fed9e8/LICENSE
Supports: license, limitations
- Java 21 build toolchain ↗Checked
https://github.com/SonarSource/sonarqube-mcp-server/blob/8cbd65c79da3b5ee2b24150efcc870dd95fed9e8/build.gradle.kts
Supports: language, install