Repository navigation
feat(adapters): add read-only SonarQube adapter (#1240) - #1317
Merged
Merged
Conversation
One adapter for SonarQube Server and SonarQube Cloud on the v1 Web API, with 7 GET-only tools, a static and live spec, logo, guide and updated adapter counts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aj-codespy
requested review from
D3nisty,
helpcodeai and
mirkopoloni
as code owners
October 28, 2026 15:12
helpcodeai
approved these changes
Oct 28, 2026
helpcodeai
left a comment
Contributor
There was a problem hiding this comment.
Thanks @aj-codespy, nice work. Reviewed the adapter: all 7 tools are read-only GETs on the v1 Web API, Bearer auth with a user token, the token marked secret, the URL pattern rejects a trailing /api, and the SSRF note for internal Server hosts is right. The static spec covers the Server/Cloud differences (qualifiers=TRK, empty organization dropped, context path), and thanks for the honest note on Server not being tested live. Logo and guide look fine, CI green. Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a read-only SonarQube adapter (
intl/sonarqube.json) that works with both SonarQube Server and SonarQube Cloud through the v1 Web API, as planned in #1240. An AI client can now answer questions like "didpayments-apipass its quality gate?", "list the open high-severity security issues" or "how has coverage changed since June?".Changes
packages/backend/src/adapters/intl/sonarqube.json: REST adapter on{{SONARQUBE_URL}}/apiwithBEARER_TOKENauth. RequiresSONARQUBE_URLandSONARQUBE_TOKEN;SONARQUBE_ORGANIZATIONis optional. Categoryinfrastructure, probesonarqube_list_projects. 7 tools, all GET and read-only:sonarqube_list_projects(/components/search)sonarqube_get_quality_gate_status(/qualitygates/project_status)sonarqube_get_measures(/measures/component)sonarqube_get_measures_history(/measures/search_history)sonarqube_search_issues(/issues/search)sonarqube_list_project_analyses(/project_analyses/search)sonarqube_list_branches(/project_branches/list)Server vs Cloud differences, handled as the issue describes:
qualifiers=TRK.organizationis mapped as${SONARQUBE_ORGANIZATION}, so it is sent on Cloud and left out when the variable is empty (Server).componentKeysand the impact filters (issueStatuses,impactSeverities,impactSoftwareQualities), never the deprecatedtypes,severitiesorstatuses.metricKeys=alert_status,quality_gate_details) and suggest thesoftware_quality_*metrics.api/authentication/validate: sonarcloud.io answers{"valid":true}to it without a token.envVarMetawith an address pattern that refuses/apiand a trailing slash and keeps a context path such as/sonarqube.verifyHintscover 400 (missing organization on Cloud), 401, 403, 404 and rate limiting.The instructions cover the three URL cases, which token to create (User token on Server; Personal Token under My account → Access tokens on Cloud),
SONARQUBE_ORGANIZATION,SSRF_ALLOWED_HOSTS, the quality-gate fallback, pagination and the 429 rate limit on Cloud.intl/sonarqube.live.spec.ts: static checks run every time:{{SONARQUBE_URL}}/api, and every tool is GET withreadOnlyHintand no body.qualifiers=TRKwith and withoutorganization;componentKeyswith the impact filters.envVarMetapatterns, and that the probe isn'tauthentication/validate.The live tests run with
RUN_SONARQUBE_LIVE=1. They list projects, then read the quality gate, measures, history, issues, analyses and branches of the first project.Logo
packages/frontend/public/logos/connectors/sonarqube.svg(Simple Icons, CC0) and guidecontent/guides/en/sonarqube-to-mcp.mdx.catalog.tsregenerated. Quoted counts 561 → 562 adapters, asadapter-count.mjs --checkasked, inREADME*.md,CITATION.cff,glama.json,package.jsonandserver.json.llms.txtandllms-full.txtregenerated.Self-hosted vs Cloud: adapter JSON only, with no backend, frontend or
ee/code change. Self-hosted works with SonarQube Cloud and any SonarQube Server it can reach; a Server on a private network needs its host inSSRF_ALLOWED_HOSTS. On AnythingMCP Cloud, it works with SonarQube Cloud or a publicly reachable Server.Type
Testing
SonarQube versions tested:
8.0.0.114649(api/server/version, EU region): live spec run with a personal token and a private project in my organization.next.sonarqube.cominstance now redirects to sonarsource.com. The Server-specific behaviour is covered by the static spec only:qualifiers=TRK, noorganizationwhen it is empty, and a context path. I'm happy to add a Community Build run if you'd like one before merging.Without a token, I also called each tool's exact request on public SonarQube Cloud projects:
organizationoncomponents/searchreturns 400 "The 'organization' parameter is missing".issues/searchreturn issues withimpacts.qualitygates/project_statusstill answers on Cloud.Commands run on macOS with Node 22.23.3:
node scripts/validate-adapters.mjs --warnintl/sonarqube.json(1442 existing warnings, unchanged frommain)node scripts/regenerate-catalog.mjsnode scripts/adapter-count.mjs --checkOK: every quoted count equals 562 adapters (27 keyless, 8681 tools)node scripts/generate-llms-txt.mjsthen--checknode --test scripts/validate-adapters.test.mjs scripts/adapter-new.test.mjspackages/backendnpx jest src/adapters/intl/sonarqubepackages/backendRUN_SONARQUBE_LIVE=1 npx jest src/adapters/intl/sonarqube.live.spec.ts(SonarQube Cloud 8.0.0.114649)packages/backendnpx jest src/adapters/catalog src/adapters/env-var-metapackages/backendnpx eslint src/adapters/intl/sonarqube.live.spec.tspackages/backendnpx tsc --noEmit -p tsconfig.jsonI didn't run the full backend
npm testor the frontend checks: this PR changes only adapter JSON, its spec, the generated catalog, a logo, a guide and quoted counts.Checklist
npm testnot run, see above)Related Issues
Closes #1240
🤖 Generated with Claude Code