SonarQube REST API MCP
Supports connecting to SonarCloud as a SonarQube-compatible instance, allowing access to SonarCloud projects, quality gates, measures, issues, hotspots, and analysis activity via its REST API.
Connects directly to a SonarQube server's REST API, providing tools to inspect projects, branches, quality gates and their status, measures and measure history, issues and issue details, security hotspots, project analysis activity, background compute-engine tasks, and system status/authentication.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SonarQube REST API MCP for VS Code
Connect VS Code's Model Context Protocol (MCP) directly to SonarQube and SonarCloud over standard input/output (stdio).
This extension embeds a lightweight, dependency-free Node.js MCP server that communicates directly with your SonarQube instance's REST APIs. It provides zero-configuration discovery for AI assistants (such as GitHub Copilot, Claude, Cursor, Cline, and Roo Code) by automatically setting up and synchronizing .vscode/mcp.json.
Features
Direct SonarQube REST API: Direct communication with your SonarQube server or SonarCloud instance (
/api/projects,/api/measures,/api/issues,/api/hotspots,/api/qualitygates,/api/ce, etc.).Automatic
mcp.jsonProvisioning: Automatically configures.vscode/mcp.jsonwhen opening a workspace, preserving any existing third-party MCP servers.Fail-Safe Server Lifecycle:
server.jsmaintains persistent stdio communication during initialization and unconfigured states, preventing child process crashes.13 Built-in Tools: Full coverage of code quality, test coverage, security hotspots, technical debt, project activity, and quality gates.
Optional Access Token: Works seamlessly with anonymous/public instances or with personal access tokens for private instances.
Encrypted Credential Storage: Secrets are stored securely in VS Code
SecretStorage, never committed to source control.Zero External Runtime Dependencies: Built entirely with native Node.js 20+ standard APIs.
Related MCP server: MCP Server for VS Code
Requirements
VS Code: 1.102 or newer.
Node.js: 20 or newer (runs the bundled
stdioserver).SonarQube Instance: SonarQube Server (
http://localhost:9000or self-hosted domain) or SonarCloud.(Optional) A SonarQube User Access Token (User > My Account > Security > Generate Tokens).
Installation and Quick Start
1. Install from VSIX
In VS Code, open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P).Select Extensions: Install from VSIX....
Choose the generated
sonarqube-rest-api-mcp-0.1.3.vsixpackage.
2. Automatic Configuration
When you open any project folder in VS Code, the extension automatically inspects .vscode/mcp.json:
If missing, it creates
.vscode/mcp.jsonconfigured for SonarQube.If it already exists, it safely adds or updates the
sonarqubeentry without touching your other MCP servers.
3. Configure Your Instance
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:
SonarQube MCP: ConfigureEnter:
SonarQube Server URL: (e.g.
https://sonarcloud.io,https://sonarqube.example.com, orhttp://localhost:9000).Access Token (Optional): Your personal token, or leave blank for public/anonymous instances.
Default Project Key (Optional): Default project key to use when none is specified in an AI prompt.
Your settings are securely saved and automatically synchronized to .vscode/mcp.json.
Available Commands
Command | Title | Description |
| SonarQube MCP: Configure | Set or update SonarQube URL, access token, and default project key. Automatically syncs to |
| SonarQube MCP: Test Connection | Tests reachability via |
| SonarQube MCP: Setup Workspace mcp.json | Generates or updates |
| SonarQube MCP: Setup Global User mcp.json | Adds SonarQube MCP configuration to your global VS Code user profile. |
| SonarQube MCP: Show Status | Displays current target URL, token status, and quick-action buttons. |
| SonarQube MCP: Clear Credentials | Clears stored URL, tokens, and project keys from VS Code state. |
Configuration Reference
Environment Variables
Variable | Required | Description | Default |
| Yes | Base URL of your SonarQube server or SonarCloud |
|
| Optional | Personal access token for private projects | (none / anonymous) |
| Optional | Default project key fallback for tool calls | (none) |
mcp.json Configuration Template
If you manage your configuration manually in .vscode/mcp.json or your global MCP config, use this format:
{
"mcpServers": {
"sonarqube": {
"command": "node",
"args": [
// Path to server.js in the installed extension or repository
"path/to/server.js"
],
"env": {
// Base domain (NOT a gateway or subpath)
"SONARQUBE_URL": "https://sonarqube.example.com",
// Optional access token (omit or leave blank for public instances)
"SONARQUBE_TOKEN": "YOUR_SONARQUBE_ACCESS_TOKEN",
// Optional default project key
"SONARQUBE_PROJECT_KEY": "YOUR_PROJECT_KEY"
}
}
}
}Available MCP Tools
Once connected, any AI agent in VS Code can invoke the following tools:
Tool | Description | Key Parameters |
| Search and list accessible SonarQube projects |
|
| List project branches and branch-specific quality gate statuses |
|
| Retrieve Quality Gate pass/fail status and conditions |
|
| List all quality gates and condition definitions |
|
| Fetch 30+ preconfigured metrics (coverage, bugs, vulnerabilities, code smells, debt, ratings) |
|
| Retrieve historical measure data points for trend analysis |
|
| Comprehensive issue search across files, severities, and assignees |
|
| Get complete details and locations for specific issue keys |
|
| Search security hotspots with review statuses |
|
| Get detailed vulnerability and fix instructions for a hotspot |
|
| Browse project analysis events, scanner activity, and versions |
|
| Check Compute Engine (CE) analysis queue and status |
|
| Verify SonarQube server operational status and token validity | (none) |
Development and Verification
Run unit tests:
npm testRun JavaScript syntax checks:
npm run checkBuild .vsix extension package:
npm run packageLaunch Extension Development Host:
Open the project in VS Code and press
F5to debug the extension.
Repository
https://github.com/darshan1005/sonarqube-mcpLicense
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Gives AI agents direct access to your Sanity projects and guidance for working with them
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceServer for SonarQube Give AI assistants direct access to your code quality, security & analysis data3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with VS Code for language intelligence, debugging, and code execution.17MIT
- AlicenseAqualityCmaintenanceEnables interaction with SonarCloud projects, issues, quality gates, and security hotspots through natural language.15MIT
- FlicenseAqualityDmaintenanceEnables Cursor AI to query SonarQube for pull request metrics, issues, file issues, and duplication reports directly, without manual data export.4-