Skip to main content
Glama
SonarQube MCP

SonarQube MCP

by akashlomas

NPM License Stars Forks Watchers

SonarQube MCP Server

A Model Context Protocol (MCP) server for interacting with SonarQube APIs, providing tools for authentication, project management, and metrics retrieval.

Features

  • βœ… Token-based authentication

  • πŸ” Project listing and details

  • πŸ“Š Metrics retrieval

  • πŸš€ Lightweight and fast

  • πŸ”„ Standardized MCP interface

Related MCP server: sonarqube-mcp-py

πŸ› οΈ Getting Started

Requirements

- Node.js >= v20.0.0
- Cursor or Windsurf

Installation CLI

npm install -g @lomas/sonarqubemcp
# or
npx @lomas/sonarqubemcp@latest

Configuration

Set these environment variables:

export SONARQUBE_URL="http://your-sonarqube-server:9000"
export SONARQUBE_TOKEN="<token>"

Usage

Cursor IDE

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server

Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.

Configure SonarQube MCP on Cursor

{
    "mcpServers": {
        "SonarQube MCP": {
            "command": "npx",
            "args": [
                "-y",
                "@lomas/sonarqubemcp@1.0.3",
                "sonarqubemcp"
            ],
            "env": {
                "SONARQUBE_URL": "<url>",
                "SONARQUBE_TOKEN": "<token>"
            }
        }
    }
}

In Windsurf

Add this to your Windsurf MCP config file. See Windsurf MCP docs for more info.

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

In VS Code

Install in VS Code

Add this to your VS Code MCP config file. See VS Code MCP docs for more info.

{
  "servers": {
    "Context7": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Available tools (via MCP protocol):

- authenticate
- list_projects
- get_project_details
- get_project_metrics

API Endpoints

Tool

Parameters

Description

authenticate

token?

Validate SonarQube token

list_projects

token?

List all projects

get_project_details

token?, projectKey

Get details for specific project

get_project_metrics

token?, projectKey, metrics

Get metrics for project

Troubleshooting

Error: Connection refused

  • Verify SonarQube server is running

  • Check SONARQUBE_URL is correct

Error: Invalid token

  • Regenerate your SonarQube token

  • Ensure token has proper permissions

License

MIT Β© Akash Lomas

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A Python MCP server for SonarQube, enabling AI agents to query projects, issues, quality gates, coverage, and security hotspots.
      13
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      MCP server that exposes SonarQube data as AI agent tools, enabling project discovery, quality gates, measures, issues, hotspots, rule explanations, source code, and raw API access.
      4
      -