# Sonar MCP Server

> Sonar MCP Server is an open-source MCP server. Read-only SonarQube Community Build access for AI agents: issues, hotspots, rules, code snippets. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/igorolv/sonar-mcp-server
- **MCP Registry name:** io.github.igorolv/sonar-mcp-server
- **Listing updated:** 2026-11-18

## About

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

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## FAQ

### Is Sonar MCP Server free?

Yes. Sonar MCP Server is open source, so you can use and self-host it for free.

### How do I add Sonar MCP Server to Claude Code?

Run this command in your terminal: claude mcp add sonar-mcp-server --env SONAR_URL='<SONAR_URL>' --env SONAR_TOKEN='<SONAR_TOKEN>' -- docker run -i --rm -e SONAR_URL -e SONAR_TOKEN ghcr.io/igorolv/sonar-mcp-server:0.1.0

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/sonar-mcp-server
