NewAgent Observability is live.
Back to directory
SonarQube logo

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.

Connector
Official, container image
Coverage
Analysis, issues, hotspots, quality gates, measures, architecture
Tools
48 documented, in 19 categories
Biggest risk for an agent
Two tools change triage state unless read-only mode is on

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 workWhat SonarQube has hereCan an agent reach it
Code, tests & reviewAnalysis, issues, hotspots, duplications, coverage, architectureYes. Core strength, across the widest code-quality surface measured in this guide
CI & releaseQuality gates, branches, pull requestsPartial. Gate status and branch analysis are reachable; nothing runs or configures a pipeline
Production observabilityServer health of SonarQube itselfNo. get_system_health reports on SonarQube itself, not on your services
Agent observability & evalsAgentic readiness assessmentsPartial, and about your codebase. The assessment tools score how ready code is for agents, not how your agents behave
AI cost managementNoneNo 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?

TaskToolsWorksWatch out for
Analyze a file the agent just wroteanalyze_file_list analyze_code_snippetYesanalyze_code_snippet is documented as deprecated and due for removal
Read what the platform already foundsearch_sonar_issues_in_projects search_security_hotspots show_security_hotspotYesIssues and hotspots are separate concepts with separate tools
Check whether a branch can mergeget_project_quality_gate_status list_branches list_pull_requestsYesGate status is per project and branch, not per commit
Find untested or duplicated codesearch_files_by_coverage get_file_coverage_details search_duplicated_files get_duplicationsYesCoverage figures come from the last analysis, not from a live run
Understand how code connectsEnable vortex get_upstream_call_flow get_downstream_call_flow get_type_hierarchy get_referencesYesThese work only in stdio mode, and only if your SonarQube organization is entitled to both Vortex toolsets
Triage a findingchange_sonar_issue_status change_security_hotspot_statusYesBoth write. SONARQUBE_READ_ONLY disables them
Check dependency riskEnable dependency-risks search_dependency_risksYesIt 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 setToolsTokens (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 documented481,707 to 2,1421,699 to 2,1343,554 to 4,4460.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.

SignalCoveredNotes
Trace and session trackingNoNo tool reaches a model call, a session or a run
Eval scores on recorded trafficNoThe assessment tools score how ready code is for agents to work on. They do not score what an agent produced
Prompt version trackingNoNo prompt passes through the connector, so none is versioned
Offline experimentsNoAnalysis runs against code, not against a dataset of model output
Token and cost trackingNoNo 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. 1

    Choose the toolsets deliberately

    SONARQUBE_TOOLSETS replaces the default selection entirely, so naming one toolset switches every other off except projects.

  2. 2

    Turn on read-only mode unless writing is the point

    SONARQUBE_READ_ONLY disables issue status changes and every other write, and its effect is cumulative with the toolset filter.

  3. 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. 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.

Terminal
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.

Terminal
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-mcp

Cursor

In ~/.cursor/mcp.json. The token travels in env and is named again in the container arguments.

Terminal
{"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.

Terminal
[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.

Terminal
{"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.

Terminal
{"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.

Terminal
{"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.

Terminal
{"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.

Terminal
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.

Terminal
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_ONLY defaults 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_status and change_security_hotspot_status alter how a finding is recorded.

  • System tools expose the platform

    get_system_info and get_system_logs return 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_TOOLSETS replaces the default selection, so naming one toolset disables the rest apart from projects.
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_ONLY is 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 cag and analysis toolset keys are deprecated in favor of the unified vortex key. The old keys still work and emit a warning.

SonarQube MCP server: Reference

ItemValue
Status1.26.0.4269, released 31 August 2026 · counts captured on 1.25.0.3221 · repository pushed 1 September 2026
Adoption635 stars · 94 forks · 37 releases · repository created 30 April 2025
Distributionsonarsource/sonarqube-mcp container image
AuthSONARQUBE_TOKEN, plus SONARQUBE_ORG for Cloud or SONARQUBE_URL for Server
Tools48 documented across 19 categories
Default toolsetsTwelve, with projects always enabled
Read-onlySONARQUBE_READ_ONLY, default false
Transportsstdio and streamable HTTP; Vortex tools are stdio only
Inventory sourceThe 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 checkedWhat it shows
Stars631
Last push21 August 2026
Latest release1.25.0.3221, 18 August 2026
Documented tools48
Documented categories19
Default toolsets12
Always-on toolsetprojects, 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.”

senor14, GitHub issue, 12 August 2026 · An independent measurement of the tool-list cost, reported against version 1.24.0.3152 with 18 tools. This page measures release 1.25.0.3221, which documents 48.

“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.”

muellerst-hg, GitHub issue, 21 July 2026 · Audit logging, on an issue still open at the time of writing.

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_TOOLSETS with --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 observability

Frequently 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.

Changelog

  • 18 August 2026. SonarSource/sonarqube-mcp-server 1.25.0.3221 released, the most recent version.
  • 4 June 2025. First release, 0.0.1.36.
  • 30 April 2025. SonarSource/sonarqube-mcp-server created on GitHub.

Sources

Every number on this page traces to one of these

  1. Repository facts from the GitHub API · SonarSource/sonarqube-mcp-server, retrieved 24 August 2026
  2. Tool inventory, toolsets, switches and client configurations from the repository README
  3. Official MCP registry entry io.github.SonarSource/sonarqube-mcp-server, confirmed 27 August 2026

SonarQube’s own MCP documentation

Also code, tests and review:

For where the code lives: