▌BestMCPTools.org
SonarQube MCP logo

SonarQube MCP

Sonar's official MCP server for code quality and security data from SonarQube

Developer ToolsFreemiumClaude CodeCursorVS CodeWindsurfGemini CLICodex CLIGitHub CopilotModerate

Last verified: November 24, 2026

Own SonarQube MCP? Boost it to the top.✦ Upgrade to Featured

How to Install SonarQube MCP

$docker run -i --rm --init --pull=always -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp

Compatible with: Claude Code, Cursor, VS Code, Windsurf, Gemini CLI, Codex CLI, GitHub Copilot.

Setup by client

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "--pull=always",
        "-e",
        "SONARQUBE_TOKEN",
        "-e",
        "SONARQUBE_ORG",
        "sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "--pull=always",
        "-e",
        "SONARQUBE_TOKEN",
        "-e",
        "SONARQUBE_ORG",
        "sonarsource/sonarqube-mcp"
      ]
    }
  }
}

VS Code (.vscode/mcp.json)

{
  "servers": {
    "sonarqube-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "--pull=always",
        "-e",
        "SONARQUBE_TOKEN",
        "-e",
        "SONARQUBE_ORG",
        "sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Claude Code (terminal)

claude mcp add sonarqube-mcp -- docker run -i --rm --init --pull=always -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp

Add any API keys or environment variables the server's README lists.

About SonarQube MCP

SonarQube MCP is the official Model Context Protocol server from Sonar, the company behind SonarQube. It connects an AI coding agent to the code quality and security data held in SonarQube Cloud, SonarQube Server or SonarQube Community Build, so an assistant can look up issues, quality gate results, security hotspots, coverage and more while it works on your code. It can run as a container on your machine, or (per the docs) as a hosted option inside SonarQube Cloud or SonarQube Server.

Quick facts (as of November 24, 2026)

SonarQube MCP
MakerSonar (SonarSource)
TypeSelf-hosted container (stdio by default, optional Streamable HTTP or HTTPS), plus SonarQube Cloud-hosted and SonarQube Server-hosted options
Container imagesonarsource/sonarqube-mcp
AuthA SonarQube user token (stdio), Authorization: Bearer header (HTTP/HTTPS), or OAuth for the Cloud-hosted server
Supported back endsSonarQube Cloud (EU and US), SonarQube Server 2025.1 or newer, Community Build 25.1 or newer
Documented clientsSetup guides for Antigravity, Claude Code, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI and coding agent, Kiro, VS Code, Windsurf and Zed (per the repository README; the docs overview lists a slightly different set)
LicenseSonar Source-Available License v1.0.1 (per the docs)
Latest release seen1.25.0 (tag 1.25.0.3221), listed on GitHub as published 18 August
PriceThe MCP server has no separate price stated; SonarQube plans have their own (see Pricing)

What it is

The server gives an agent read access (and a few write actions) to a SonarQube instance. The docs describe tools grouped into areas such as analysis, issues, quality gates, security hotspots, coverage, duplications, dependency risks, projects, measures and metrics, rules, sources, portfolios, webhooks, system information, Vortex context and architecture. Sonar also publishes a configuration generator at mcp.sonarqube.com that produces a working setup for a chosen IDE or CLI.

There are three ways to run it according to the setup docs. First, a self-hosted container that you run yourself. Second, a SonarQube Cloud-hosted server, embedded in SonarQube Cloud, which the docs say provides a smaller, fixed subset of tools. Third, a SonarQube Server-hosted option for SonarQube Server 2026.3 and later in the Developer, Enterprise and Data Center editions, which an administrator installs as an extension. The docs do not list its tools beyond saying you can limit them with SONARQUBE_TOOLSETS. Sonar Vortex needs local filesystem access, so it does not work on either hosted option.

Tools and capabilities

The Tools reference lists these tools (names as written on the page):

  • Projects: list_organizations (Cloud only), search_my_sonarqube_projects, list_branches, list_pull_requests
  • Issues: search_sonar_issues_in_projects, change_sonar_issue_status (write: accepted, false positive or reopened)
  • Security hotspots: search_security_hotspots, show_security_hotspot, change_security_hotspot_status (write)
  • Quality gates: get_project_quality_gate_status, list_quality_gates
  • Coverage and duplications: search_files_by_coverage, get_file_coverage_details, search_duplicated_files, get_duplications
  • Measures, metrics, rules, languages: get_component_measures, search_metrics, show_rule, list_languages
  • Sources: get_raw_source, get_scm_info
  • Dependencies: search_dependency_risks (requires Advanced Security), check_dependency (requires SCA on Cloud)
  • Analysis: run_advanced_code_analysis (Vortex analysis of one file; needs a mounted workspace and a Vortex entitlement), analyze_file_list and toggle_automatic_analysis (through a running SonarQube for IDE instance), and analyze_code_snippet (deprecated)
  • Vortex context (requires a Vortex subscription): search_by_signature_patterns, search_by_body_patterns, get_upstream_call_flow, get_downstream_call_flow, get_source_code, get_type_hierarchy, get_references
  • Architecture: get_current_architecture, get_intended_architecture, architecture_get, architecture_set (a write)
  • Guidelines, portfolios, enterprises: get_guidelines, list_portfolios, list_enterprises (Cloud Enterprise only)
  • System (SonarQube Server only): get_system_health, get_system_info, get_system_logs, ping_system, get_system_status
  • Webhooks: create_webhook (write), list_webhooks

The reference also mentions an Agentic Readiness toolset (Cloud only, when the feature is enabled for your organization) without naming its tools. Toolsets can be switched with SONARQUBE_TOOLSETS, and SONARQUBE_READ_ONLY=true disables write operations.

Setup for Claude, Cursor and other clients

The docs show Docker-based stdio configurations. These are taken from the Claude Code and Cursor quickstart pages.

Claude Code, SonarQube Cloud

claude mcp add sonarqube \
  --env SONARQUBE_TOKEN=$SONARQUBE_TOKEN \
  --env SONARQUBE_ORG=$SONARQUBE_ORG \
  -- \
docker run -i --rm --init --pull=always -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp

For the US region, add -e SONARQUBE_URL to the Docker arguments and set SONARQUBE_URL to https://sonarqube.us. The EU region does not need it.

Claude Code, SonarQube Server

claude mcp add sonarqube \
  --env SONARQUBE_TOKEN=$SONARQUBE_TOKEN \
  --env SONARQUBE_URL=$SONARQUBE_URL \
  -- \
  docker run -i --rm --init --pull=always -e SONARQUBE_TOKEN -e SONARQUBE_URL sonarsource/sonarqube-mcp

Cursor, SonarQube Server (in your mcp.json; restart Cursor after changing it)

{
  "mcpServers": {
    "sonarqube": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--init", "--pull=always",
        "-e", "SONARQUBE_TOKEN",
        "-e", "SONARQUBE_URL",
        "sonarsource/sonarqube-mcp"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<YourSonarQubeUserToken>",
        "SONARQUBE_URL": "<YourSonarQubeServerURL>"
      }
    }
  }
}

For Cursor with SonarQube Cloud, use the same file with SONARQUBE_ORG in place of SONARQUBE_URL. To verify the connection, the docs suggest asking the agent to call the ping_system tool.

HTTP or HTTPS client config (when you run the server with SONARQUBE_TRANSPORT=http or https):

{
  "mcpServers": {
    "sonarqube": {
      "type": "https",
      "url": "https://<YourSonarQubeMCPServer>:8443/mcp",
      "headers": { "Authorization": "Bearer <YourSonarQubeUserToken>" }
    }
  }
}

For the hosted options the docs point to the configuration generator rather than listing exact snippets on the pages we read. The self-hosted page also notes that Docker's MCP Hub publishes mcp/sonarqube, which may lag behind releases, and that Podman or nerdctl can run the image.

Authentication

Use a SonarQube user token. The docs warn that setup fails with project tokens, global tokens or scoped organization tokens. With stdio the token goes in SONARQUBE_TOKEN. With HTTP or HTTPS each client sends Authorization: Bearer <token>, and the older SONARQUBE_TOKEN header is deprecated. For SonarQube Cloud, SONARQUBE_ORG selects the organization (optional; otherwise you choose per tool call). The docs say Claude Code is a supported OAuth client for the Cloud-hosted server, so sign-in without a user token is possible there. For OAuth, the mcp:tools:read and mcp:tools:write scopes control read and write tools separately.

Limits and things to watch

  • Version floor. SonarQube Server 2025.1 or newer (2026.1 or newer recommended) and Community Build 25.1 or newer. Server 9.x and 10.x, and Community Build 24.x, are not supported. The server checks the version at startup and stops if it is too old (not applied to Cloud).
  • Only the latest release is supported. The prerequisites page says so.
  • Gated features. Vortex tools need a subscription, dependency tools need Advanced Security or SCA, and the architecture toolset needs Cloud Team or Enterprise, or Server 2026.6 or later in Developer edition or above.
  • Write tools exist. Changing issue or hotspot status, creating webhooks and architecture_set are writes; consider SONARQUBE_READ_ONLY=true.
  • Architecture reads. A current architecture view shows at most 150 nodes, 20 dependencies and 5 feedback pairs, and architecture reads share a two-read limit.
  • Deprecations. analyze_code_snippet is deprecated, several parameters were removed in 1.23, and the SSE-only HTTP transport is unsupported.
  • Telemetry. Anonymous usage data is collected unless TELEMETRY_DISABLED=true is set; the docs say Sonar does not collect IP addresses or source code.
  • Docker required for local use. Self-hosting needs a container tool, or JDK 21 or newer for the standalone JAR.

Pricing

The MCP server docs state no separate price. It works against your SonarQube instance, so costs follow your SonarQube plan. As of November 2026, Sonar's pricing page lists SonarQube Cloud Free at $0 (private projects up to 50k lines of code), Team from $34 per month for up to 100k lines of code, and Enterprise on annual pricing that is not published. SonarQube Server Developer, Enterprise and Data Center editions are priced per instance per year based on lines of code, with no figures on that page, and Community Build is an open source edition. Check Sonar's pricing before relying on any figure.

Pros and cons

Pros

  • Official server from the vendor, with documented setup for a long list of clients, including Claude Code and Cursor.
  • Works with Cloud, Server and Community Build, with an EU and US region option.
  • Broad tool coverage across issues, hotspots, quality gates, coverage and duplications.
  • A read-only switch and toolset filtering for tighter control.
  • HTTP and HTTPS transports for a shared team deployment.

Cons

  • Requires a SonarQube instance and a user token; it is not useful on its own.
  • Local setup needs Docker (or a JDK for the JAR).
  • Some of the most advanced tools depend on paid subscriptions or specific editions.
  • License is source-available, not a standard open source license.
  • Only the latest release is supported, and deprecations are ongoing.

Who it is for

A good fit if:

  • Your team already uses SonarQube and wants an agent to read issues and quality gate status while fixing code.
  • You want the agent to check coverage, duplications or hotspots on a branch or pull request.

Not the right tool if:

  • You do not use SonarQube. See the alternatives below.
  • You are on an unsupported SonarQube version (Server 9.x or 10.x).

Alternatives

Semgrep MCP brings static analysis findings to an assistant, GitHub MCP and GitLab MCP cover repository and pull request workflows, and Sentry MCP covers runtime errors rather than static quality.

What we don't know

  • Repository activity. The GitHub page we read showed no archive notice, but did not display a last push or commit date. The releases page listed 1.25.0 as published 18 August without a year in the text we read.
  • Rate limits. The pages we read mention no rate limits or quotas, apart from the architecture read limit.
  • Hosted option pricing. We did not find a separate price for the Cloud-hosted or Server-hosted MCP options.
  • Agentic Readiness tools. The tool names were not shown in the reference.
  • Behavior in practice. This page is based on documentation only.

How this page was put together

We read Sonar's MCP server documentation (overview, about, prerequisites, setup, quickstarts, self-hosting, tools reference, environment variables and deprecations), the GitHub repository and releases pages, and Sonar's pricing page on November 24, 2026, and compared the documented tools, setup steps and requirements. We did not test the server.

Sources

Pricing

Freemium: from No MCP server charge stated in Sonar docs (as of November 2026); SonarQube Cloud Free $0, Team from $34/month

Our Take on SonarQube MCP

An official server that is worth installing if your team already runs SonarQube. It needs a user token and usually Docker, has write tools you can switch off, and some advanced tools depend on paid features.

Frequently Asked Questions

Tags