SonarQube MCP
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
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
Maintainer
Works with
Installation
NPM
npx -y sonarqube-mcp-serverPIP
pip install sonarqube-mcpManual Installation
npx -y sonarqube-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-mcpGenerate 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.
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-mcpAdd 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"
}
}
}
}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.
SonarQube MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to SonarQube MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up SonarQube MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.