sonar-mcp-server MCP Server

Source profile for sonar-mcp-server. Its purpose and connection details need verification against the maintainer’s documentation.

Local serverstdio

What is the sonar-mcp-server MCP Server?

This sonar-mcp-server source profile is awaiting review. The previous overview contained a logo or badge fragment rather than a usable description. Check the linked maintainer documentation for the server’s purpose and connection details.

Local setup

The project provides a local client configuration using docker. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares SONARQUBE_TOKEN, SONARQUBE_ORG. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
analyze_code_snippetAnalyze file content with SonarQube analyzers to identify code quality and security issues. Always analyzes the complete file content for accuracy.…
projectKeyOptional project key to list project-specific webhooks - _String_
filePathProject-relative path of the file to analyze (e.g., src/main/java/MyClass.java). - _Required String_
fileContentComplete file content as a string. Required when workspace is not mounted - _String_
codeSnippetCode snippet to filter issues (must match content in fileContent) - _String_
languageLanguage of the code (e.g., 'java', 'python', 'js', 'ts', 'tsx', 'jsx') - _String_
scopeScope of the file: MAIN or TEST (default: MAIN) - _String_
analyze_file_listAnalyze files in the current working directory using SonarQube for IDE. This tool connects to a running SonarQube for IDE instance to perform code quality…
file_absolute_pathsList of absolute file paths to analyze - _Required String[]_
toggle_automatic_analysisEnable or disable SonarQube for IDE automatic analysis. When enabled, SonarQube for IDE will automatically analyze files as they are modified in the working…
enabledEnable or disable the automatic analysis - _Required Boolean_
run_advanced_code_analysisRun Vortex analysis on a single file. Organization is inferred from MCP configuration (SonarQube Server uses the nil UUID placeholder).
branchOptional branch name for branch-based analysis. Use list_branches to discover valid names - _String_
fileScopeDefines in which scope the file originates from: 'MAIN' or 'TEST' (default: MAIN) - _String_
search_files_by_coverageSearch for files in a project sorted by coverage (ascending - worst coverage first). This tool helps identify files that need test coverage improvements.
pullRequestOptional pull request key/ID. Use list_pull_requests to discover valid keys - _String_
maxCoverageMaximum coverage threshold (0-100). Only return files with coverage <= this value - _Number_
pageIndexOptional page number for manual pagination (starts at 1). If not specified, auto-fetches all duplicated files - _Integer_
pageSizeOptional number of results per page for manual pagination (max: 500). If not specified, auto-fetches all duplicated files - _Integer_
get_file_coverage_detailsGet line-by-line coverage information for a specific file, including which exact lines are uncovered and which have partially covered branches. This tool helps
keyFile key - _Required String_
fromFirst line to return. Starts at 1 - _Number_
toLast line to return (inclusive) - _Number_
search_dependency_risksSearch for software composition analysis issues (dependency risks) of a SonarQube project, paired with releases that appear in the analyzed project…
list_enterprisesList the enterprises available in SonarQube Cloud that you have access to. Use this tool to discover enterprise IDs that can be used with other tools.
enterpriseKeyOptional enterprise key to filter results - _String_
change_sonar_issue_statusChange the status of a SonarQube issue to "accept", "falsepositive" or to "reopen" an issue.
statusNew status - _Required Enum {"TO_REVIEW", "REVIEWED"}_
commentOptional review comment - _String_
search_sonar_issues_in_projectsSearch for SonarQube issues in my organization's projects.
projectKeysOptional list of SonarQube project keys - _String[]_
severitiesOptional list of severities to filter by. Possible values: INFO, LOW, MEDIUM, HIGH, BLOCKER - _String[]_
impactSoftwareQualitiesOptional list of software qualities to filter by. Possible values: MAINTAINABILITY, RELIABILITY, SECURITY - _String[]_
issueStatusesOptional list of issue statuses to filter by. Possible values: OPEN, CONFIRMED, FALSE_POSITIVE, ACCEPTED, FIXED, IN_SANDBOX - _String[]_
tagsOptional list of issue tags to filter by. Tags are lowercase - _String[]_
inNewCodePeriodOnly return issues in the new code period. Requires exactly one entry across projectKeys and files - _Boolean_
issueKeyOptional issue key to fetch a specific issue - _String_
search_security_hotspotsSearch for Security Hotspots in a SonarQube project.
hotspotKeysComma-separated list of specific Security Hotspot keys to retrieve - _String[]_
filesOptional list of file paths to filter - _String[]_
resolutionResolution when status is REVIEWED - _Enum {"FIXED", "SAFE", "ACKNOWLEDGED"}_
sinceLeakPeriodFilter hotspots created since the leak period (new code) - _Boolean_
onlyMineShow only hotspots assigned to me - _Boolean_
show_security_hotspotGet detailed information about a specific Security Hotspot, including rule details, code context, flows, and comments.
hotspotKeySecurity Hotspot key - _Required String_
change_security_hotspot_statusReview a Security Hotspot by changing its status. When marking as REVIEWED, you must specify a resolution (FIXED, SAFE, or ACKNOWLEDGED).
list_languagesList all programming languages supported in this SonarQube instance.
get_component_measuresGet SonarQube measures for a component (project, directory, file).
metricKeysOptional metric keys to retrieve (e.g. ncloc, complexity, violations, coverage) - _String[]_
search_metricsSearch for SonarQube metrics.
list_portfoliosList enterprise portfolios available in SonarQube with filtering and pagination options.
favoriteRequired to be true if 'enterpriseId' parameter is omitted. If true, only returns portfolios favorited by the logged-in user. Cannot be true when 'draft' is…
enterpriseIdEnterprise uuid. Can be omitted only if 'favorite' parameter is supplied with value true - _String_
draftIf true, only returns drafts created by the logged-in user. Cannot be true when 'favorite' is true - _Boolean_
search_my_sonarqube_projectsFind SonarQube projects. The response is paginated.
list_branchesList analyzed branches for a project.
branchTypes_(SonarQube Cloud only)_ Optional filter: ALL (default), LONG, or SHORT - _Enum {"ALL", "LONG", "SHORT"}_
list_pull_requestsList all pull requests for a project. Use this tool to discover pull requests for PR-decorated analysis (coverage, issues, quality gate). Returns the pull…
get_project_quality_gate_statusGet the Quality Gate Status for the SonarQube project.
analysisIdOptional analysis ID - _String_
projectIdOptional project ID - _String_
list_quality_gatesList all quality gates in my SonarQube.
show_ruleShows detailed information about a SonarQube rule.
search_duplicated_filesSearch for files with code duplications in a SonarQube project. By default, automatically fetches all duplicated files across all pages (up to 10,000 files…
get_duplicationsGet duplications for a file. Require Browse permission on file's project.
get_raw_sourceGet source code as raw text from SonarQube. Require 'See Source Code' permission on file.
get_scm_infoGet SCM information of SonarQube source files. Require See Source Code permission on file's project.
commits_by_lineGroup lines by SCM commit if value is false, else display commits for each line - _String_
get_system_healthGet the health status of SonarQube Server instance. Returns GREEN (fully operational), YELLOW (usable but needs attention), or RED (not operational).
get_system_infoGet detailed information about SonarQube Server system configuration including JVM state, database, search indexes, and settings. Requires 'Administer'…
get_system_logsGet SonarQube Server system logs in plain-text format. Requires system administration permission.
ping_systemPing the SonarQube Server system to check if it's alive. Returns 'pong' as plain text.
get_system_statusGet state information about SonarQube Server. Returns status (STARTING, UP, DOWN, RESTARTING, DB_MIGRATION_NEEDED, DB_MIGRATION_RUNNING), version, and id.
create_webhookCreate a new webhook for the SonarQube organization or project. Requires 'Administer' permission on the specified project, or global 'Administer' permission.
urlWebhook URL - _Required String_
secretOptional webhook secret for securing the webhook payload - _String_
list_webhooksList all webhooks for the SonarQube organization or project. Requires 'Administer' permission on the specified project, or global 'Administer' permission.
search_by_signature_patternsFind code elements (classes, methods, interfaces, ...) by their declaration signatures using regex patterns.
include_code_regex_listList of regex patterns to match in code bodies - _Required String[]_
exclude_code_regex_listList of regex patterns to exclude from results - _String[]_
include_globFile filter glob pattern - _String_
exclude_globFile exclusion glob pattern - _String_
fieldsComma-separated list of fields to include in the response - _String_
limitMaximum number of results to return (default: 10) - _Integer_
regex_lists_operatorHow to combine multiple patterns: OR (default) or AND - _String_
search_by_body_patternsFind code elements by their implementation body using regex patterns. Useful for locating where APIs or patterns are actually used.
get_upstream_call_flowTrace what functions call a given function. Useful for finding all callers and entry points, and understanding what breaks if a signature changes.
fqnFully qualified name of the class or module - _Required String_
depthHierarchy depth (0=root only, 1=root + children, etc.) - _Required Integer_
get_downstream_call_flowTrace what functions a given function calls. Useful for impact analysis and understanding execution flow.
get_source_codeGet complete source code (signature and body) for a code element by its fully qualified name.
get_type_hierarchyGet the full inheritance hierarchy for a class-like structure (class, interface, enum, record, exception, struct). Essential for understanding inheritance…
get_referencesGet direct inbound and outbound code references for a class or module. Returns only direct (non-transitive) references.
get_current_architectureGet a hierarchical architecture graph filtered by path prefix and depth. Useful for exploring module structure and high-level dependencies.
path_prefixOptional path prefix to filter nodes (e.g., com.example.service) - _String_
ecosystemOptional ecosystem to filter by (java, cs, py, js, ts) - _String_
get_intended_architectureGet user-defined architectural constraints specifying which modules are allowed to depend on others.
get_guidelinesGet coding guidelines based on SonarQube project issues, catalog categories, or a combination of both.
modeGuidelines retrieval mode: project_based, category_based, or combined - _Required String_
categoriesList of category names (required for category_based and combined modes) - _String[]_
languagesList of target languages in SonarQube repository key format (required when categories is provided) - _String[]_
file_pathsOptional list of file paths to filter guidelines by - _String[]_
check_dependencyCheck a third-party dependency for security vulnerabilities, supply-chain malware, and license compliance before adding or updating it.
purlPackage URL (purl) with version, per purl-spec. Format: pkg: / / @ (e.g. pkg:npm/lodash@4.17.21, pkg:maven/org.apache.logging.log4j/log4j-core@2.14.1…
VariableDescription
SONARQUBE_URLSonarQube Cloud URL
SONARQUBE_TOKENAuthentication token
SONARQUBE_ORGOrganization key on SonarQube Cloud
SONARQUBE_PROJECT_KEYProject key on SonarQube Cloud
SONAR_SQ_BRANCHExplicit SonarQube branch override
SONARQUBE_DEBUG_ENABLEDActivate debug logging (for troubleshooting)
SONAR_LOG_LEVELLogging verbosity (TRACE, DEBUG, INFO, WARNING, ERROR)

How to install the sonar-mcp-server MCP Server

{
  "mcpServers": {
    "sonarqube": {
      "command": "docker",
      "args": [
        "run",
        "--init",
        "--pull=always",
        "-i",
        "--rm",
        "-e",
        "SONARQUBE_TOKEN",
        "-e",
        "SONARQUBE_ORG",
        "sonarsource/sonarqube-mcp"
      ],
      "env": {
        "SONARQUBE_TOKEN": "YOUR_SONARQUBE_TOKEN",
        "SONARQUBE_ORG": "<YOUR_ORG>"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
SONARQUBE_TOKENDeclared in the maintainer’s client configuration.Yes
SONARQUBE_ORGDeclared in the maintainer’s client configuration.Yes