SonarQube agent integrations
Made by Sonar
SonarQube is the AI code quality and security verification platform used by millions of developers to catch bugs, vulnerabilities, and leaked secrets. This plugin enforces those standards in the agent coding loop: 7,500+ distinct issue types, secrets scanning, agentic analysis, and quality gates across 40+ languages.
SonarQube combines deterministic checks with AI-assisted workflows so quality rules apply consistently to code from both developers and agents. Where your stack supports it, analysis and secrets scanning can run inside the agent loop instead of only in CI.
What do the plugins include
The Plugin helps agents connect to SonarQube CLI and SonarQube MCP Server for issue detection, checking project metrics such as test coverage and duplications, fetch dependency risks, etc. Claude Code, Copilot CLI, Codex, Antigravity, Devin, Pi, and OpenCode (through SonarQube CLI) install agent hooks for secrets scanning and, when entitled, Vortex analysis.
How to use: Run /sonarqube:sonar-integrate after installation for guided setup: CLI integration and hooks locally, or a hosted MCP connection in cloud environments. From there, use slash commands like /sonarqube:sonar-quality-gate to check quality gates or interact naturally with prompts like "analyze my code for issues," "show open SonarQube findings," or "check my coverage." With Vortex analysis enabled, verification happens automatically after each edit with no manual invocation required.
Prerequisites
- A SonarQube account (SonarQube Cloud, Server, or Community Build). Some features (for example Vortex analysis) depend on your SonarQube Cloud organization settings.
- SonarQube CLI (
sonar) on your machine for local analysis and full integration.
For CLI integration, authenticate once with sonar auth login (browser flow; credentials stay in your OS keychain). The CLI-managed MCP server uses that login.
Check auth anytime:
sonar auth status
How plugins connect to SonarQube
SonarQube CLI can wire everything for you:
sonar integrate claude # Claude Code: MCP, hooks, secrets scanning, etc.
sonar integrate copilot # GitHub Copilot CLI: MCP, hooks, secrets scanning, etc.
sonar integrate codex # Codex: MCP, hooks, secrets scanning, Vortex analysis hook
sonar integrate antigravity # Antigravity: hooks, instructions, CAG, MCP (after plugin install)
sonar integrate cursor # Cursor: MCP, secret-scanning hooks, Vortex analysis instructions
sonar integrate devin # Devin: MCP, hooks, secrets scanning, Vortex analysis
sonar integrate pi # Pi: MCP, hooks, secrets scanning, Vortex analysis
sonar integrate opencode # OpenCode: MCP, hooks, secrets scanning, Vortex analysis
Run these after sonar auth login. Use the /sonarqube:sonar-integrate skill if you prefer a guided flow (install/update CLI, login, then integrate).
Claude Code
Install from Anthropic's marketplace claude-plugins-official:
/plugin install sonarqube@claude-plugins-official
claude plugin install sonarqube@claude-plugins-official
One-time setup
- Node.js — for the SessionStart hook (
scripts/setup.js).
- Install SonarQube CLI if needed, then
/sonarqube:sonar-integrate or sonar auth login + sonar integrate claude.
sonar auth login by scenario:
| Scenario | Command |
|---|
| SonarQube Cloud (EU) | sonar auth login -o <org-key> |
| SonarQube Cloud (US) | sonar auth login -o <org-key> -s https://sonarqube.us |
| SonarQube Cloud (AU) | sonar auth login -o <org-key> -s https://sonarqube.au |
| SonarQube Server | sonar auth login -s <server-url> |
Optional: add sonar-project.properties in the project root with sonar.projectKey, sources, etc.
GitHub Copilot CLI
Plugin bundle: .github/plugin/.
-
Install sonarqube from the pre-packaged awesome-copilot plugins catalog:
/plugin install sonarqube@awesome-copilot
-
Run sonar integrate copilot, or invoke the /sonarqube:sonar-integrate skill.
Same workflows as Usage once MCP is connected.
Cursor
Plugin bundle: .cursor-plugin/.
- Install SonarQube plugin through Cursor's marketplace:
/add-plugin sonarqube
- Run
sonar integrate cursor, or invoke the /sonarqube:sonar-integrate skill.
Antigravity