From code-quality
Use when inspecting the local SonarQube infrastructure: which IDE embedded servers are running, which ports they own, and which MCP Docker containers are active. Also use when the user asks "what's listening on the sonar ports?", "which IDE is my MCP connected to?", or wants to check for port mismatches or orphaned containers. Triggers: "sonar environment", "sonar ports", "sonar-env", "sonar containers", "mcp containers", "port mismatch", "what's running", "check sonar infra", "sonar docker".
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-quality:sonar-envThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Diagnose the local SonarQube infrastructure — embedded IDE servers, MCP containers, and port wiring.
Diagnose the local SonarQube infrastructure — embedded IDE servers, MCP containers, and port wiring.
Announce at start: "Scanning SonarQube infrastructure."
Run the bundled collection script:
bash "${CLAUDE_PLUGIN_ROOT}/skills/sonar-env/scripts/collect.sh"
The script outputs two sections: EMBEDDED_SERVERS and MCP_CONTAINERS.
It is read-only — it never stops containers or changes configuration.
From the EMBEDDED_SERVERS section, identify each IDE by its command string:
| Pattern in CMD | IDE |
|---|---|
sonarlint-ls.jar | VS Code |
SonarLintServerCli | IntelliJ |
sonarlint (other) | Eclipse or other |
Each line has PID, PORT, and CMD.
If the section says SKIP, lsof is not available — inform the user.
From the MCP_CONTAINERS section, extract:
NAME — container nameIDE_PORT — the SONARQUBE_IDE_PORT env var (the port the MCP connects TO)URL — the SONARQUBE_URL env varCREATED — when the container was spawnedIf the section says SKIP, Docker is not available.
If it says NONE, no mcp/sonarqube containers are running.
Compare the MCP containers' IDE_PORT values against the actual listening ports from Step 2.
Flag these issues:
Port mismatch: An MCP container's IDE_PORT points to a port where no IDE is listening.
This means analyze_file_list will fail silently — the MCP server cannot reach the IDE.
Orphaned containers: Multiple MCP containers running with the same configuration. This wastes resources and can happen when Claude Code sessions don't clean up.
Unconnected IDE: An IDE embedded server is listening but no MCP container points to its port. The IDE's local analysis is available but no AI agent is wired to it.
Format the output as two tables plus a diagnostics section.
Example output:
## SonarQube for IDE — Embedded Servers
| IDE | Port | PID |
|----------|-------|-------|
| VS Code | 64120 | 15851 |
| IntelliJ | 64121 | 40780 |
## SonarQube MCP Containers
| Container | IDE Port | URL | Created |
|-----------------|----------|------------------------------|---------------------|
| sweet_wing | 64120 | https://sonarqube.example.com | 2026-03-16 09:31:10 |
| vibrant_mcnulty | 64120 | https://sonarqube.example.com | 2026-03-16 09:31:42 |
## Diagnostics
⚠️ Orphaned container: `vibrant_mcnulty` has the same config as `sweet_wing` — consider stopping it:
docker stop vibrant_mcnulty
✅ VS Code (port 64120) ← connected via `sweet_wing`
⚠️ IntelliJ (port 64121) ← no MCP container wired to this port
If mismatches are found, output the corrective command but never execute it. The user decides what to stop or reconfigure.
If a port mismatch is detected, suggest the fix:
MCP container
<name>is configured withSONARQUBE_IDE_PORT=<wrong>but that port has no listener. Active IDE ports:<list>. To reconnect, update your MCP config to use one of the active ports, then restart Claude Code.
If orphaned containers are found:
Duplicate containers detected. To clean up:
docker stop <container-name>
For background on port allocation, multi-IDE setup, and the embedded server architecture:
references/sonarqube-mcp-guide.md — "Multi-IDE Setup — Full Panorama" sectionreferences/official-docs.md — "SonarQube for IDE" and "Source Code References" sections| Don't | Do |
|---|---|
| Stop containers automatically | Output the docker stop command and let the user decide |
| Assume port 64120 is always VS Code | Parse the CMD string to identify the IDE |
Show raw lsof or docker inspect output | Parse and present as clean tables |
| Ignore the case where Docker is not running | Handle gracefully — show embedded servers only |
Print SONARQUBE_TOKEN values from containers | Only show SONARQUBE_URL and SONARQUBE_IDE_PORT |
Run the script without ${CLAUDE_PLUGIN_ROOT} | The script path is relative to the plugin root |
npx claudepluginhub denniscalazans/denniscalazans-plugins --plugin code-qualityIntegrates SonarQube/SonarCloud via MCP server for quality gate checks, issue discovery/triaging, pre-push code analysis, and rule explanations in agent workflows. Use for gate status, finding issues, snippet analysis before commits, or rule details.
Deploys SonarQube via Docker to statically analyze project code for bugs, vulnerabilities, code smells, technical debt, and coverage gaps; proposes actionable fixes.
Installs sonarqube-cli, authenticates, and integrates SonarQube MCP Server. Use for setting up SonarQube integration.