SonarQube MCP Server

Developmentstdiov1.0.0
代码仓库

Official SonarQube MCP server that brings code quality and security analysis into AI workflows. Lets agents fetch project issues, security hotspots, quality-gate status, and metrics from SonarQube Server or SonarCloud, so code health can be inspected and triaged conversationally.

连接

将此配置添加到 .claude/mcp.json

{
  "mcpServers": {
    "sonarqube": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONARQUBE_TOKEN",
        "-e",
        "SONARQUBE_URL",
        "mcp/sonarqube"
      ],
      "env": {
        "SONARQUBE_TOKEN": "<YOUR_SONARQUBE_TOKEN>",
        "SONARQUBE_URL": "<YOUR_SONARQUBE_URL>"
      }
    }
  }
}

工具 (3)

list_issues

List code quality and security issues for a project.

{
  "type": "object",
  "required": [
    "project_key"
  ],
  "properties": {
    "severities": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Severity filter (e.g., BLOCKER, CRITICAL, MAJOR)"
    },
    "project_key": {
      "type": "string",
      "description": "SonarQube project key"
    }
  }
}

get_quality_gate

Get the quality-gate status for a project.

{
  "type": "object",
  "required": [
    "project_key"
  ],
  "properties": {
    "project_key": {
      "type": "string",
      "description": "SonarQube project key"
    }
  }
}

get_metrics

Retrieve measures such as coverage, bugs, and code smells for a project.

{
  "type": "object",
  "required": [
    "project_key"
  ],
  "properties": {
    "metric_keys": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Metric keys to fetch"
    },
    "project_key": {
      "type": "string",
      "description": "SonarQube project key"
    }
  }
}

资源

此服务器未提供任何资源。

提示词

此服务器未提供任何提示词。

服务器信息

作者
SonarSource (@SonarSource)
代码仓库
https://github.com/SonarSource/sonarqube-mcp-server
许可证
LGPL-3.0
版本
1.0.0
星标
360
最后更新
2026年6月24日