---
title: "SonarQube adapter: Kotharo"
version: v0.8.3
canonical: https://kotharo.com/docs/adapters/sonarqube/
---

# SonarQube

Connects Kotharo to SonarQube for static analysis. [All adapters](https://kotharo.com/docs/adapters/)

## What you need

- An MCP server for SonarQube, connected in Claude Code.
- The `docker` command, from [Docker](https://docs.docker.com/get-started/get-docker/).

## Connect

`/kotharo:setup` finds SonarQube and takes you through these steps. To connect it by hand:

Make a user token in SonarQube under My Account, Security; project and organization tokens don't work. Run the connect command yourself with Docker running; setup never asks for a token. For SonarQube Server, put --env SONARQUBE_URL=`<server url>` and -e SONARQUBE_URL in place of the SONARQUBE_ORG pair. For SonarQube Cloud's US region, add --env SONARQUBE_URL=https://sonarqube.us and -e SONARQUBE_URL.

```
claude mcp add --scope user sonarqube --env SONARQUBE_TOKEN=<user token> --env SONARQUBE_ORG=<organization> --env SONARQUBE_READ_ONLY=true --env SONARQUBE_TOOLSETS=issues,quality-gates -- docker run -i --rm --init --pull=always -e SONARQUBE_TOKEN -e SONARQUBE_ORG -e SONARQUBE_READ_ONLY -e SONARQUBE_TOOLSETS sonarsource/sonarqube-mcp
```

Install Docker. [Its install page](https://docs.docker.com/get-started/get-docker/) covers other systems.

macOS:

```
curl -fsSLo Docker.dmg https://desktop.docker.com/mac/main/arm64/Docker.dmg
sudo hdiutil attach Docker.dmg
sudo /Volumes/Docker/Docker.app/Contents/MacOS/install
sudo hdiutil detach /Volumes/Docker
```

Windows, in Git Bash:

```
curl -fsSLo "Docker Desktop Installer.exe" "https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe"
"./Docker Desktop Installer.exe" install --user
```

Linux:

```
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
```

## Sign in

The user token in the connect command is the sign-in; SonarQube's MCP server has no OAuth. Restart Claude Code after connecting. The token's user needs Browse on the project.

Generated from Kotharo v0.8.3.
