oshaani MCP Marketplace
Sign in

← Documentation

SonarQube MCP Code quality

Quality gates, metrics, issues and security hotspots for projects on SonarQube Server or SonarQube Cloud.

1 credits / tool call

Quick start

  1. Add a SonarQube connection with the settings below, then click Test configuration.
  2. Create an API key for your agent.
  3. Paste the key below, click Test endpoint, and copy the configuration for your platform.
Endpointhttps://market.oshaani.com/sonarqube (your default connection) or https://market.oshaani.com/sonarqube/<connection-id>
TransportStreamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28.
AuthenticationAuthorization: Bearer <API key>, using a key from the API keys page.

Agent configuration

The default URL uses your organisation's default SonarQube connection; a URL with an ID pins one connection.
Get a key
The key is filled into the snippets below. It stays in this page and is only sent with the test request.
Runs initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.

Any MCP client that supports remote (Streamable HTTP) servers with custom headers.

{
  "name": "sonarqube",
  "transport": "streamable-http",
  "url": "https://market.oshaani.com/sonarqube",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY"
  }
}

Connection settings

Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.

SettingTypeDescription
SonarQube URL
url
string (uri)
default "https://sonarcloud.io"
Your SonarQube Server URL, or https://sonarcloud.io for SonarQube Cloud
min length 1, max length 2083
Token
token required secret
string User token from My Account > Security (Browse permission on the projects)
Organization key
organization
string SonarQube Cloud only
Verify TLS certificate
verify_tls
boolean
default true

Tools (6)

list_projects read-only

List projects, optionally filtered by name or key

ArgumentTypeDescription
query string Part of the project name or key
min length 2
page_size integer
default 50

min 1, max 500
page integer
default 1

min 1

get_quality_gate read-only

Get a project's quality gate status and the conditions that pass or fail

ArgumentTypeDescription
project_key required string Project key, e.g. my-org_my-service
min length 1, max length 400
branch string Branch name; omit for the main branch
pull_request string Pull request ID, to check the PR analysis instead of a branch

get_measures read-only

Get metrics such as coverage, bugs, vulnerabilities, code smells and ratings for a project

ArgumentTypeDescription
project_key required string Project key, e.g. my-org_my-service
min length 1, max length 400
metrics array of string Metric keys; default: alert_status, bugs, vulnerabilities, security_hotspots, code_smells, coverage, duplicated_lines_density, ncloc, sqale_rating, reliability_rating, security_rating
branch string Branch name; omit for the main branch
pull_request string Pull request ID, to check the PR analysis instead of a branch

search_issues read-only

Search open issues (bugs, vulnerabilities, code smells) in a project

ArgumentTypeDescription
project_key required string Project key, e.g. my-org_my-service
min length 1, max length 400
types array of "BUG" | "VULNERABILITY" | "CODE_SMELL" Issue types
severities array of "BLOCKER" | "CRITICAL" | "MAJOR" | "MINOR" | "INFO" Severities
branch string Branch name; omit for the main branch
pull_request string Pull request ID, to check the PR analysis instead of a branch
page_size integer
default 50

min 1, max 500
page integer
default 1

min 1

list_security_hotspots read-only

List security hotspots that still need review

ArgumentTypeDescription
project_key required string Project key, e.g. my-org_my-service
min length 1, max length 400
branch string Branch name; omit for the main branch
pull_request string Pull request ID, to check the PR analysis instead of a branch
page_size integer
default 50

min 1, max 500

get_rule read-only

Explain a coding rule: what it detects and how to fix it

ArgumentTypeDescription
rule_key required string e.g. python:S1192
pattern ^[\w-]+:[\w-]+$

Billing & errors

Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.

JSON-RPC codeMeaning
-32054 (HTTP 401)Missing, unknown or revoked API key
-32053 (HTTP 404)No SonarQube connection configured for your organisation, or the connection ID is wrong
-32055 (HTTP 403)Connection disabled or origin not allowed
-32052 (HTTP 429)Rate limit reached; retry after a minute
-32050Not enough oshaani.com credits for the call
-32051Billing temporarily unavailable; the call was not run

Errors from SonarQube itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them. See the SonarQube API documentation.