MCP Server Studio

Sonar MCP Server MCP server

Read-only SonarQube Community Build access for AI agents: issues, hotspots, rules, code snippets

Registry name: io.github.igorolv/sonar-mcp-server

Publisher
igorolv
Runs
Runs locally
Package
Docker
Version
0.1.0
Category
AI & agents
Updated
2026-09-17

Source code on GitHub

Set up Sonar MCP Server (run locally)

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "sonar-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "<SONAR_URL>",
        "SONAR_TOKEN": "<SONAR_TOKEN>",
        "SONAR_DEFAULT_PROJECT_KEY": "<SONAR_DEFAULT_PROJECT_KEY>"
      }
    }
  }
}

Claude Code

Run in your terminal:

claude mcp add sonar-mcp-server -e SONAR_URL='<SONAR_URL>' -e SONAR_TOKEN='<SONAR_TOKEN>' -e SONAR_DEFAULT_PROJECT_KEY='<SONAR_DEFAULT_PROJECT_KEY>' -- docker run -i --rm -e SONAR_URL -e SONAR_TOKEN -e SONAR_DEFAULT_PROJECT_KEY ghcr.io/igorolv/sonar-mcp-server:0.1.0

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "sonar-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "<SONAR_URL>",
        "SONAR_TOKEN": "<SONAR_TOKEN>",
        "SONAR_DEFAULT_PROJECT_KEY": "<SONAR_DEFAULT_PROJECT_KEY>"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "sonar-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "<SONAR_URL>",
        "SONAR_TOKEN": "<SONAR_TOKEN>",
        "SONAR_DEFAULT_PROJECT_KEY": "<SONAR_DEFAULT_PROJECT_KEY>"
      }
    }
  }
}

Windsurf

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

{
  "mcpServers": {
    "sonar-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "<SONAR_URL>",
        "SONAR_TOKEN": "<SONAR_TOKEN>",
        "SONAR_DEFAULT_PROJECT_KEY": "<SONAR_DEFAULT_PROJECT_KEY>"
      }
    }
  }
}

Settings

NameRequiredWhat it is
SONAR_URLYesBase URL of the SonarQube instance, e.g. https://sonar.example.com
SONAR_TOKENYesSonarQube user token (My Account -> Security -> Generate Tokens)
SONAR_DEFAULT_PROJECT_KEYNoProject key used when a tool call does not name one

More ai & agents MCP servers