SonarQube
Connect your SonarQube instance to enable CloudThinker agents to analyze code quality, review security hotspots, and monitor quality gate statuses across your projects.Supported Platforms
| Platform | Support |
|---|---|
| SonarQube Cloud | All organizations |
| SonarQube Server | 2025.4 and above |
CloudThinker uses the official SonarSource MCP server, which requires SonarQube Server 2025.4+ or SonarQube Cloud.
Setup
- SonarQube Cloud
- SonarQube Server (Self-Hosted)
Generate a Token
Go to SonarQube Cloud → My Account → Security → Generate Tokens:
- Name:
cloudthinker - Type:
User Token - Expires in: Set an appropriate duration
Connection Details
| Field | Description | Example |
|---|---|---|
| SONARQUBE_TOKEN | User token for authentication | squ_xxxxx... |
| SONARQUBE_DEPLOYMENT_TYPE | cloud or self_hosted | cloud |
| SONARQUBE_ORG | Organization key (Cloud only) | my-org |
| SONARQUBE_URL | Server URL (Self-Hosted only) | https://sonarqube.your-domain.com |
Required Permissions
Minimum
- Browse permission on projects you want to analyze
- Execute Analysis permission for triggering scans
Recommended
All minimum permissions, plus:- Administer permission on projects for full quality gate management
- Create Projects permission for onboarding new projects
Agent Capabilities
Once connected, agents can:| Capability | Description |
|---|---|
| Project Browsing | List and inspect all projects in your organization |
| Issue Analysis | Retrieve and categorize bugs, vulnerabilities, and code smells |
| Quality Gates | Check quality gate statuses across projects |
| Security Hotspots | Review and prioritize security hotspots |
| Code Duplication | Analyze code duplication metrics |
| Code Metrics | Inspect coverage, complexity, and maintainability ratings |
Example Prompts
Troubleshooting
Authentication failed
Authentication failed
- Verify the token is correct and has not expired
- Ensure the token type is
User Token - Check the token has not been revoked
Organization not found (Cloud)
Organization not found (Cloud)
- Verify the organization key is correct
- Ensure you are a member of the organization
- Check the organization has not been deleted
Server unreachable (Self-Hosted)
Server unreachable (Self-Hosted)
- Verify the SonarQube URL is correct and accessible
- Check firewall rules allow connections from CloudThinker
- Ensure the SonarQube service is running
No projects visible
No projects visible
- Verify the token owner has Browse permission on the projects
- Check project visibility settings (public vs. private)
- Ensure projects exist in the organization
Security Best Practices
- User token - Use a dedicated user token, not a global analysis token
- Token expiration - Set appropriate expiration dates
- Minimal permissions - Grant only Browse permission for read-only analysis
- Token rotation - Rotate tokens every 90 days
- HTTPS only - Always use HTTPS for self-hosted instances
Related
Elasticsearch Connection
Search code quality logs
Grafana Connection
Visualize code quality metrics