S

Sonarqube MCP Server

by SonarSource · io.github.SonarSource/sonarqube-mcp-server

Enables seamless integration with SonarQube Server or Cloud for code quality and security analysis. Supports querying project metrics, issues, and analyzing code snippets directly within the agent context.

oci Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-sonarsource-sonarqube-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "SONARQUBE_TOKEN=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_ORG=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_URL=<YOUR_VALUE>",
        "-e",
        "STORAGE_PATH=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_IDE_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TOOLSETS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_HOST=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_PORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_READ_ONLY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_TRANSPORT=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_PROJECT_KEY=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_DEBUG_ENABLED=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_MCP_IN_CONTAINER=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_HTTP_ALLOWED_ORIGINS=<YOUR_VALUE>",
        "-e",
        "SONARQUBE_LOG_TO_FILE_DISABLED=<YOUR_VALUE>",
        "docker.io/sonarsource/sonarqube-mcp"
      ]
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
SONARQUBE_TOKEN secret Yes Your SonarQube token. Required for both SonarQube Cloud and SonarQube Server. For SonarQube Cloud, use a user token; for SonarQube Server, use a USER token.
SONARQUBE_ORG secret No Your SonarQube Cloud organization key. Required when connecting to SonarQube Cloud.
SONARQUBE_URL secret No The SonarQube Server URL. Required when connecting to SonarQube Server. For SonarQube Cloud, this is optional and defaults to 'https://sonarcloud.io' (use 'https://sonarqube.us' for Cloud US).
STORAGE_PATH No Absolute path to a writable directory where the server stores files. Automatically provided when using the Docker image; required when running from a JAR.
SONARQUBE_IDE_PORT No Optional port number between 64120 and 64130 used to connect with SonarQube for IDE.
SONARQUBE_TOOLSETS No Comma-separated list of toolsets to enable. If not set, default important toolsets are enabled. Example: 'analysis,issues,quality-gates'.
SONARQUBE_HTTP_HOST No Host to bind for HTTP/HTTPS transport. Default: '127.0.0.1'. Default: 127.0.0.1
SONARQUBE_HTTP_PORT No Port number for HTTP/HTTPS transport. Default: '8080'. Default: 8080
SONARQUBE_READ_ONLY No Set to 'true' to enable read-only mode, which disables all write operations. Default: 'false'. Default: false
SONARQUBE_TRANSPORT No Transport mode. Leave unset for stdio (default), or set to 'http' or 'https' for Streamable HTTP transport.
SONARQUBE_PROJECT_KEY No Optional default project key. When set, all tools that require a project key use this value automatically.
SONARQUBE_DEBUG_ENABLED No Set to 'true' to enable debug logging. Default: 'false'. Default: false
SONARQUBE_MCP_IN_CONTAINER No Set to 'true' when running inside a container (not automatically set by the Docker image). Default: 'false'. Default: false
SONARQUBE_HTTP_ALLOWED_ORIGINS No Comma-separated browser origins allowed for CORS in HTTP/HTTPS transport.
SONARQUBE_LOG_TO_FILE_DISABLED No Set to 'true' to disable writing logs to disk. Default: 'false'. Default: false

Similar servers