SonarSource's official SonarQube MCP server connects agents to SonarQube Cloud or SonarQube Server so they can check issues, quality gates and metrics, and analyze code snippets. It runs locally as a Docker container (stdio, with an optional HTTP mode) and authenticates with a SonarQube token plus your organization key or server URL. Toolsets and a read-only mode can limit what is exposed.
Also available as
Connect
- 1Add the server to Codex
codex mcp add sonarqube --env SONARQUBE_TOKEN=YOUR_SONARQUBE_TOKEN --env SONARQUBE_ORG=YOUR_SONARQUBE_ORG -- docker run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp
Configs are generated from the publisher's documented endpoint. Check their docs for plan requirements and scopes. New to this? Read the step-by-step tutorial.
Tools 2
analyze_code_snippetrun_advanced_code_analysisThings to ask
- “Does my project pass its quality gate?”
- “List the critical security issues in the backend project”
- “Analyze this function for bugs and code smells”
- “What's the test coverage trend on main?”