Read-only MCP server for self-hosted SonarQube Community Build 26.4+: lets AI agents (Claude Code, Cursor, Copilot) read issues, security hotspots, rules and code snippets to fix findings locally
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add sonar --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~/.codex/config.toml
[mcp_servers.sonar]
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>" }
# codex mcp add sonar --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~/.cursor/mcp.json
{
"mcpServers": {
"sonar": {
"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>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"sonar": {
"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>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"sonar": {
"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>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"sonar": {
"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>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"sonar": {
"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>"
}
}
}
}Environment variables
SONAR_URLSONAR_TOKEN
Replace the placeholders with your own credentials and keep them out of version control.