# SonarQube MCP Server

The SonarQube [MCP](https://modelcontextprotocol.io/introduction) Server is a centralized service that connects code analysis and developer tools so teams can consistently enforce standards, automate checks, and improve code quality across repositories. Teams get a single source of truth for code health, enabling faster remediation, standardized workflows, and reliable gates that improve release confidence.

The SonarQube MCP Server can act as a hub that complements SonarQube by coordinating analysis triggers and aggregating insights from multiple projects. It helps standardize policy enforcement so SonarQube conditions become part of your CI checks, keeping quality at the source and ensuring new code quality gates are applied consistently.

The SonarQube MCP Server can align cloud-based project analysis, ensuring unified governance and reporting. For developers, pairing MCP Server with SonarQube for IDE brings issues into the editor so they can fix problems before commit, strengthening quality at the source and reducing pipeline churn.

## Overview <a href="#overview" id="overview"></a>

The SonarQube MCP Server allows you to retrieve information and perform actions on your SonarQube Server instance or SonarQube Cloud organization. It is compatible with MCP clients listed in the [#prerequisites](#prerequisites "mention") below.

Upon receiving a request from an MCP client, the SonarQube MCP Server calls the SonarQube Server or SonarQube Cloud API to perform actions:<br>

<figure><img src="broken-reference" alt="Overview of the SonarQube MCP Server setup."><figcaption></figcaption></figure>

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Run or build a version of the SonarQube MCP Server:
  * For the container installation, you must use a container management tool, such as Docker.
  * To build the server locally, you will need either:
    * a Java Development Kit (JDK) version 21 or later,
    * or build the server with Gradle.
* The SonarQube MCP Server integrates with:
  * your organization on SonarQube Cloud including organizations in the US region,
  * your instance of SonarQube Server 2025.1 or newer,
  * or your instance of SonarQube Community Build.
* Be using one of the MCP Clients compatible with the SonarQube MCP Server, for example:
  * Claude Code, Cursor, Gemini CLI, VS Code with GitHub Copilot, Kiro, Windsurf, or the Zed editor. See the [#set-up-in-your-ide](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/quickstart-guide#set-up-in-your-ide "mention") instructions on the [quickstart-guide](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/quickstart-guide "mention") page for full instructions.

## Using the server

To get started using the SonarQube Server, use the [quickstart-guide](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/quickstart-guide "mention"), read about how to [build-and-configure](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/build-and-configure "mention") your server, then review all the [tools](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/using/tools "mention") at your disposal.

When you're ready, check out the [using](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/using "mention") page for an overview, then [integration](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/using/integration "mention") and [analyze-your-code](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/using/analyze-your-code "mention") for setup and usage examples.

If needed, there's some [help](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/resources/help "mention") and [troubleshooting](https://open-2v.gitbook.com/url/docs.sonarsource.com/sonarqube-mcp-server/resources/troubleshooting "mention") resources at your disposal.

## MCP Server in SonarQube Cloud

Use the embedded SonarQube Cloud MCP server to avoid running and maintaining your own MCP infrastructure while always using the current server version. The embedded server exposes a smaller, fixed subset of tools; for the available toolsets and configuration details, check SonarQube Cloud's [SonarQube MCP Server #MCP Server in SonarQube Cloud](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/ai-capabilities/sonarqube-mcp-server#mcp-server-in-sonarqube-cloud "mention") page.

## Data and telemetry

The SonarQube MCP Server collects anonymous usage data and sends it to Sonar to help improve the product. Sonar does not collect your IP address, does not collect your source code, and does not share the data with anyone else.

Collection of telemetry can be disabled with the following system property or environment variable: `TELEMETRY_DISABLED=true`. See [this page in the source repository](https://github.com/SonarSource/sonarqube-mcp-server/blob/master/telemetry-sample.md) to see a sample of the data that is collected.

## License

Licensed under the [SONAR Source-Available License v1.0](https://www.sonarsource.com/license/ssal/). Using the SonarQube MCP Server in compliance with this documentation is a Non-Competitive Purpose and so is allowed under the SSAL.

Your use of SonarQube via MCP is governed by the [SonarQube Cloud Terms of Service](https://www.sonarsource.com/legal/sonarcloud/terms-of-service/) or [SonarQube Server Terms and Conditions](https://www.sonarsource.com/legal/sonarqube/terms-and-conditions/), including use of the Results Data solely for your internal software development purposes.
