SonarQubeCAUTION
Official SonarQube MCP Server for code quality and security in AI agents
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/SonarSource/sonarqube-mcp-server/actions/workflows/build.yml) [](https://sonarcloud.io/summary/newcode?id=SonarSourcesonarqube-mcp-server)
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.
Quick setup
Security best practices
🔒 Important: Your SonarQube token is a sensitive credential. Follow these security practices:
When using CLI commands:
- Avoid hardcoding tokens in command-line arguments – they get saved in shell history
- Use environment variables – set tokens in environment variables before running commands
When using configuration files:
- Never commit tokens to version control
- Use environment variable substitution in config files when possible
🚀 Generate your configuration
The fastest way to get started is the [SonarQube MCP Server Configuration Generator](https://mcp.sonarqube.com/config-generator.html) – an interactive tool that produces a ready-to-use configuration for your preferred AI agent client.
Manual setup
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
41ba54e99af7OBSERVED · 2026-09-28Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add sonarqube-mcp --env SONARQUBE_TOKEN=${SONARQUBE_TOKEN} --env SONARQUBE_ORG=${SONARQUBE_ORG} --env SONARQUBE_URL=${SONARQUBE_URL} -- docker run -i --rm docker.io/sonarsource/sonarqube-mcp:NoneTrust audit
CAUTIONgrade B · trust 87/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | WARN |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- declared (1 observation(s))
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- found
Findings (12)
gradle-wrapper.jar
private static final String API_KEY = "1b8EU3XmRk5MKpIhqzKoD54LzfplrL2X1RLkLzLA";
test-keystore.p12
- When bound to `127.0.0.1` or `localhost` (default): localhost browser origins (`http://localhost`, `http://127.0.0.1`, `http://[::1]`, with any port).
System.setProperty(AnalyticsClient.PROPERTY_ANALYTICS_ENDPOINT, "http://192.0.2.1:9999/mcp");
var expectedUrl = "http://127.0.0.1:" + testPort + "/mcp";
var healthUrl = "http://127.0.0.1:" + testPort + McpSecurityFilter.HEALTH_ENDPOINT;
var infoUrl = "http://127.0.0.1:" + testPort + McpSecurityFilter.INFO_ENDPOINT;
[](https://cursor.com/en-US/install-mcp?name=sonarqube&config=eyJlbnYiOnsiU09OQVJRVUJFX1RPS0VOIjoiWU9VUl9UT0tFTiIsIlNPTk
[](https://cursor.com/en-US/install-mcp?name=sonarqube&config=eyJlbnYiOnsiU09OQVJRVUJFX1RPS0VOIjoiWU9VUl9VU0VSX1RPS0VOI
This 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.
Gates applied: no_behavioural_pass.
41ba54e99af7full audit observations/trust-audit/mcp-server/sonarsource__sonarqube-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-09-28 | 41ba54e99af7 | CAUTION | B | 87 | first audit |
Questions
What is the SonarQube MCP server?
Official SonarQube MCP Server for code quality and security in AI agents
Is SonarQube safe to connect to an agent?
With care. The audit graded it B (87/100) and found 12 things worth knowing before you trust this server, listed below with the exact line each was found on.
What credentials does SonarQube need?
It reads SONARQUBE_ORG, SONARQUBE_TOKEN and SONARQUBE_URL from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does SonarQube run?
It speaks stdio, so it runs as a local process your client starts.
How current is this page?
The grade is for one exact copy of the source (41ba54e99af7), read on 2026-09-28. The repository is watched and re-audited when it changes.