CodeQL Development MCP Server
OFFICIAL SERVERWrite, test, run and profile CodeQL queries from an AI assistant through the local CodeQL CLI
SonarQube Cloud or Server findings, quality gates and code analysis inside your coding assistant
Official · Sonar Java Local · stdio Developer toolsSecurity
80 popularity score ★ 680 ⇣ 712k pulls
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
It needs SONARQUBE_TOKEN. Replace each <NAME> with your value.
claude mcp add sonarqube -e SONARQUBE_TOKEN=<SONARQUBE_TOKEN> -- docker run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": [
"run",
"--init",
"--pull=always",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": [
"run",
"--init",
"--pull=always",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}{
"servers": {
"sonarqube": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"--init",
"--pull=always",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
}
}
}
}[mcp_servers.sonarqube]
command = "docker"
args = ["run", "--init", "--pull=always", "-i", "--rm", "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_ORG", "sonarsource/sonarqube-mcp"]
[mcp_servers.sonarqube.env]
SONARQUBE_TOKEN = "<SONARQUBE_TOKEN>"gemini mcp add --scope user -e SONARQUBE_TOKEN=<SONARQUBE_TOKEN> sonarqube docker -- run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcpSONARQUBE_TOKEN secret |
Required: SonarQube Cloud token, or a USER token for SonarQube Server. |
|---|---|
SONARQUBE_ORG |
Optional: Cloud organization key to pin; without it tools take an organization argument. |
SONARQUBE_URL |
Optional: Server address (needed for SonarQube Server); https://sonarqube.us for Cloud US. |
SONARQUBE_TOOLSETS |
Optional: Comma-separated toolsets to enable instead of the default set (e.g. vortex). |
SONARQUBE_READ_ONLY |
Optional: true hides every tool that can change data. |
SONARQUBE_PROJECT_KEY |
Optional: Default project key; removes projectKey from tool inputs. |
TELEMETRY_DISABLED |
Optional: true stops anonymous usage data being sent to SonarSource. |
STORAGE_PATH |
Optional: Writable folder for the server's files; set by the image, required when running the JAR. |
| Set together: analysis | |
SONARQUBE_IDE_PORT |
Optional: Port 64120-64130 of a running SonarQube for IDE to use for analysis. |
SONARQUBE_FORCE_LOCAL_ANALYSIS |
Optional: true keeps analyze_code_snippet instead of Vortex analysis on Cloud over stdio; needs the analysis toolset. |
| Set together: http | |
SONARQUBE_TRANSPORT |
Optional: http or https to serve Streamable HTTP instead of stdio. |
SONARQUBE_HTTP_HOST |
Optional: Address the HTTP service binds to. |
In a container, a setting goes in with -e NAME=value after docker run.
SonarSource's own MCP server connects an assistant to SonarQube Cloud or a self-managed SonarQube Server. The assistant can look up issues and security hotspots and change their status, check a project's quality gate, read measures, coverage and duplication data, inspect rules, list branches and pull requests, and on Server read system health and logs. It can also run SonarQube's analyzers on a file the assistant is working on.
Only a token is needed to start. With no SONARQUBE_URL it connects to SonarQube Cloud (sonarcloud.io); SONARQUBE_ORG is now optional and, when set, pins one Cloud organization. Without it, list_organizations finds the user's organizations and organization-aware tools take an optional organization argument.
Which analysis tool appears is decided at startup, per the 1.30.0.4763 source. Over stdio on Cloud, run_advanced_code_analysis (Vortex) replaces analyze_code_snippet when a workspace is mounted at /app/mcp-workspace and an organization is entitled to Vortex; SONARQUBE_FORCE_LOCAL_ANALYSIS=true keeps analyze_code_snippet instead. Otherwise, if SonarQube for IDE answers on SONARQUBE_IDE_PORT, analyze_file_list and toggle_automatic_analysis are offered; if not, analyze_code_snippet. On a Vortex-entitled Server without a workspace mount, the code registers no analysis tool at all. Over HTTP, Cloud gets no analysis tools and Server gets analyze_code_snippet only when a startup SONARQUBE_TOKEN is set. The Vortex context tools come from a separate proxied server, stdio only,; the new vortex toolset replaces cag. Enterprise, organization and agentic readiness tools are Cloud-only; system tools are Server-only.
Two settings the code reads are not in the README: SONARQUBE_IS_CLOUD=true forces Cloud mode, and the older SONARQUBE_CLOUD_URL is still accepted when SONARQUBE_URL is unset. It runs over stdio by default, or as a stateless Streamable HTTP service (SONARQUBE_TRANSPORT=http or https) where each request brings its own bearer token.
| Runtime | Docker |
|---|---|
| Runs on | macOS, Windows, Linux |
| SonarQube Cloud | Free tierUser token; Vortex and agentic readiness tools need an organization entitlement |
| SonarQube Server | Your own instance2025.1 or later (Community Build 25.1+), USER token only; dependency risks need 2025.4 Enterprise with Advanced Security |
Docker runs the sonarsource/sonarqube-mcp image, or Java 21+ runs the release JAR, which then also needs STORAGE_PATH set to a writable folder. Create a USER token in SonarQube (project and global tokens do not work on Server). For Server, set SONARQUBE_URL; without it the server connects to SonarQube Cloud. Images are tagged latest, by build (1.30.0.4763) and, for some releases, by the SonarQube Server version they align with (e.g. 2026.5.0).
In stdio mode it exits at start without SONARQUBE_TOKEN, and without either SONARQUBE_ORG (Cloud) or SONARQUBE_URL (Server); it also exits when the Server version is older than 2025.1. analyze_code_snippet is deprecated and slated for removal. The Vortex tools only work over stdio. search_duplicated_files fetches at most 10,000 files. Sending a SONARQUBE_TOKEN header in HTTP mode is deprecated in favour of Authorization: Bearer. Licensed under the SONAR Source-Available License, not an open-source licence; use of results is bound by SonarQube's terms.
Teams already on SonarQube Cloud or SonarQube Server 2025.1 or later who want an assistant to triage issues, check quality gates or analyse a file before committing. Being SonarSource's own server, it tracks product features such as Vortex and dependency risks, though several need paid entitlements. Users on SonarQube Server 9.x or 10.x cannot use it, as it refuses older versions. Anyone wanting only lookups can set SONARQUBE_READ_ONLY=true; anyone without a SonarQube account gets nothing from it.
44 only read, 5 change things.
analyze_code_snippetanalyze_file_listtoggle_automatic_analysis changesrun_advanced_code_analysissearch_files_by_coverageget_file_coverage_detailssearch_dependency_riskslist_enterpriseslist_organizationschange_sonar_issue_status changessearch_sonar_issues_in_projectssearch_security_hotspotsshow_security_hotspotchange_security_hotspot_status changeslist_languagesget_component_measuressearch_metricslist_portfoliossearch_my_sonarqube_projectslist_brancheslist_pull_requestsget_project_quality_gate_statuslist_quality_gatesshow_rulesearch_duplicated_filesget_duplicationsget_raw_sourceget_scm_infoget_system_healthget_system_infoget_system_logsping_systemget_system_statuscreate_webhook changeslist_webhookssearch_by_signature_patternssearch_by_body_patternsget_upstream_call_flowget_downstream_call_flowget_source_codeget_type_hierarchyget_referencesget_current_architectureget_intended_architectureget_guidelinescheck_dependencystart_agentic_readiness_assessment changesget_agentic_readiness_assessmentlist_agentic_readiness_assessments