Get the FREE Ultimate OpenClaw Setup Guide →

sonarqube

Model Context Protocol (MCP) server for SonarQube

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sapientpants-sonarqube-mcp-server node server.js \
  --env JAVA_HOME="Path to Java installation (required by SonarQube)" \
  --env MCP_LOG_LEVEL="Logging verbosity for MCP server (e.g., info, debug)" \
  --env SONARQUBE_HOME="Path to SonarQube installation (optional placeholder)"

How to use

This MCP server is a connector intended to bridge an MCP client with a SonarQube instance. It is based on the SonarQube MCP server model and is documented as deprecated in favor of the official SonarSource release. If you choose to experiment with this repository, start by ensuring you have a compatible Node.js environment and a running SonarQube instance. The server exposes endpoints to interact with SonarQube data through the MCP protocol; use your MCP client to connect to the server name (sonarqube) defined in your configuration, and send requests as described by the MCP protocol to fetch or stream metrics, quality profiles, issues, and related SonarQube data.

Typical usage flow:

  • Start the MCP server using the node entry point (the maintained approach is to run the server script referenced in the configuration).
  • Connect an MCP client to the server name (sonarqube) and perform operations supported by the MCP interface, such as requesting project metrics, quality profiles, or issues compatible with SonarQube data structures.
  • Consume responses, adapt your tooling, and monitor logs for any compatibility notes or deprecations flagged by the official SonarQube MCP server implementation.

Note: This repository points to the official SonarQube MCP server for production use. If you require up-to-date features, long-term support, and compatibility guarantees, prefer the official repository and release channels.

How to install

Prerequisites:

  • Node.js (LTS version recommended)
  • npm (bundled with Node.js) or yarn
  • A working SonarQube instance (required by the MCP server to bridge data)

Installation steps:

  1. Clone the repository and navigate into the project directory.
  2. Install dependencies: npm install

    or if using Yarn:

    yarn install
  3. Ensure SonarQube is installed and accessible. Verify JAVA_HOME is set if required by SonarQube.
  4. Configure environment variables if needed. At minimum, provide paths for SONARQUBE_HOME and JAVA_HOME in your environment or in a .env file loaded by your process manager.
  5. Run the server: node server.js

    Alternatively, use your process manager to keep it running in production (e.g., PM2).

  6. Point your MCP client to the server endpoint and begin interacting with SonarQube data through the MCP protocol.

Additional notes

This MCP server repository is no longer maintained and references the official SonarQube MCP server for production use. If you rely on this project, be aware of potential compatibility issues with newer SonarQube versions. Always prefer the official MCP server release for active development and security updates. Common issues include Java version mismatches, required environment variables not being set (JAVA_HOME, SONARQUBE_HOME), and network connectivity problems between the MCP server and SonarQube.

Environment variables to consider:

  • JAVA_HOME: Path to your JDK installation
  • SONARQUBE_HOME: Path to your SonarQube home directory
  • MCP_LOG_LEVEL: Logging level (e.g., error, warn, info, debug)

Configuration tips:

  • Keep the mcpServers.sonarqube object aligned with the actual entry point in your deployment (server.js in this placeholder configuration).
  • If you migrate to the official release, follow their configuration schema and deployment recommendations for production reliability.

Related MCP Servers

Sponsor this space

Reach thousands of developers