Skip to content
mcp/skillhub

SonarQube MCP Server

by sonarsourceio.github.SonarSource/sonarqube-mcp-serverv1.21.0

Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context

665Dockerstdioofficial registry

context tax

~4,400 tok/turn18 tools

security

95/100

cold start

17150 ms

freshness

Active30d ago

Our reading of SonarQube, from the data

SonarQube is an MCP server from sonarsource, listed in the official MCP Registry.

Its 18 tools add about 4,400 tokens to every model turn (measured 2026-10-23).

Maintenance is active: the last public signal was 30 days ago (2026-10-16).

It runs locally on your machine over stdio and needs 3 secrets (SONARQUBE_TOKEN, SONARQUBE_ORG, SONARQUBE_URL); use a scoped, least-privilege key.

Install SonarQube MCP server

Install in Claude Code

claude mcp add sonarqube -e SONARQUBE_TOKEN='<sonarqube-token>' -e SONARQUBE_ORG='<sonarqube-org>' -e SONARQUBE_URL='<sonarqube-url>' -- docker run -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG -e SONARQUBE_URL docker.io/sonarsource/sonarqube-mcp

Try it in a sandbox first: this installs it with scripts off and starts it with no network, then lists its tools and token cost. How it works

npx mcpskillhub test docker.io/sonarsource/sonarqube-mcp --env SONARQUBE_TOKEN

Configuration

VariableRequiredSecretDescription
SONARQUBE_TOKENyesyesYour SonarQube USER token
SONARQUBE_ORG—yesYour SonarQube Cloud organization key (if using SonarQube Cloud)
SONARQUBE_URL—yesYour SonarQube Server URL (if using SonarQube Server)

Context tax

Connecting this server adds ~4,400 tokens of tool definitions to every model turn (moderate, 18 tools). Measured 2026-10-23 via a sandboxed run; o200k tokenizer, worst case for clients that load all tools up front. How we measure

ModelPer 1,000 turnsWith prompt caching
Claude Opus 5.5$17.60$0.880
Claude Sonnet 5.5$8.80$0.880
Claude Haiku 5.5$0.440—

Input prices as of 2026-10-06. Excludes your own prompt and output.

Tools (18)

  • search_sonar_issues_in_projects555 tok

    Search for issues (bugs, vulnerabilities, code smells) in my organization's projects. Filter by severities=['HIGH','BLOCKER'] for critical issues, impactSoftwareQualities=['SECURITY'] for security, issueStatuses=['OPEN'] to exclude resolved.

  • analyze_code_snippet423 tok

    Analyze a file or code snippet to identify code quality and security issues. Optionally provide a code snippet to filter issues — only issues within the snippet will be reported (snippet location is auto-detected). Always specify the language and the file scope (MAIN or TEST) for more accurate results. This tool is deprecated and will be removed in a future release. For richer, cross-file analysis, connect SonarQube for IDE (enables analyze_file_list) or enable Vortex analysis (run_advanced_code_analysis).

  • search_security_hotspots402 tok

    Search for Security Hotspots in a project.

  • search_duplicated_files277 tok

    Search for files with code duplications in a project. By default, automatically fetches all duplicated files across all pages (up to 10,000 files max).

  • get_project_quality_gate_status274 tok

    Get the Quality Gate Status for a project. Either 'analysisId', 'projectId' or 'projectKey' must be provided.

  • search_files_by_coverage269 tok

    Search for files in a project sorted by coverage (ascending - worst coverage first). This tool helps identify files that need test coverage improvements.

  • change_security_hotspot_status244 tok

    Change the status of a Security Hotspot to review it. When marking as REVIEWED, you must specify a resolution. - TO_REVIEW: Mark the Security Hotspot as needing review - REVIEWED: Mark the Security Hotspot as reviewed with one of these resolutions: * FIXED: A fix has been implemented * SAFE: Reviewed and determined to be safe * ACKNOWLEDGED: Acknowledged as a risk but accepted You can optionally add a comment to explain your review decision.

  • get_component_measures232 tok

    Get SonarQube measures for a project, such as ncloc, complexity, violations, coverage, etc.

  • get_file_coverage_details207 tok

    Get complete line-by-line coverage information for a file, including which exact lines are uncovered and which have partially covered branches. This tool helps identify precisely where to add test coverage. Use after identifying files with low coverage via search_files_by_coverage.

  • list_branches189 tok

    List analyzed branches for a SonarQube Cloud project (long-lived and short-lived). Use returned branch names as the branch parameter on other tools (e.g. get_project_quality_gate_status, get_component_measures). Check the type field: LONG for main/develop, SHORT for feature branches analyzed without pull requests. For pull request analysis, use list_pull_requests instead.

  • change_sonar_issue_status173 tok

    Change the status of an issue. This tool can be used to change the status of an issue to "accept", "falsepositive" or to "reopen" an issue. An example request could be: I would like to accept the issue having the key "AX-HMISMFixnZED" You can optionally add a comment to explain your triage decision.

  • get_duplications171 tok

    Get duplications for a file. Requires Browse permission on file's project

  • search_my_sonarqube_projects156 tok

    Find SonarQube projects in your organization. Supports searching by project name or key. Use this first when projectKey is unknown - most other tools require the project key from this response.

  • list_pull_requests142 tok

    List all pull requests for a project. Use this tool to discover pull requests for PR-decorated analysis (coverage, issues, quality gate on new code). Returns the pull request key/ID and source branch for each PR, which can be used with other tools that accept a pullRequest parameter. For branch-based analysis without pull requests, use list_branches instead.

  • search_metrics85 tok

    Search for available metrics

  • show_security_hotspot74 tok

    Get detailed information about a specific Security Hotspot, including rule details, code context, flows, and comments.

  • show_rule60 tok

    Shows detailed information about a SonarQube rule.

  • list_quality_gates34 tok

    List all quality gates.

Security signals

95/100 — no known issues found as of 2026-10-23, from the checks below. This is not a guarantee of safety; review what a server can do before connecting it.

Deductions

  • No license detected-5

Checks

  • ✓Repository hygiene (archived, activity, license, security policy)
  • ✓Tool descriptions (prompt-injection and hidden-text heuristics)
  • ○Package metadata (install scripts, provenance) — pending
  • ○Source scan (secrets, CVEs, risky code) by vectra-guard — pending

Scan it yourself before installing with vectra-guard, the open-source agent security CLI (made by NavyaAI, which also runs MCPSkillHub). Scoring rules

Freshness

Active — last maintenance signal 30d ago. The newest of the signals below sets the band.

  1. Last commit (default branch)

    2026-10-16 · 30d ago · GitHub

  2. Latest release

    2026-10-13 · 33d ago · GitHub · 1.29.0.4488

  3. Package published

    no data · npm/PyPI

  4. Registry entry updated

    2026-06-25 · 5mo ago · official registry · v1.21.0

FAQ

›How do I install the SonarQube MCP server in Claude Code?

Run: claude mcp add sonarqube -e SONARQUBE_TOKEN='<sonarqube-token>' -e SONARQUBE_ORG='<sonarqube-org>' -e SONARQUBE_URL='<sonarqube-url>' -- docker run -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG -e SONARQUBE_URL docker.io/sonarsource/sonarqube-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.

›Does SonarQube require an API key?

Yes. It expects SONARQUBE_TOKEN, SONARQUBE_ORG, SONARQUBE_URL, of which 3 are secrets.

›Can I use SonarQube as a remote (hosted) MCP server?

No hosted endpoint is published; it runs locally over stdio.

›Is SonarQube in the official MCP registry?

Yes, as io.github.SonarSource/sonarqube-mcp-server.

›How many tokens does SonarQube add to my context?

Its tool definitions total about 4,400 tokens, resent on every turn.

Sources and method

Official MCP Registry entry
updated 2026-06-25
GitHub repository
fetched 2026-10-19
Package registry (npm / PyPI)
listed
Last checked against all sources
2026-10-19

The description, packages and links come from the maintainer's own published metadata. Token cost, security signals, freshness and the reading above are MCPSkillHub's own measurements; see the methodology. Editorial standards are owned by Ramachandra Vikas Chamarthi, Founder & AI HPC Architect. Spot an error? Request a correction or claim the listing.