New advertisers: 50% off your first month with code FIRSTMONTHSee slots
lahma avatar

Sonarqube Mcp

lahma/sonarqube-mcp

Read and triage SonarQube Cloud issues, quality gates, hotspots, and coverage from an MCP client.

tools
23
auth
Secret needed
transport
STDIO
env vars
5
last updated
Nov 18, 2026
View on GitHub

What it does

  • Reads with listProjects, searchIssues, summarizeIssues, getQualityGateStatus, and getFileCoverage, filtered by branch, pull request, author, or file path
  • Writes with transitionIssue, assignIssue, addIssueComment, setHotspotStatus, and bulkUpdateIssues; none of them deletes anything, and SONARQUBE_MCP_READ_ONLY=1 removes all five
  • Requires a SonarQube Cloud token, runs as a local self-contained binary, and excludes self-hosted SonarQube Server
  • Designed for triaging findings, checking quality gates after CI, and reviewing security hotspots from a coding agent

Tools

23 tools

Public tool metadata for what this MCP can expose to an agent.

listProjectsLists the projects in the configured organization with the key every other tool takes as `projectKey`.

Lists the projects in the configured organization with the key every other tool takes as `projectKey`.

No parameter schema in public metadata yet.

listComponentsLists the files and directories SonarQube analysed, each with its component key and project-relative path.

Lists the files and directories SonarQube analysed, each with its component key and project-relative path.

No parameter schema in public metadata yet.

listBranchesLists the analysed branches with each one's last analysis date, issue counts and gate status, and which is the main branch.

Lists the analysed branches with each one's last analysis date, issue counts and gate status, and which is the main branch.

No parameter schema in public metadata yet.

listPullRequestsLists the analysed pull requests with their gate status and new-code issue counts.

Lists the analysed pull requests with their gate status and new-code issue counts.

No parameter schema in public metadata yet.

getQualityGateStatusReads the gate verdict for a project, branch or pull request.

Reads the gate verdict for a project, branch or pull request.

No parameter schema in public metadata yet.

getAnalysisStatusWhat SonarQube is doing with the project right now: analyses queued or running, and the last one that finished.

What SonarQube is doing with the project right now: analyses queued or running, and the last one that finished.

No parameter schema in public metadata yet.

searchIssuesSearches issues, newest first, each with its file path, line, message, rule and clean-code impacts.

Searches issues, newest first, each with its file path, line, message, rule and clean-code impacts.

No parameter schema in public metadata yet.

summarizeIssuesCounts issues grouped by rule, file, directory, severity, quality, status, tag, language, assignee, author or security standard in one call.

Counts issues grouped by rule, file, directory, severity, quality, status, tag, language, assignee, author or security standard in one call.

No parameter schema in public metadata yet.

getIssueOne issue in full: comments, the secondary locations that explain a data-flow finding, and availableTransitions.

One issue in full: comments, the secondary locations that explain a data-flow finding, and availableTransitions.

No parameter schema in public metadata yet.

getIssueChangelogOne issue's history: who changed its status, resolution or assignee, when, and from what.

One issue's history: who changed its status, resolution or assignee, when, and from what.

No parameter schema in public metadata yet.

getRuleExplains one rule: what it flags, why it matters and how to fix it, with the HTML converted to text and code fenced.

Explains one rule: what it flags, why it matters and how to fix it, with the HTML converted to text and code fenced.

No parameter schema in public metadata yet.

searchHotspotsSearches security hotspots, security-sensitive code awaiting a human decision, with each one's vulnerability probability.

Searches security hotspots, security-sensitive code awaiting a human decision, with each one's vulnerability probability.

No parameter schema in public metadata yet.

getHotspotOne hotspot in full: the risk, what an attacker could do, how to make it safe, the review history, and canChangeStatus.

One hotspot in full: the risk, what an attacker could do, how to make it safe, the review history, and canChangeStatus.

No parameter schema in public metadata yet.

getComponentMeasuresReads named metrics for a project, directory or file.

Reads named metrics for a project, directory or file.

No parameter schema in public metadata yet.

listComponentMeasuresThe same metrics for every component under a project or directory, one row per file, sortable by a metric.

The same metrics for every component under a project or directory, one row per file, sortable by a metric.

No parameter schema in public metadata yet.

getMeasuresHistoryOne time series per metric over the analysis history: whether something is getting better or worse.

One time series per metric over the analysis history: whether something is getting better or worse.

No parameter schema in public metadata yet.

listMetricsThe metric catalogue with what each key measures and whether higher is better.

The metric catalogue with what each key measures and whether higher is better.

No parameter schema in public metadata yet.

getFileCoverageOne file's per-line coverage: the lines tests never executed, the partially covered ones, the new-code lines and the duplicated ones.

One file's per-line coverage: the lines tests never executed, the partially covered ones, the new-code lines and the duplicated ones.

No parameter schema in public metadata yet.

transitionIssueApplies a triage transition with an optional comment. Reversible and recorded in the issue's changelog.

Applies a triage transition with an optional comment. Reversible and recorded in the issue's changelog.

No parameter schema in public metadata yet.

assignIssueAssigns an issue to a login, or clears the assignee.

Assigns an issue to a login, or clears the assignee.

No parameter schema in public metadata yet.

addIssueCommentPosts a comment on an issue.

Posts a comment on an issue.

No parameter schema in public metadata yet.

setHotspotStatusRecords a hotspot review with a justification comment.

Records a hotspot review with a justification comment.

No parameter schema in public metadata yet.

bulkUpdateIssuesApplies one transition, assignment and/or comment to up to 500 issues at once.

Applies one transition, assignment and/or comment to up to 500 issues at once.

No parameter schema in public metadata yet.

Configuration

SONARQUBE_TOKEN*secret

SonarQube 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

SONARQUBE_ORG

Organization 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_URL

Base 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_PROJECT

Project 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_ONLY

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

Readme

sonarqube-mcp

A Model Context Protocol server for SonarQube Cloud, covering the surface a coding agent actually uses in twenty-three tools: quality gates, analysis status, issue triage and aggregation, security hotspots, measures, per-line coverage and rule explanations, plus five gated write tools for transitioning, assigning, commenting on and reviewing findings. It is written in C# on .NET 10 and ships as a Native AOT binary per platform — one self-contained executable, nothing to install, starting in roughly ten milliseconds. The point of the project is a supply chain one person can actually audit: the whole runtime dependency tree is three packages, all from Microsoft or the official MCP organisation — ModelContextProtocol (pinned exactly to 2.4.0), Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Logging.Console. Set SONARQUBE_MCP_READ_ONLY=1 and the five write tools are not registered at all. MIT licensed.

SonarQube Server — the self-hosted and Data Center editions — is explicitly out of scope.


View the full README on GitHub

Details

Repository
github.com/lahma/sonarqube-mcp
Categories
Developer Tools, Security
Package
mcp-sonarqube
Transport
STDIO
Auth
Required
Registry
MCP registry, active

More from lahma

All 3

Similar to Sonarqube Mcp

More Developer Tools