SonarQube
Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context
Ads
Overview
The SonarQube MCP Server is a Model Context Protocol (MCP) server that enables seamless integration with SonarQube Server or Cloud for code quality and security. It also supports the analysis of code snippet directly within the agent context. > 🔒 Important: Your SonarQube token is a sensitive credential. Follow these security practices: When using CLI commands: - Avoid hardcoding tokens in command-line arguments – they get saved in shell history - Use environment variables – set tokens in environment variables before running commands
Installation
docker run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp
Configuration
{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": [
"run",
"--init",
"--pull=always",
"-i",
"--rm",
"-e",
"SONARQUBE_TOKEN",
"-e",
"SONARQUBE_ORG",
"sonarsource/sonarqube-mcp"
],
"env": {
"SONARQUBE_TOKEN": "<YOUR_TOKEN>",
"SONARQUBE_ORG": "<YOUR_ORG>"
}
}
}
}Capabilities
- Analyze code snippets
Ask your assistant to run `analyze_code_snippet` on a code sample to get instant quality and security findings.
- Manage issues
Use the `issues` toolset to search, filter, and update SonarQube issues by severity, status, or project.
- Review security hotspots
Query the `security-hotspots` toolset to list hotspots needing review and understand their risk.
- Check quality gates
Ask for the `quality-gates` status of a project to see whether it meets its quality bar.
- Pull project metrics
Retrieve `measures` like coverage and duplications, or browse projects via the `projects` toolset.
Tags
- code-quality
- development
- devops
Related MCP servers
Context7 MCP
OfficialOfficial Context7 MCP server that brings up-to-date, version-specific library documentation and code examples into AI coding prompts.
Chrome DevTools MCP
OfficialOfficial Chrome DevTools MCP server for controlling and inspecting a live Chrome browser from coding agents such as Gemini, Claude, Cursor, and Copilot.
Mastra/mcp
OfficialClient implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.
GitHub MCP Server
OfficialConnect your AI assistant to GitHub repositories, issues, pull requests, and search.