Skip to content
MCP server

Sonarqube MCP

MCP server giving coding agents read and triage access to SonarQube Cloud quality data

Runs locally
Install
Pricing
Open source
Platforms
CLI, API, macOS
Runs
Locally
Version
1.3.0
Listing updated
today

Similar MCP servers

About Sonarqube MCP

Sonarqube MCP is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

The README describes a Model Context Protocol server that connects coding agents to SonarQube Cloud, the hosted code-quality service. It exposes quality gate verdicts, analysis status, issue search and aggregation, security hotspots, per-file measures, per-line coverage and rule explanations through a set of read tools.

The server is written in C# on .NET 10 and ships as a Native AOT binary per platform, so there is no runtime to install. Five write tools (issue transitions, assignments, comments and hotspot reviews) are available, and setting SONARQUBE_MCP_READ_ONLY=1 removes them from the tool list entirely. A user token from the SonarQube Cloud account is needed for private projects and for any write action; public projects can be read without one.

It suits developers and teams who use an agent to work through failing quality gates on pull requests or to triage findings in an organization's SonarQube Cloud projects. SonarQube Server (self-hosted and Data Center) is explicitly out of scope.

Install

Run in a terminal

claude mcp add sonarqube-mcp --env SONARQUBE_TOKEN='<SONARQUBE_TOKEN>' -- dnx mcp-sonarqube --yes

Add to claude_desktop_config.json

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "dnx",
      "args": [
        "mcp-sonarqube",
        "--yes"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "dnx",
      "args": [
        "mcp-sonarqube",
        "--yes"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "sonarqube-mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "mcp-sonarqube",
        "--yes"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "dnx",
      "args": [
        "mcp-sonarqube",
        "--yes"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "sonarqube-mcp": {
      "command": "dnx",
      "args": [
        "mcp-sonarqube",
        "--yes"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<SONARQUBE_TOKEN>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • SONARQUBE_TOKENSonarQube Cloud user token, sent as a Bearer credential. Create one at https://sonarcloud.io/account/security and pick the User Token type - a project analysis token is not accepted by these endpoints. Without it the server still starts and reads public projects anonymously, but nothing private is reachable and no write tool works.Required
  • SONARQUBE_ORGOrganization key - the last segment of https://sonarcloud.io/organizations/{key}. Only listProjects and getRule require it, and a public organization answers both anonymously, so it is optional; set it and every project in that organization becomes discoverable.
  • SONARQUBE_URLBase URL of the SonarQube Cloud instance. Defaults to https://sonarcloud.io; the only other accepted host is https://sonarqube.us. SonarQube Server is out of scope and any other value is ignored.
  • SONARQUBE_MCP_DEFAULT_PROJECTProject key used when a tool call omits projectKey. It is the id in a sonarcloud.io project URL, not the repository name. Setting it is worth it when this server is configured per checkout.
  • SONARQUBE_MCP_READ_ONLYSet to 1 to register only the eighteen read tools. The five write tools - transitionIssue, assignIssue, addIssueComment, setHotspotStatus and bulkUpdateIssues - are then absent from tools/list rather than refused when called.

Tools this server provides (23)

Taken from the project documentation; the running server may differ.

listProjects
Lists the projects in the configured organization with their project keys.
listComponents
Lists analysed files and directories with component keys and project-relative paths.
listBranches
Lists analysed branches with last analysis date, issue counts and gate status.
listPullRequests
Lists analysed pull requests with gate status and new-code issue counts.
getQualityGateStatus
Reads the quality gate verdict and failing conditions for a project, branch or pull request.
getAnalysisStatus
Shows queued, running and recently finished analyses and any errors.
searchIssues
Searches issues with file paths, lines, messages, rules and clean-code impacts.
summarizeIssues
Counts issues grouped by rule, file, directory, severity and other facets.
getIssue
Returns one issue in full, including comments and available transitions.
getIssueChangelog
Returns an issue's history of status, resolution and assignee changes.
getRule
Explains a rule, what it flags and how to fix it.
searchHotspots
Searches security hotspots with vulnerability probability.
getHotspot
Returns one hotspot in full, including risk and review history.
getComponentMeasures
Reads named metrics for a project, directory or file.
listComponentMeasures
Lists metrics for every component under a project or directory, sortable by metric.
getMeasuresHistory
Returns metric time series over the analysis history.
listMetrics
Lists the metric catalogue with descriptions.
getFileCoverage
Returns per-line coverage for one file, excluding source text.
transitionIssue
Applies a triage transition to an issue with an optional comment.
assignIssue
Assigns an issue to a login or clears the assignee.
addIssueComment
Posts a comment on an issue.
setHotspotStatus
Records a hotspot review decision with a justification comment.
bulkUpdateIssues
Applies one transition, assignment and/or comment to up to 500 issues.

What it does

Quality gate verdicts
Reports the gate status for a project, branch or pull request along with the failing conditions and measured values.
Issue search and triage
Searches open issues with file paths, lines and rules, and supports transitions, assignment and comments when write tools are enabled.
Per-file coverage lines
Returns the line numbers that tests never executed or only partly covered for a given file, without returning source text.
Security hotspot review
Lists hotspots awaiting review with their vulnerability probability and records review decisions.
Read-only mode
An environment flag removes all write tools from registration so a client cannot call them.
Native single binary
Distributed as a self-contained Native AOT executable per platform, also installable through NuGet with dnx.

Good for

  • Working through a pull request whose SonarQube quality gate has failed
  • Finding the files with the most uncovered lines in an organization's projects
  • Looking up what a SonarQube rule flags and how to fix it
  • Triaging open issues by severity, author or rule without paging through results
  • Reviewing security hotspots and recording a decision from an agent session

Pricing

Open source

Free and MIT licensed; requires a SonarQube Cloud account for private projects.

Sonarqube MCP FAQ

Does it work without an API token?

Yes. The server starts without SONARQUBE_TOKEN and can read public projects anonymously, but private projects and all write tools need a user token.

Does it support self-hosted SonarQube Server?

No. The README says SonarQube Server, including self-hosted and Data Center editions, is out of scope; only SonarQube Cloud hosts are accepted.

What license is it under?

The README states it is MIT licensed.

How can write tools be disabled?

Setting SONARQUBE_MCP_READ_ONLY to 1 means the five write tools are not registered and are absent from tools/list.

Is Sonarqube MCP free?

Yes. Sonarqube MCP is open source, so you can use and self-host it for free.

How do I add Sonarqube MCP to Claude Code?

Run this command in your terminal: claude mcp add sonarqube-mcp --env SONARQUBE_TOKEN='<SONARQUBE_TOKEN>' -- dnx mcp-sonarqube --yes

What are the best alternatives to Sonarqube MCP?

The closest alternatives to Sonarqube MCP are MCPProxy, Bitbucket MCP, Enterprise MCP Gateway, M00N Report and Qai Consultant MCP.

Where this comes from

  • Description: written from the project's README and its MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers