drio
Open app

SonarQube MCP Server

Source

Model Context Protocol (MCP) server for SonarQube

Catalog onlyCatalog onlySTDIO

Overview

SonarQube MCP Server is a Rust implementation of a Model Context Protocol (MCP) server that integrates with SonarQube, allowing AI assistants to access code quality metrics, issues, and quality gate statuses.

To use the SonarQube MCP Server, clone the repository, build the project, and configure it with your SonarQube server details. You can then run the server and interact with it using CLI options or integrate it with AI assistants like Claude Desktop.

  • SonarQube API Integration via REST API - Support for Model Context Protocol (MCP) - Asynchronous processing using Rust's async/await - Cross-platform compatibility (Linux, macOS, Windows) - Robust error handling for various issues
  1. Enabling AI assistants to retrieve code metrics for analysis.
  2. Allowing automated checks of code quality gate statuses.
  3. Facilitating the identification and filtering of code issues (bugs, vulnerabilities).

Add to your AI client

Use these steps to connect SonarQube MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

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

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

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

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

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

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "sonarqube-mcp-server-sapientpants": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sonarqube-mcp-server-sapientpants"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

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

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

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

FAQ

**What programming language is used?**

The server is implemented in Rust.

**Is it necessary to have a SonarQube server?**

Yes, a SonarQube server is required for the MCP server to function.

**How can I contribute to the project?**

You can fork the repository, create a feature branch, and submit a pull request.

SonarQube MCP Server — MCP Registry