SonarQube MCP server: 48 tools you can narrow
A code-quality connector that treats context cost as a setting, with a read-only mode, and a header that lets a single request narrow its own tool list.
Last verified 27 August 2026 · from SonarQube's own repository README and the GitHub record for that repository
This page is one of 90 in a directory of monitoring and developer tools. Each page checks what an AI coding agent can get out of the tool through its MCP server, the connector that lets the agent query the tool directly.
Summary
SonarQube publishes an MCP server as a container image, and its README documents 48 tools across 19 categories: analysis, coverage, dependency risks, issues, hotspots, measures, quality gates, architecture and more.
It is unusually explicit about treating the tool list as a setting. SONARQUBE_TOOLSETS selects which toolsets load, and the README states that only important toolsets are enabled by default to reduce context overhead.
Its read-only mode goes further than most. SONARQUBE_READ_ONLY disables every write, and in streamable HTTP mode a client can narrow further per request but cannot lift a restriction the server was started with.
What is the SonarQube MCP server?
It is SonarQube's server for the Model Context Protocol. SonarQube analyzes code quality and security, so a connected agent can check its own output and read what the platform already found.
The tools split into two kinds. Some query the platform, such as search_sonar_issues_in_projects and get_project_quality_gate_status. Others run analysis, such as analyze_file_list through a running SonarQube for IDE instance.
A third group reads code structure rather than findings. get_upstream_call_flow, get_downstream_call_flow, get_type_hierarchy and get_references are context tools, gated behind an organization entitlement.
SonarQube's 48 documented tools examine analysis, coverage, risks, issues and quality gates. Those are software-delivery signals; this server does not report production behavior, agent traces or cost.
| Part of the work | What SonarQube has here | Can an agent reach it |
|---|---|---|
| Code, tests & review | Analysis, issues, hotspots, duplications, coverage, architecture | Yes. Core strength, across the widest code-quality surface measured in this guide |
| CI & release | Quality gates, branches, pull requests | Partial. Gate status and branch analysis are reachable; nothing runs or configures a pipeline |
| Production observability | Server health of SonarQube itself | No. get_system_health reports on SonarQube itself, not on your services |
| Agent observability & evals | Agentic readiness assessments | Partial, and about your codebase. The assessment tools score how ready code is for agents, not how your agents behave |
| AI cost management | None | No spend data of any kind |
For an agent, that means SonarQube answers whether the code meets a standard and where it does not. It can read issues, check a quality gate and trace a call flow. It knows nothing about the running system, so a question about behavior needs a telemetry connector.
What can an AI agent do with SonarQube?
| Task | Tools | Works | Watch out for |
|---|---|---|---|
| Analyze a file the agent just wrote | analyze_file_list analyze_code_snippet | Yes | analyze_code_snippet is documented as deprecated and due for removal |
| Read what the platform already found | search_sonar_issues_in_projects search_security_hotspots show_security_hotspot | Yes | Issues and hotspots are separate concepts with separate tools |
| Check whether a branch can merge | get_project_quality_gate_status list_branches list_pull_requests | Yes | Gate status is per project and branch, not per commit |
| Find untested or duplicated code | search_files_by_coverage get_file_coverage_details search_duplicated_files get_duplications | Yes | Coverage figures come from the last analysis, not from a live run |
| Understand how code connects | Enable vortex get_upstream_call_flow get_downstream_call_flow get_type_hierarchy get_references | Yes | These work only in stdio mode, and only if your SonarQube organization is entitled to both Vortex toolsets |
| Triage a finding | change_sonar_issue_status change_security_hotspot_status | Yes | Both write. SONARQUBE_READ_ONLY disables them |
| Check dependency risk | Enable dependency-risks search_dependency_risks | Yes | It is a toolset of its own, enabled by default |
Start with search_my_sonarqube_projects. It returns the project key every other tool needs, so the agent discovers the key first and composes the issue or gate query second. Its projects toolset is always enabled, and nothing in SONARQUBE_TOOLSETS turns it off.
48 tools documented across 19 categories; twelve toolsets are enabled by default
- Analysis3
analyze_file_listtoggle_automatic_analysisrun_advanced_code_analysis- Issues2Write
search_sonar_issues_in_projectschange_sonar_issue_status- Security hotspots3Write
search_security_hotspotsshow_security_hotspotchange_security_hotspot_status- Quality gates2
get_project_quality_gate_statuslist_quality_gates- Coverage2
search_files_by_coverageget_file_coverage_details- Duplications2
search_duplicated_filesget_duplications- Measures2
get_component_measuressearch_metrics- Projects3
search_my_sonarqube_projectslist_brancheslist_pull_requests- Context augmentation5
get_upstream_call_flowget_downstream_call_flowget_type_hierarchyget_referencesget_source_code- System5
get_system_healthget_system_statusping_systemget_system_infoget_system_logs- Webhooks2Write
create_webhooklist_webhooks
Groups follow the README's own category headings, and name 33 of the 48 tools. Counts come from that README, read 24 August 2026: the server is distributed only as a container image, and no container runtime was available here to capture tools/list.
What connecting costs before the first question
A context window is the amount of text a model can hold at once. Forty-eight tools across nineteen categories cost 3,554 to 4,446 tokens on Claude at connection. That is the largest documented surface of any code-quality connector here.
This is one of the few servers where the number is adjustable. A read-only switch and toolset filtering both narrow what registers, so the figure below is the ceiling rather than the only option.
| Tool set | Tools | Tokens (GPT-5.6, GPT-5.5) | Tokens (GPT-4, GPT-3.5) | Tokens (Claude Haiku 4.5 to Opus 5) | Share of a 200,000-token window |
|---|---|---|---|---|---|
| Every tool documented | 48 | 1,707 to 2,142 | 1,699 to 2,134 | 3,554 to 4,446 | 0.8% to 2.2% |
Encodings: GPT-5.6, GPT-5.5 o200k_base; GPT-4, GPT-3.5 cl100k_base; Claude Haiku 4.5 to Opus 5 count_tokens. Counted from the 48 tool entries in the vendor's own documentation. That is the only public inventory.
The server could not be run for a live tools/list. So no input schemas are available. These figures cover each tool's name and description only. They are a floor, not the figure.
The Claude columns are measured through the API's count_tokens endpoint, with an empty schema per tool. So they cover the same content as the GPT columns. The range there is two tokenizer generations. Haiku 4.5 and Opus 4.6 sit at the low end. Opus 5 and Sonnet 5 sit at the high end. The gap between them is about a quarter.
Can SonarQube watch your own AI agents?
The word agentic appears in this connector, and it describes your codebase rather than your agents. Read from SonarQube’s MCP documentation on 24 August 2026.
| Signal | Covered | Notes |
|---|---|---|
| Trace and session tracking | No | No tool reaches a model call, a session or a run |
| Eval scores on recorded traffic | No | The assessment tools score how ready code is for agents to work on. They do not score what an agent produced |
| Prompt version tracking | No | No prompt passes through the connector, so none is versioned |
| Offline experiments | No | Analysis runs against code, not against a dataset of model output |
| Token and cost tracking | No | No tool returns a token count or a cost figure |
SonarQube MCP server limits: where answers come back incomplete
SonarQube treats its tool list as configuration rather than a fixed fact, creating the limits below.
The agent says: “SonarQube cannot do that.” The toolset may simply be off.
SONARQUBE_TOOLSETS replaces the default selection rather than adding to it, so naming one toolset switches off the other eleven defaults apart from projects.
An agent sees only the tools that registered, so a disabled toolset is indistinguishable from a missing feature.
Guard: Have the agent state which toolsets are enabled when it reports a capability as unavailable.
The agent says: “There is no call-flow information.” Those tools need an entitlement.
Vortex context tools and Vortex analysis tools share a single combined organization entitlement, and the README states an organization must be entitled to both to use either. They are also stdio-only.
Guard: Check the entitlement and the transport before treating an absent call flow as a limitation.
The agent says: “I have marked that as a false positive.” That changed a recorded status.
change_sonar_issue_status and change_security_hotspot_status write to the platform, and read-only mode defaults to false, so both are available unless it is switched on.
Guard: Set SONARQUBE_READ_ONLY=true unless triage by agent is the intended workflow.
How to configure SonarQube MCP for agents
- 1
Choose the toolsets deliberately
SONARQUBE_TOOLSETSreplaces the default selection entirely, so naming one toolset switches every other off exceptprojects. - 2
Turn on read-only mode unless writing is the point
SONARQUBE_READ_ONLYdisables issue status changes and every other write, and its effect is cumulative with the toolset filter. - 3
Know which mode you need
Vortex context and analysis tools are documented as available only in stdio mode, and both need an organization entitlement.
- 4
Pick Cloud or Server correctly
SonarQube Cloud needs an organization key, SonarQube Server needs a URL, and the US Cloud region needs its own URL as well.
Paste this into your agent’s instructions
The tool list depends on settings, so an absent capability can mean a disabled toolset rather than a missing feature. The block makes the agent say which.
When you answer using SonarQube MCP tools, state: - The project key and branch the answer covers. - Whether a capability was unavailable because its toolset is not enabled, rather than because the platform lacks it. - Whether you called change_sonar_issue_status or change_security_hotspot_status. Both change triage state. Never state that data does not exist. State that no issues matched the project and filters above. Write your answer in ASD-STE100 Simplified Technical English. Use short sentences with one idea in each.
Do you need the MCP server at all?
Not inside a pipeline. SonarQube has a web API, and for a dashboard or a gate check in a pipeline that is the direct route.
The connector earns its place through the analysis and context tools. Analyzing a file through SonarQube for IDE, or tracing a call flow, is not something a REST call returns.
For scanning without a platform at all, a local scanner such as Semgrep answers a narrower question with no server behind it.
Connect it when the agent works inside a SonarQube project. Use the web API for gates and reporting.
SonarQube MCP server setup
Every documented configuration runs the container image, so a container runtime is a prerequisite. There is no package or standalone binary.
SonarQube Cloud needs a token and an organization key. SonarQube Server needs a token and the server URL instead.
Claude Code
The token is a SonarQube Cloud token, passed into the container as an environment variable.
claude mcp add sonarqube \
--env SONARQUBE_TOKEN=$SONAR_TOKEN \
--env SONARQUBE_ORG=$SONAR_ORG \
-- docker run --init --pull=always -i --rm \
-e SONARQUBE_TOKEN -e SONARQUBE_ORG \
sonarsource/sonarqube-mcpCursor
In ~/.cursor/mcp.json. The token travels in env and is named again in the container arguments.
{"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>"}}}}Codex CLI
Codex reads TOML, so the JSON blocks above will not transfer. The same token applies.
[mcp_servers.sonarqube]
command = "docker"
args = ["run","--init","--pull=always","-i","--rm",
"-e","SONARQUBE_TOKEN","-e","SONARQUBE_URL",
"sonarsource/sonarqube-mcp"]
env = { SONARQUBE_TOKEN = "<YOUR_USER_TOKEN>",
SONARQUBE_URL = "<YOUR_SERVER_URL>" }Every other client
Each block below is the configuration for one client, with the file path and the key that client expects.
Claude Desktop
macOS ~/Library/Application Support/Claude/claude_desktop_config.json. Windows %APPDATA%\Claude\claude_desktop_config.json. There is no CLI. Edit through Settings, Developer, Edit Config.
Quit and restart fully for changes to load. Paths in args must be absolute. Logs at ~/Library/Logs/Claude/mcp.log.
{"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>"}}}}Gemini CLI
~/.gemini/settings.json globally, or .gemini/settings.json per project. Key mcpServers. CLI: gemini mcp add.
{"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>"}}}}VS Code Copilot
.vscode/mcp.json per workspace, or your user profile. CLI: code --add-mcp.
{"servers":{"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>"}}}}The key is `servers`, not `mcpServers`. VS Code is the only client that uses that name, and copying a config from anywhere else fails silently.
Windsurf
~/.codeium/windsurf/mcp_config.json, which is the path Windsurf documents. Key mcpServers, the same JSON shape as Cursor, carrying the same token.
Zed
~/.config/zed/settings.json, carrying the same token as the blocks above.
The key is `context_servers`. Zed does not call them MCP servers in config, so searching its settings for mcp finds nothing.
Google Antigravity
~/.gemini/config/mcp_config.json globally, or .agents/mcp_config.json per project. Key mcpServers. There is no CLI. Use the /mcp overlay in the editor. Supports stdio, streamable HTTP, SSE and websocket.
{"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>"}}}}Amp (Sourcegraph)
~/.config/amp/settings.json or .amp/settings.json, carrying the same token. The amp mcp CLI covers approve, doctor and oauth.
The key is `amp.mcpServers`, namespaced. A bare mcpServers block is ignored.
Cline
~/.cline/mcp.json per the docs. The source also reads ~/.cline/data/settings/cline_mcp_settings.json. Key mcpServers, standard JSON shape, carrying the same token. Supports stdio, streamable HTTP and SSE.
Goose (Block)
~/.config/goose/config.yaml, carrying the same token.
YAML, and servers are called `extensions`. Goose does not use the MCP vocabulary in config at all. Add one interactively with goose configure, or per session with goose session --with-extension.
Kiro (AWS)
.kiro/settings/mcp.json per workspace, or ~/.kiro/settings/mcp.json globally. Key mcpServers, standard JSON shape, carrying the same token.
Warp
~/.warp/.mcp.json or .warp/.mcp.json. Key mcpServers, standard shape, carrying the same token. Also addable through the /agent-add-mcp skill.
JetBrains Junie
.junie/mcp/mcp.json per project, or ~/.junie/mcp/mcp.json. Key mcpServers, carrying the same token. Use /mcp in the CLI to manage.
Roo Code
.roo/mcp.json per project. The global file is mcp_settings.json, opened from the Roo Code MCP settings view with Edit Global MCP. Key mcpServers, carrying the same token.
Continue
.continue/mcpServers/*.yaml, one file per server, carrying the same token.
YAML, and `mcpServers` is a list, not an object. Every JSON client keys servers by name. Continue takes an array, so a converted config will not parse.
Trae
.trae/mcp.json per project, or paste into the UI under Raw Config (JSON). Key mcpServers, standard shape, carrying the same token.
Devin
Devin has no config file to edit. Servers are added through a web form in the settings UI, and Devin's documentation states you do not need to write or paste JSON. The block below is the shape those fields describe, shown for reference. Either route uses the same token.
Read-only, narrowed toolsets
Both filters are cumulative, so this configuration is the narrowest useful one. The token is still required.
docker run --init --pull=always -i --rm \ -e SONARQUBE_TOKEN -e SONARQUBE_ORG \ -e SONARQUBE_READ_ONLY=true \ -e SONARQUBE_TOOLSETS=issues,quality-gates \ sonarsource/sonarqube-mcp
SonarQube Cloud US
The US region needs its own URL alongside the token and organization key.
docker run --init --pull=always -i --rm \ -e SONARQUBE_TOKEN -e SONARQUBE_ORG \ -e SONARQUBE_URL=https://sonarqube.us \ sonarsource/sonarqube-mcp
Read-only access, permissions and security
A read-only mode exists, and it is off by default
SONARQUBE_READ_ONLYdefaults to false, so issue and hotspot status changes are available on a bare connection.Server-level restrictions cannot be lifted per request
In streamable HTTP mode a client may narrow the toolset or force read-only for its own request, but cannot widen beyond what the server was launched with.
Two tools change triage state
change_sonar_issue_statusandchange_security_hotspot_statusalter how a finding is recorded.System tools expose the platform
get_system_infoandget_system_logsreturn SonarQube's own configuration and logs, which is more than a code-quality question needs.
Troubleshooting
- A documented tool is missing
- Its toolset is probably not enabled.
SONARQUBE_TOOLSETSreplaces the default selection, so naming one toolset disables the rest apart fromprojects. - Context tools return nothing
- Vortex context and analysis tools need an organization entitlement and are documented as available only in stdio mode.
- A status change is refused
SONARQUBE_READ_ONLYis set, or a client sent the read-only header for that request. A server-level restriction cannot be lifted per request.- A startup warning mentions deprecation
- The
cagandanalysistoolset keys are deprecated in favor of the unifiedvortexkey. The old keys still work and emit a warning.
SonarQube MCP server: Reference
| Item | Value |
|---|---|
| Status | 1.26.0.4269, released 31 August 2026 · counts captured on 1.25.0.3221 · repository pushed 1 September 2026 |
| Adoption | 635 stars · 94 forks · 37 releases · repository created 30 April 2025 |
| Distribution | sonarsource/sonarqube-mcp container image |
| Auth | SONARQUBE_TOKEN, plus SONARQUBE_ORG for Cloud or SONARQUBE_URL for Server |
| Tools | 48 documented across 19 categories |
| Default toolsets | Twelve, with projects always enabled |
| Read-only | SONARQUBE_READ_ONLY, default false |
| Transports | stdio and streamable HTTP; Vortex tools are stdio only |
| Inventory source | The repository README, read 24 August 2026 |
What engineers report
The repository carries 631 stars, 94 forks and 37 releases since 30 April 2025. Its README is unusually specific about switches and entitlements, so the counts below come from it directly.
| What was checked | What it shows |
|---|---|
| Stars | 631 |
| Last push | 21 August 2026 |
| Latest release | 1.25.0.3221, 18 August 2026 |
| Documented tools | 48 |
| Documented categories | 19 |
| Default toolsets | 12 |
| Always-on toolset | projects, required for project keys |
“The tool list this server advertises costs roughly 11,000 tokens, which every client pays on every conversation before a single tool is called.”
“I would like to track which tool was executed by which user and with what context or arguments. We need this for compliance and security reasons.”
Repository facts from the GitHub API, retrieved 24 August 2026. Tool inventory, toolsets and switches read from the repository README on the same date. The server is distributed only as a container image, and no container runtime was available in this environment, so no tools/list capture was made.
Should you connect an agent to SonarQube?
Yes. Best for a narrowed toolset with SONARQUBE_READ_ONLY=true, widened only where an agent is meant to triage.
- Strongest fit
- SonarQube teams who want an agent inside an existing quality workflow rather than a separate scanner.
- Main advantage
- One of the few servers here that treats context cost as configuration, with toolset selection and a read-only switch. GitHub pairs
GITHUB_TOOLSETSwith--read-only, Snyk documents--profile, and Rootly offers a slim tool profile. - Main weakness
- Container-only distribution, so a machine without a container runtime cannot run it at all.
- Operational risk
- Read-only mode defaults to false, so triage-changing tools are available on a bare connection.
From Oodle
One platform for agent traces and infrastructure
Agent traces usually sit in a different product from the rest of your telemetry, so when a slow database makes an agent slow the symptom is in one tool and the cause is in another. Oodle keeps both in one query surface, from $10 per million spans.
See agent observabilityFrequently asked questions
How many tools does the SonarQube MCP server have?
48 documented across 19 categories, read from the repository README on 24 August 2026. The server is distributed only as a container image, so no wire capture was made here.
Are all of them enabled?
No. The README states that only important toolsets are enabled by default to reduce context overhead, and lists twelve. SONARQUBE_TOOLSETS replaces that selection.
Is there a read-only mode?
Yes, SONARQUBE_READ_ONLY. It defaults to false, and its effect is cumulative with the toolset filter.
Why do the call-flow tools not appear?
Vortex context and analysis tools share one organization entitlement and are documented as available only in stdio mode.
Does it work with SonarQube Cloud and Server?
Both. Cloud needs an organization key, Server needs a URL, and the US Cloud region needs its own URL as well.