s

sonarqubemcp

@akashlomas/sonarqubemcp
0 Stars 181 次浏览 akashlomas 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "SonarQube MCP": {
      "args": [
        "-y",
        "@lomas/sonarqubemcp@1.0.3",
        "sonarqubemcp"
      ],
      "command": "npx",
      "env": {
        "SONARQUBE_TOKEN": "\u003ctoken\u003e",
        "SONARQUBE_URL": "\u003curl\u003e"
      }
    },
    "context7": {
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "command": "npx"
    }
  }
}

服务介绍

NPM
License
Stars
Forks
Watchers

SonarQube MCP Server

A Model Context Protocol (MCP) server for interacting with SonarQube APIs, providing tools for authentication, project management, and metrics retrieval.

Features

  • Token-based authentication
  • Project listing and details
  • Metrics retrieval
  • Lightweight and fast
  • Standardized MCP interface

Getting Started

Requirements

- Node.js >= v20.0.0
- Cursor or Windsurf

Installation CLI

npm install -g @lomas/sonarqubemcp
# or
npx @lomas/sonarqubemcp@latest

Configuration

Set these environment variables:

export SONARQUBE_URL="http://your-sonarqube-server:9000"
export SONARQUBE_TOKEN="<token>"

Usage

Cursor IDE

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server

Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.

Configure SonarQube MCP on Cursor

{
    "mcpServers": {
        "SonarQube MCP": {
            "command": "npx",
            "args": [
                "-y",
                "@lomas/sonarqubemcp@1.0.3",
                "sonarqubemcp"
            ],
            "env": {
                "SONARQUBE_URL": "<url>",
                "SONARQUBE_TOKEN": "<token>"
            }
        }
    }
}

In Windsurf

Add this to your Windsurf MCP config file. See Windsurf MCP docs for more info.

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

In VS Code

Install in VS Code

Add this to your VS Code MCP config file. See VS Code MCP docs for more info.

{
  "servers": {
    "Context7": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Available tools (via MCP protocol):

- authenticate
- list_projects
- get_project_details
- get_project_metrics

API Endpoints

Tool Parameters Description
authenticate token? Validate SonarQube token
list_projects token? List all projects
get_project_details token?, projectKey Get details for specific project
get_project_metrics token?, projectKey, metrics Get metrics for project

Troubleshooting

Error: Connection refused

  • Verify SonarQube server is running
  • Check SONARQUBE_URL is correct

Error: Invalid token

  • Regenerate your SonarQube token
  • Ensure token has proper permissions

License

MIT Akash Lomas

相关 MCP 服务