sonarqube-mcp-server
The SonarQube MCP Server integrates SonarQube with AI assistants through the Model Context Protocol, providing access to code quality metrics and analysis. It supports usage with both SonarQube and SonarCloud environments, offering tools for managing projects, issues, and monitoring system health.
Overview
The SonarQube MCP Server enables AI assistants to interact with SonarQube's code quality analysis capabilities through the Model Context Protocol. This integration allows AI assistants to:
- Retrieve code metrics and analysis results
- Access and filter issues
- Check quality gates
- Analyze project quality over time
- View source code with issues
- Monitor system health
Quick Start
Prerequisites
- Claude Desktop installed
- A SonarQube instance or SonarCloud account
- A SonarQube/SonarCloud authentication token
Installation
NPX (Recommended)
Use npx to run the server.
Docker
Run the server using Docker.
Local Development
Run using Node.js for development purposes.
Available Tools
Project Management
projects
List all SonarQube projects with pagination support.
Metrics and Measures
metrics
Get available metrics.
measures_component
Get measures for a specific component.
Issue Management
issues
Get issues with extensive filtering options.
Quality Gates
List available quality gates and get project quality gate status.
Source Code
View source code with issues highlighted.
System Monitoring
Check the health status of the SonarQube instance.
Architecture
The server follows a modular architecture connecting Claude Desktop with SonarQube API.
Development
Prerequisites
- Node.js 20 or higher
- pnpm 10.7.0 or higher
- Docker
Testing
Jest is used for testing with mocked HTTP responses and coverage reporting.