SonarQube MCP Server logo

SonarQube MCP Server

by sapientpants

The SonarQube MCP Server integrates with SonarQube to provide AI assistants with access to code quality metrics, issues, and analysis results. It enables AI assistants to interact with SonarQube's code quality analysis capabilities through the Model Context Protocol.

View on GitHub

Last updated: N/A

What is SonarQube MCP Server?

The SonarQube MCP Server is a Model Context Protocol (MCP) server that bridges the gap between SonarQube and AI assistants, allowing them to access and utilize SonarQube's code quality data.

How to use SonarQube MCP Server?

To use the server, configure your AI assistant (e.g., Claude Desktop) to connect to the server using either Docker or NPX. You'll need to provide your SonarQube URL and authentication token. The server then exposes tools like 'projects' and 'issues' that the AI assistant can use to query SonarQube.

Key features of SonarQube MCP Server

  • List SonarQube projects with pagination

  • Get detailed issue information with filtering

  • Support for SonarQube and SonarCloud

  • Comprehensive parameter validation using Zod

Use cases of SonarQube MCP Server

  • Retrieving code metrics for AI analysis

  • Filtering and accessing specific code issues

  • Checking code quality status via AI

  • Analyzing project quality trends over time

FAQ from SonarQube MCP Server

What is the default SonarQube URL?

The default SonarQube URL is https://next.sonarqube.com/sonarqube.

Is the SonarQube organization key required?

No, the SonarQube organization key is optional.

What environment variables are required?

The required environment variables are SONARQUBE_URL and SONARQUBE_TOKEN.

How do I run the server in development mode?

Use the command pnpm run dev.

What is the purpose of the 'issues' tool?

The 'issues' tool allows you to retrieve issues from a SonarQube project, with extensive filtering options based on severity, status, resolution, and more.