Sonar MVP Server

by lreimer

2 368 downloads Not rated yet LGPL-3.0 license
GitHub

About

A MCP server implementation for the SonarQube Cloud API in Golang.

Details

License
LGPL-3.0 license

Explore

- MCP server for the SonarQube Cloud API
- Supports stdio and SSE transports
- Written in Go, deployable via Docker
- Can be deployed manually to Google Cloud Run
- Uses SONAR_TOKEN for authentication

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Sonar MVP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

goreleaser build --snapshot --clean
goreleaser release --skip=publish --snapshot --clean


If you want to use the tool locally, e.g. with Claude Desktop, use the following
configuration for the MCP server.

json
{
"mcpServers": {
"sonar": {
"command": "/Users/mario-leander.reimer/Applications/sonar-mcp-server",
"args": ["-t", "stdio"],
"env": {
"SONAR_TOKEN": "<<INSERT TOKEN HERE>>"
}
}
}
}

Alternatively, you can use the MCP introspector for easy local development:
bash

Currently using manual Google Cloud Run deployment. Can either be deployed
directly from source or using the Docker image built on Github.


gcloud services enable run.googleapis.com cloudbuild.googleapis.com artifactregistry.googleapis.com

gcloud secrets add-iam-policy-binding sonar-token \
--member=serviceAccount:[email protected] \
--role=roles/secretmanager.secretAccessor

gcloud run deploy sonar-mcp-server --source=. \
--region=europe-north1 \
--port=8080 --allow-unauthenticated \
--set-secrets=SONAR_TOKEN=sonar-token:latest \
--set-env-vars=BASE_URL=https://sonar-mcp-server-343509396461.europe-north1.run.app

gcloud run services delete sonar-mcp-server --async --region=europe-north1

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "sonar mvp server": {
            "sonar-mcp-server": {
                "command": "npx",
                "args": [
                    "@modelcontextprotocol/inspector",
                    "go",
                    "run",
                    "main.go"
                ]
            }
        }
    }
}

McpServers

{
    "sonar-mcp-server": {
        "command": "npx",
        "args": [
            "@modelcontextprotocol/inspector",
            "go",
            "run",
            "main.go"
        ]
    }
}

An MCP server implementation for the SonarQube Cloud API in Golang.

Build and Release

# to quickly build the latest snapshot
goreleaser build --snapshot --clean
goreleaser release --skip=publish --snapshot --clean

Usage Instructions

If you want to use the tool locally, e.g. with Claude Desktop, use the following
configuration for the MCP server.

{
    "mcpServers": {
      "sonar": {
        "command": "/Users/mario-leander.reimer/Applications/sonar-mcp-server",
        "args": ["-t", "stdio"],
        "env": {
          "SONAR_TOKEN": "<<INSERT TOKEN HERE>>"
        }
      }
    }
}

Alternatively, you can use the MCP introspector for easy local development:

# as stdio binary
npx @modelcontextprotocol/inspector go run main.go

as SSE server using

go run main.go --transport sse npx @modelcontextprotocol/inspector npx mcp-remote@next http://localhost:8080/sse npx @modelcontextprotocol/inspector

Deployment

Currently using manual Google Cloud Run deployment. Can either be deployed
directly from source or using the Docker image built on Github.

# create a new secret for the SONAR_TOKEN
gcloud services enable secretmanager.googleapis.com
print $SONAR_TOKEN | gcloud secrets create sonar-token --data-file=-

next deploy the local build from source to Cloud Run

gcloud services enable run.googleapis.com cloudbuild.googleapis.com artifactregistry.googleapis.com

gcloud secrets add-iam-policy-binding sonar-token \
--member=serviceAccount:[email protected] \
--role=roles/secretmanager.secretAccessor

gcloud run deploy sonar-mcp-server --source=. \
--region=europe-north1 \
--port=8080 --allow-unauthenticated \
--set-secrets=SONAR_TOKEN=sonar-token:latest \
--set-env-vars=BASE_URL=https://sonar-mcp-server-343509396461.europe-north1.run.app

gcloud run services delete sonar-mcp-server --async --region=europe-north1

Maintainer

M.-Leander Reimer (@lreimer), <[email protected]>

License

This software is provided under the MIT open source license, read the LICENSE
file for details.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.