Token导航 LogoToken导航

Agent Skill · 研究检索

sonarqube-mcp(sonarqube MCP 搜索)

sonarqube-mcp 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

sonarqube-mcp 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 14,755。

总安装 8,326周安装 354GitHub Stars 229下载 2,917核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sonarqube-mcp(sonarqube MCP 搜索)
来源仓库:https://github.com/giuseppe-trisciuoglio/developer-kit
仓库路径:skills/sonarqube-mcp
安装命令:
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill sonarqube-mcp
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill sonarqube-mcp

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

sonarqube-mcp 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。适用于代码质量分析、技术文档检索或开发流程中的信息整理场景。

通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/sonarqube-mcp

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill so…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sonarqube-mcp 怎么安装?

在终端执行 npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill sonarqube-mc…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sonarqube-mcp 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sonarqube-mcp 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

sonarqube-mcp 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sonarqube-mcp 用的人多吗?

公开数据是累计安装 8,326 次,近一周安装 354 次,下载 2,917 次,GitHub 229 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sonarqube-mcp 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
sonarqube-mcp

sonarqube MCP 搜索 · 本页

8,326229接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SonarQube MCP Integration

Leverage SonarQube and SonarCloud capabilities directly through the Model Context Protocol (MCP) server to enforce code quality, discover issues, and run pre-push analysis inside the agent workflow.

Overview

This skill provides instructions and patterns for using the SonarQube MCP Server tools. It enables automated workflows for:

  • Checking quality gate status before merges or deployments
  • Discovering and triaging issues by severity and project
  • Analyzing code snippets locally before committing (shift-left)
  • Understanding SonarQube rules with full documentation

When to Use

Use this skill when:

  • The user wants to check if a project passes its quality gate before merging a PR
  • The user wants to find critical or blocker issues in one or more SonarQube projects
  • The user wants to analyze a code snippet for issues before pushing to CI
  • The user wants to understand why a specific Sonar rule flagged their code
  • The user asks for pre-commit or pre-push quality feedback

Trigger phrases: "check quality gate", "sonarqube quality gate", "find sonar issues", "search sonar issues", "analyze code with sonar", "check sonar rule", "sonarcloud issues", "pre-push sonar check", "sonar pre-commit"

Prerequisites and Setup

The plugin includes a .mcp.json that starts the SonarQube MCP Server automatically via Docker. Before using this skill, set the required environment variables:

SonarQube Server (remote or local):

export SONARQUBE_TOKEN="squ_your_token"
export SONARQUBE_URL="https://sonarqube.mycompany.com"  # or http://host.docker.internal:9000 for local Docker

SonarCloud:

export SONARQUBE_TOKEN="squ_your_token"
export SONARQUBE_ORG="your-org-key"   # required for SonarCloud
# SONARQUBE_URL is not needed for SonarCloud

Requirements:

  • Docker must be installed and running
  • SONARQUBE_TOKEN is always required
  • SONARQUBE_URL is required for SonarQube Server (use host.docker.internal for local instances)
  • SONARQUBE_ORG is required for SonarCloud (omit SONARQUBE_URL in that case)

Quick Start

  1. Set your SonarQube/SonarCloud credentials: # SonarQube Server export SONARQUBE_TOKEN="squ_your_token" export SONARQUBE_URL="https://sonarqube.mycompany.com" # SonarCloud export SONARQUBE_TOKEN="squ_your_token" export SONARQUBE_ORG="your-org-key"
  2. Verify MCP tool availability:

- Tool names follow the pattern: mcp__sonarqube-mcp__<tool-name>

  1. If the MCP server fails to start, check:

- Docker is running - Environment variables are set - Reference: mcp/sonarqube on Docker Hub

Reference Documents

  • references/metrics.md — Common SonarQube metrics and their meaning
  • references/severity-levels.md — Sonar severity levels and impact categories
  • references/best-practices.md — Workflows for PR checks and pre-commit analysis
  • references/llm-context.md — Tool selection guide and parameter mapping for LLM agents

Instructions

Step 1: Identify the Required Operation

Determine which operation the user needs:

User IntentTool to Use
Check if project passes quality gateget_project_quality_gate_status
Find critical issues in a projectsearch_sonar_issues_in_projects
Analyze code before committinganalyze_code_snippet
Understand a flagged ruleshow_rule
Get detailed project metricsget_component_measures
Mark an issue as false positivechange_sonar_issue_status

If the user's intent is ambiguous, ask for the project key and the goal before proceeding.

Step 2: Quality Gate Monitoring

Use get_project_quality_gate_status to verify a project meets its quality standards.

Parameters:

  • projectKey (string) — Project key in SonarQube/SonarCloud
  • pullRequest (string, optional) — Pull request ID for PR-specific gate check
  • analysisId (string, optional) — Specific analysis ID
Note: There is no branch parameter on this tool. Without a pullRequest or analysisId, the tool returns the quality gate status for the default branch.

Pattern — Check default branch gate:

{
  "name": "get_project_quality_gate_status",
  "arguments": {
    "projectKey": "my-application"
  }
}

Pattern — Check PR gate before merge:

{
  "name": "get_project_quality_gate_status",
  "arguments": {
    "projectKey": "backend-service",
    "pullRequest": "456"
  }
}

Interpreting the response:

  • status: "OK" — Gate passed, safe to merge/deploy
  • status: "ERROR" — Gate failed; check conditions array for failing metrics
  • Each condition shows: metricKey, actualValue, errorThreshold, comparator

For more on metric keys, see references/metrics.md.

Step 3: Issue Discovery and Triaging

Use search_sonar_issues_in_projects to find and prioritize issues.

Parameters:

  • projects (array, optional) — List of project keys; omit to search all accessible projects
  • severities (array, optional) — Filter: BLOCKER, HIGH, MEDIUM, LOW, INFO
  • pullRequestId (string, optional) — Limit search to a specific PR
  • p (integer, optional) — Page number (default: 1)
  • ps (integer, optional) — Page size (default: 100, max: 500)

Pattern — Find blockers and critical issues:

{
  "name": "search_sonar_issues_in_projects",
  "arguments": {
    "projects": ["my-backend", "my-frontend"],
    "severities": ["BLOCKER", "HIGH"],
    "p": 1,
    "ps": 50
  }
}

Pattern — Search issues in a PR:

{
  "name": "search_sonar_issues_in_projects",
  "arguments": {
    "projects": ["my-service"],
    "pullRequestId": "123",
    "severities": ["HIGH", "MEDIUM"],
    "p": 1,
    "ps": 100
  }
}

Managing issues with change_sonar_issue_status:

Use this to mark false positives or accepted technical debt:

{
  "name": "change_sonar_issue_status",
  "arguments": {
    "key": "AY1234",
    "status": "falsepositive",
    "comment": "This pattern is safe in our context because..."
  }
}

Valid statuses: falsepositive (not a real issue), accept (acknowledged technical debt), reopen (reset to open)

Always present the list of issues to the user before changing their status. Never autonomously mark issues as false positives without explicit user confirmation.

Step 4: Pre-Push Analysis (Shift Left)

Use analyze_code_snippet to run SonarQube analysis on code before committing.

Parameters:

  • projectKey (string) — Project key for context
  • fileContent (string, required) — Full content of the file to analyze
  • language (string, optional) — Language hint for better accuracy
  • codeSnippet (string, optional) — Narrow results to a specific sub-range within fileContent

Supported languages: javascript, typescript, python, java, go, php, cs, cpp, kotlin, ruby, scala, swift

Pattern — Analyze TypeScript file before commit:

{
  "name": "analyze_code_snippet",
  "arguments": {
    "projectKey": "my-typescript-app",
    "fileContent": "async function fetchUser(id: string) {\n  const query = `SELECT * FROM users WHERE id = ${id}`;\n  return db.execute(query);\n}",
    "language": "typescript"
  }
}

Pattern — Analyze Python file:

{
  "name": "analyze_code_snippet",
  "arguments": {
    "projectKey": "my-python-service",
    "fileContent": "import pickle\n\ndef load_model(path):\n    with open(path, 'rb') as f:\n        return pickle.load(f)",
    "language": "python"
  }
}

Response interpretation:

  • Each issue includes: ruleKey, severity, clean code attribute, impact category, line number, quick fix availability
  • Address CRITICAL and HIGH severity issues before committing
  • Use show_rule with the ruleKey value for any unfamiliar rule

Step 5: Rule Education

Use show_rule to understand why a rule exists and how to fix flagged code.

Parameters:

  • key (string) — Rule key in format <language>:<rule-id> (e.g., typescript:S1082, java:S2068)

Pattern — Get rule documentation:

{
  "name": "show_rule",
  "arguments": {
    "key": "typescript:S1082"
  }
}

Response includes: rule name, type, severity, full description, tags (e.g., cwe, owasp-a2), language, remediation effort estimate, code examples (non-compliant vs compliant).

Step 6: Get Component Measures

Use get_component_measures to retrieve detailed metrics for a project, directory, or file.

Parameters:

  • projectKey (string) — Project key in SonarQube/SonarCloud
  • pullRequest (string, optional) — PR ID for PR-scoped metrics
  • metricKeys (array) — List of metric keys to retrieve

Common metric keys: coverage, bugs, vulnerabilities, code_smells, complexity, cognitive_complexity, ncloc, duplicated_lines_density, new_coverage, new_bugs

Pattern — Project health dashboard:

{
  "name": "get_component_measures",
  "arguments": {
    "projectKey": "my-project-key",
    "metricKeys": ["coverage", "bugs", "vulnerabilities", "code_smells", "ncloc"]
  }
}

For full metric reference, see references/metrics.md.

Step 7: Present Results to User

After each tool call:

  • Summarize findings in human-readable form
  • Flag issues that require attention (BLOCKER, HIGH severity)
  • Propose next actions based on findings
  • Wait for user confirmation before taking remediation steps (e.g., changing issue status, modifying code)

Examples

Example 1: Pre-Merge Quality Gate Check

User request: "Check if the quality gate passes for project backend-api on PR #234"

{
  "name": "get_project_quality_gate_status",
  "arguments": {
    "projectKey": "backend-api",
    "pullRequest": "234"
  }
}

If gate fails: Extract failing conditions, present them to the user, then use search_sonar_issues_in_projects filtered by the same PR to show the actual issues.

Example 2: Shift-Left Analysis Before Push

User request: "Analyze this Go function before I push it"

{
  "name": "analyze_code_snippet",
  "arguments": {
    "projectKey": "my-go-service",
    "fileContent": "func handler(w http.ResponseWriter, r *http.Request) {\n  id := r.URL.Query().Get(\"id\")\n  query := fmt.Sprintf(\"SELECT * FROM orders WHERE id = %s\", id)\n  rows, _ := db.Query(query)\n  // ...\n}",
    "language": "go"
  }
}

Present findings → for each issue, optionally call show_rule with the ruleKey value to explain the fix.

Example 3: Triage BLOCKER Issues in a Project

User request: "Show me all blocker issues in payment-service"

{
  "name": "search_sonar_issues_in_projects",
  "arguments": {
    "projects": ["payment-service"],
    "severities": ["BLOCKER"],
    "p": 1,
    "ps": 50
  }
}

Group results by category (Security, Reliability, Maintainability) and present to user. Offer to call show_rule for unfamiliar rules.

Best Practices

  1. Environment Setup — Set credentials once per session; the MCP server automatically picks them up
  2. Always check quality gate before merge — Run get_project_quality_gate_status as part of any PR review workflow
  3. Shift left on security issues — Use analyze_code_snippet during development, not only in CI
  4. Prioritize by severity — Address BLOCKER and HIGH issues first; document decisions for MEDIUM and LOW
  5. Use show_rule for unfamiliar keys — Never dismiss a rule without understanding its intent
  6. Paginate large result sets — Use p and ps parameters; handle multi-page responses for complete coverage
  7. Never change issue status autonomously — Always present issues to the user and get explicit confirmation before calling change_sonar_issue_status
  8. Provide language hints — Specify language in analyze_code_snippet for more accurate analysis

Constraints and Warnings

  • MCP server must be configured and running; verify tool availability before use
  • analyze_code_snippet analyzes snippets in isolation — full project context may affect results in CI
  • Issue status changes (false positive, won't fix) require appropriate SonarQube permissions
  • SonarCloud and SonarQube Server APIs are mostly compatible but some features differ; check references/llm-context.md
  • Pagination is required for projects with many issues; check paging.total and paging.pageSize in the response to determine whether to iterate further pages
  • Quality gate status reflects the last completed analysis — trigger a new analysis if the code has changed

平台分布

Codex

38.84%
按下载量换算1,133

Claude

29.89%
按下载量换算872

Cursor

17.2%
按下载量换算502

Gemini CLI

9.8%
按下载量换算286

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills