Sonarqube MCP Server logo

Sonarqube MCP Server

Connects AI agents to SonarQube Server or Cloud for code analysis, coverage review, dependency risks, and issue status changes.

Install Sonarqube MCP Server

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://your-server:8443/mcp

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Overview

sonarqube-mcp-server connects MCP-compatible AI clients to SonarQube Server or SonarQube Cloud for code quality and security workflows. It can analyze complete files or snippets, inspect coverage, find dependency risks, run SonarQube for IDE and Vortex analysis, and update issue statuses. The server runs through a Docker container using standard MCP stdio transport, with SonarQube credentials and endpoint settings supplied through environment variables. Reach for it when an agent needs to review code against SonarQube analyzers or investigate project quality data.

Use cases

  • Analyze source files for quality and security issues
  • Find files with the weakest test coverage
  • Inspect uncovered and partially covered lines
  • Search project dependency risks
  • Update SonarQube issue statuses from an agent

Key features

  • SonarQube Server and Cloud connectivity
  • Complete-file and snippet-filtered code analysis
  • SonarQube for IDE file analysis
  • Coverage search and line-level details
  • Dependency risk searches
  • Issue status changes

Tools80

What Sonarqube MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~2.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

20/23 checks healthy over the last 90d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars680Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed80Callable tools this server registers over MCP.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Sonarqube MCP Server works

What sonarqube-mcp-server does

sonarqube-mcp-server exposes SonarQube code quality and security operations through the Model Context Protocol. It supports both SonarQube Server and SonarQube Cloud, allowing an MCP-compatible client to send source files for analysis or query quality data from an existing SonarQube project.

The server covers two related workflows. For direct source review, an agent can submit complete file content, optionally identify a project-relative path, specify the language, and filter returned findings to a matching snippet. For repository-level work, it can analyze files in the current working directory through a running SonarQube for IDE instance and control that instance’s automatic analysis behavior.

How it works

The standard setup launches the published sonarsource/sonarqube-mcp container with Docker or another OCI-compatible runtime. MCP requests are exchanged over the container’s standard input and output. Authentication and the target SonarQube deployment are configured with environment variables rather than passed as tool arguments.

Cloud connections use a SonarQube token and organization key. Server connections use a user token and SonarQube URL. SonarQube Cloud US can be selected by setting the URL to https://sonarqube.us.

File analysis can receive source text directly when the workspace is not mounted. When the workspace is mounted at /app/mcp-workspace, a project-relative file path can identify the file instead. Analysis inputs also distinguish production code from test code through MAIN and TEST scopes.

Setup and configuration

The project provides an interactive configuration generator for supported AI agent clients. Manual configuration uses the sonarsource/sonarqube-mcp container image. Using --pull=always tracks the image tag selected for the deployment; a pinned tag can instead be used for reproducible container configuration.

Keep SONARQUBE_TOKEN out of shell history and source control. Set credentials through environment variables or substitute them into configuration files without committing the secret. The relevant connection settings are:

  • SONARQUBE_TOKEN: SonarQube Cloud token or SonarQube Server user token.
  • SONARQUBE_ORG: SonarQube Cloud organization key.
  • SONARQUBE_URL: SonarQube Server URL, or the SonarQube Cloud US endpoint.
  • SONARQUBE_PROJECT_KEY: Default project key for operations that use a project; tool-level values can override it where supported.

Documented client setup paths include Cursor, Claude Code, Codex CLI, Gemini CLI, Antigravity, and GitHub Copilot CLI. The Gemini CLI extension is installed from the sonarqube-agent-plugins repository.

Tools and capabilities

  • Analyze complete source files with SonarQube analyzers and optionally filter findings to a supplied snippet.
  • Analyze lists of absolute file paths through SonarQube for IDE.
  • Enable or disable automatic SonarQube for IDE analysis.
  • Run Vortex analysis for an individual file using a branch’s latest analysis context.
  • Find project files with coverage at or below a chosen threshold, including pull-request filtering and pagination.
  • Retrieve line-level coverage details, including uncovered lines and partially covered branches.
  • Search dependency risks associated with releases in analyzed projects, applications, or portfolios.
  • List accessible SonarQube Cloud enterprises and change issue statuses to accepted, false positive, or reopened, with an optional comment.

Limitations and notes

The direct snippet-analysis operation requires complete file content for accurate analysis; a snippet can be used as a result filter only when it matches content in that file. Coverage detail lookup uses a SonarQube file key and can be limited to a line range. Pull-request coverage searches require a valid pull-request key, which can be discovered with list_pull_requests.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Sonarqube MCP Server

sonarqube-mcp-server is an MCP server that connects AI clients to SonarQube Server or SonarQube Cloud. Its main tools analyze files and code snippets, inspect coverage, search dependency risks, run SonarQube for IDE or Vortex analysis, list Cloud enterprises, and change SonarQube issue statuses.

Install it by configuring the `sonarsource/sonarqube-mcp` container as an MCP server, or use the SonarQube MCP Server Configuration Generator. Docker is shown in the setup examples, and OCI-compatible runtimes such as Podman, nerdctl, or equivalent can replace it.

Set `SONARQUBE_TOKEN` and `SONARQUBE_ORG` when connecting to SonarQube Cloud. For SonarQube Cloud US, also set `SONARQUBE_URL` to `https://sonarqube.us`, then launch the configured MCP container or client extension.

Yes, sonarqube-mcp-server has Cursor setup links for both SonarQube Cloud and SonarQube Server. The Cloud configuration uses a token and organization key, while the Server configuration uses a token and SonarQube URL.

It analyzes the complete file content with SonarQube analyzers and can then filter the returned issues to a supplied snippet. The snippet must match content in `fileContent`; the request can also specify the language, project key, file path, and `MAIN` or `TEST` scope.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSonarqube MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/sonarqube-mcp-server?style=directory)](https://allmcps.com/mcp/sonarqube-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/sonarqube-mcp-server"><img src="https://allmcps.com/api/badge/sonarqube-mcp-server?style=directory" alt="Sonarqube MCP Server on AllMCPs" /></a>