sonarqube-mcp MCP Server
SonarQube MCP — projects, metrics, quality gate, issues, worst-metric ranking.
sonarqube-mcp scores 67 (Good), licensed MIT and written in Python. It installs as a local process. It declares 5 tools. Filed under Data and analytics. GitHub shows 1 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
67 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade A
90/100 for listing completeness. Lost points: short summary, no docs link.
How quality is graded
Where the 67 comes from
22 + 20 + 1 + 10 + 4 + 10 = 67. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 1 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "mshegolev-sonarqube-mcp": { "command": "uvx", "args": [ "sonarqube-mcp" ], "env": { "SONARQUBE_URL": "", "SONARQUBE_TOKEN": "YOUR_SONARQUBE_TOKEN", "SONARQUBE_SSL_VERIFY": "true" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
SONARQUBE_URL | Required | SonarQube URL (e.g. https://sonar.example.com or https://sonarcloud.io) |
SONARQUBE_TOKENSecret | Required | SonarQube authentication token (Bearer). Generate in: My Account → Security → Tokens. |
SONARQUBE_SSL_VERIFY | Optional | Verify SSL certificates (true/false). Set to 'false' for self-signed certs. |
Tools5Tool docs quality grade D
All capabilitiesissue search filtered by severity / type / resolution status
paginated project search with optional text filter
measures for one project (default set covers bugs / coverage / smells / ratings / ncloc / tests / alertstatus)
Quality Gate status + per-condition failures
top-N projects sorted by the worst value of a metric (e.g. worst coverage, most bugs)
About
sonarqube-mcp
MCP server for SonarQube. Lets an LLM agent (Claude Code, Cursor, OpenCode, etc.) discover projects, pull headline metrics, check Quality Gate status, search issues with severity/type filters, and rank projects by the worst value of any metric.
Python, FastMCP, stdio transport.
Works with any SonarQube 9.x / 10.x instance (self-hosted) and with SonarCloud.
Why another SonarQube MCP?
A few community SonarQube MCPs exist, but they tend to stop at single-project reads. This one adds cross-project ranking (sonarqube_worst_metrics) — the operation a lead actually runs during a triage session: "show me the top 10 worst-coverage services in the org". All tools are read-only and safely parameterised (Pydantic input validation, severity / type whitelists).
Design highlights
- Tool annotations — all five tools carry
readOnlyHint: True,destructiveHint: False,idempotentHint: True. Nothing can mutate SonarQube from this server. - Structured output — every tool returns a typed payload (TypedDict) + a markdown summary, so clients with and without structured-content support both get a usable response.
- Structured errors — 401 / 403 / 404 / 400 / 429 / 5xx mapped to actionable hints (e.g. "regenerate token", "check project key with sonarqube_list_projects").
- Pydantic input validation for every argument; severity / type filters are checked against the valid SonarQube enum before the request is sent.
- Cross-project worst-metric ranking — batches
/api/measures/searchcalls under the hood, sorts ascending or descending based on whether higher is worse for the chosen metric.
Features (5 tools)
Discovery
sonarqube_list_projects— paginated project search with optional text filter
Single-project insight
sonarqube_project_metrics— measures for one project (default set covers bugs / coverage / smells / ratings / ncloc / tests / alert_status)sonarqube_quality_gate_status— Quality Gate status + per-condition failures
Issue triage
sonarqube_get_issues— issue search filtered by severity / type / resolution status
Cross-project ranking
sonarqube_worst_metrics— top-N projects sorted by the worst value of a metric (e.g. worst coverage, most bugs)
Installation
Requires Python 3.10+.
# via uvx (recommended — no install, just run)
uvx --from sonarqube-mcp sonarqube-mcp
# or via pipx
pipx install sonarqube-mcp
Configuration
claude mcp add sonarqube -s project \
--env SONARQUBE_URL=https://sonar.example.com \
--env SONARQUBE_TOKEN=squ_your_token \
--env SONARQUBE_SSL_VERIFY=true \
-- uvx --from sonarqube-mcp sonarqube-mcp
Or in .mcp.json:
{
"mcpServers": {
"sonarqube": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "sonarqube-mcp", "sonarqube-mcp"],
"env": {
"SONARQUBE_URL": "https://sonar.example.com",
"SONARQUBE_TOKEN": "${SONARQUBE_TOKEN}",
"SONARQUBE_SSL_VERIFY": "true"
}
}
}
}
Check:
claude mcp list
# sonarqube: uvx --from sonarqube-mcp sonarqube-mcp - ✓ Connected
Environment variables
| Variable | Required | Description |
|---|---|---|
SONARQUBE_URL | yes | SonarQube URL (no trailing slash) |
SONARQUBE_TOKEN | yes | Bearer token. Generate in: My Account → Security → Tokens |
SONARQUBE_SSL_VERIFY | no | true/false. Default: true. |
Note on HTTP proxies. The client intentionally disables env-based proxy discovery (trust_env=False) because self-hosted SonarQube is typically reachable only on an internal network. If you connect to SonarCloud or any SonarQube that lives behind a corporate proxy, you'll currently need to drop the proxy variables at the process level — a SONARQUBE_TRUST_ENV_PROXY knob is planned for a follow-up release.
Example usage
- "List all SonarQube projects matching 'einvy'"
- "What's the Quality Gate status for
einvy:aut_einvy?" - "Show me the top 10 projects with the most bugs"
- "Find all BLOCKER / CRITICAL vulnerabilities in
einvy:aut_einvy" - "What's the coverage on
einvy:qa_assistant?" - "Top 5 worst-coverage projects matching query 'einvy'"
Metric directions (used by sonarqube_worst_metrics)
Higher is worse (sorted descending — more is worse):
bugs, code_smells, vulnerabilities, duplicated_lines_density, reliability_rating, security_rating, security_review_rating, sqale_rating, open_issues
Lower is worse (sorted ascending — less is worse):
coverage, line_coverage, branch_coverage, test_success_density, tests
Ratings in SonarQube are numeric strings "1" (A, best) through "5" (E, worst).
Safety
- All tools are
readOnlyHint: True— nothing can mutate SonarQube. - No
POST/PUT/DELETEis ever called. - Severity / type / qualifier inputs are validated against SonarQube enums before the API call, so the tool fails fast on typos rather than hitting the API.
Performance characteristics
- Every tool makes one HTTP call to SonarQube except
sonarqube_worst_metrics, which makes one search call + ⌈candidate_pool/100⌉ bulk-measures calls. Default settings land at ≤ 2 calls. - Single-tool response time on a healthy SonarQube instance: typically < 500 ms.
- Pagination is passed through to SonarQube (
p+psparams) — no full-result buffering in the MCP server. sonarqube_worst_metricscapscandidate_poolat 500 — on instances with thousands of projects, pre-filter withquery=before ranking (see the tool docstring).- SonarQube has no published hard rate limit. If 429 is received the server surfaces an actionable error ("Wait 30-60 s before retrying; reduce page_size").
Development
git clone https://github.com/mshegolev/sonarqube-mcp.git
cd sonarqube-mcp
pip install -e '.[dev]'
pytest
License
MIT © Mikhail Shchegolev
Frequently asked questions
What is sonarqube-mcp MCP Server?
SonarQube MCP — projects, metrics, quality gate, issues, worst-metric ranking.
How do I install sonarqube-mcp MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. sonarqube-mcp MCP Server runs locally from the PyPI package sonarqube-mcp with the command uvx sonarqube-mcp.
Is sonarqube-mcp MCP Server free and open source?
Yes. sonarqube-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does sonarqube-mcp MCP Server support remote (HTTP) connections?
No remote endpoint is listed for sonarqube-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does sonarqube-mcp MCP Server provide?
sonarqube-mcp MCP Server provides 5 tools, including sonarqube_get_issues, sonarqube_list_projects, sonarqube_project_metrics, and sonarqube_quality_gate_status. See the full tool list for descriptions and parameters.
How is sonarqube-mcp MCP Server's trust score calculated?
sonarqube-mcp MCP Server scores 67 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.