SonarQube MCP

v0.1.0Developer Toolsstable

An MCP server for SonarQube that enables LLM agents to discover projects, analyze code quality metrics, check Quality Gate status, search issues with filters, and rank projects by worst-performing metrics. It provides read-only, safe access to SonarQ

agentaicode-qualitymcpmcp-server
Share:
556
Stars
0
Downloads
0
Weekly
0/5

What is SonarQube MCP?

SonarQube MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for sonarqube that enables llm agents to discover projects, analyze code quality metrics, check quality gate status, search issues with filters, and rank projects by worst-performing metric...

An MCP server for SonarQube that enables LLM agents to discover projects, analyze code quality metrics, check Quality Gate status, search issues with filters, and rank projects by worst-performing metrics. It provides read-only, safe access to SonarQ

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • projects
  • metrics
  • issues
  • markIssueFalsePositive
  • markIssueWontFix

Use Cases

Code quality metrics analysis
Quality Gate status checking
Static analysis and security
mshegolev

Maintainer

LicenseMIT License
Languagejava
Versionv0.1.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y sonarqube-mcp-server

PIP

pip install sonarqube-mcp

Manual Installation

npx -y sonarqube-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use SonarQube MCP

The SonarQube MCP server gives AI assistants read-only access to your SonarQube instance, exposing project discovery, code quality metrics, Quality Gate status, and issue search over the Model Context Protocol. It connects directly to your self-hosted or SonarCloud instance using a bearer token, making it safe to use in automated pipelines. Developers use it to ask natural-language questions about code health, surface the worst-performing projects by a given metric, and triage BLOCKER or CRITICAL issues without leaving their AI assistant.

Prerequisites

  • Python 3.10 or higher installed
  • A running SonarQube instance (self-hosted or SonarCloud) with a valid URL
  • A SonarQube user token generated from My Account → Security → Tokens
  • uvx or pipx available for installation
  • An MCP-capable client such as Claude Desktop or Claude Code
1

Install the package

Install sonarqube-mcp using uvx (recommended for zero-install usage) or pipx for a persistent global install.

# Recommended: run directly with uvx
uvx --from sonarqube-mcp sonarqube-mcp

# Or install permanently with pipx
pipx install sonarqube-mcp
2

Generate a SonarQube API token

Log in to your SonarQube instance, navigate to My Account → Security → Tokens, and create a new token. Copy the token value — it will not be shown again. This token is used as the SONARQUBE_TOKEN environment variable.

3

Register the MCP server with Claude Code

Use the claude mcp add command to register the server at the project or user scope, passing your instance URL and token as environment variables.

claude mcp add sonarqube -s project \
  --env SONARQUBE_URL=https://sonar.example.com \
  --env SONARQUBE_TOKEN=squ_your_token \
  --env SONARQUBE_SSL_VERIFY=true \
  -- uvx --from sonarqube-mcp sonarqube-mcp
4

Add to Claude Desktop configuration (alternative)

If you are using Claude Desktop instead of Claude Code, add the server entry to your claude_desktop_config.json file.

{
  "mcpServers": {
    "sonarqube": {
      "command": "uvx",
      "args": ["--from", "sonarqube-mcp", "sonarqube-mcp"],
      "env": {
        "SONARQUBE_URL": "https://sonar.example.com",
        "SONARQUBE_TOKEN": "squ_your_token",
        "SONARQUBE_SSL_VERIFY": "true"
      }
    }
  }
}
5

Verify the connection

Restart your MCP client and ask it to list SonarQube projects. If the server is connected correctly, it will return a paginated list of projects from your instance.

SonarQube MCP Examples

Client configuration

Claude Desktop JSON config using uvx to run sonarqube-mcp with required environment variables.

{
  "mcpServers": {
    "sonarqube": {
      "command": "uvx",
      "args": ["--from", "sonarqube-mcp", "sonarqube-mcp"],
      "env": {
        "SONARQUBE_URL": "https://sonar.example.com",
        "SONARQUBE_TOKEN": "squ_your_token",
        "SONARQUBE_SSL_VERIFY": "true"
      }
    }
  }
}

Prompts to try

Example natural-language queries you can send to your AI assistant once the server is connected.

- "List all SonarQube projects matching 'api'"
- "Show me the top 10 projects with the worst bug count"
- "What is the Quality Gate status for the project einvy:aut_einvy?"
- "Find all BLOCKER and CRITICAL vulnerabilities in the payments-service project"
- "What is the test coverage percentage for the qa_assistant project?"

Troubleshooting SonarQube MCP

Authentication error: 401 Unauthorized when connecting to SonarQube

Verify that SONARQUBE_TOKEN is set correctly and has not expired. Generate a fresh token from My Account → Security → Tokens in the SonarQube UI and update the environment variable.

SSL certificate verification failure when SONARQUBE_SSL_VERIFY=true

If your SonarQube instance uses a self-signed certificate, set SONARQUBE_SSL_VERIFY=false to disable SSL verification, or ensure the certificate is trusted in your system's CA store.

No projects returned by sonarqube_list_projects

Confirm that the token has Browse permission on the relevant SonarQube projects. Tokens with restricted scope will only see projects they have been granted access to.

Frequently Asked Questions about SonarQube MCP

What is SonarQube MCP?

SonarQube MCP is a Model Context Protocol (MCP) server that mcp server for sonarqube that enables llm agents to discover projects, analyze code quality metrics, check quality gate status, search issues with filters, and rank projects by worst-performing metrics. it provides read-only, safe access to sonarq It connects AI assistants to external tools and data sources through a standardized interface.

How do I install SonarQube MCP?

Install via npm with the command: npx -y sonarqube-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with SonarQube MCP?

SonarQube MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is SonarQube MCP free to use?

Yes, SonarQube MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "sonarqube": { "command": "npx", "args": ["-y", "sonarqube-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use SonarQube MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides