sonar
A MCP server implementation for the SonarQube Cloud API in Golang.
claude mcp add --transport stdio lreimer-sonar-mcp-server /Users/mario-leander.reimer/Applications/sonar-mcp-server -t stdio \ --env SONAR_TOKEN="<<INSERT TOKEN HERE>>"
How to use
The Sonar MCP server provides a Golang-based integration for the SonarQube Cloud API within the MCP (Model Context Protocol) framework. It exposes a configurable server you can run locally or deploy in environments like Cloud Run. The included example shows running the binary in stdio mode, which enables local testing and interaction with the MCP inspector tooling. When running in stdio mode, you can connect to the server and exchange model-contexts using the MCP protocol, enabling tools and clients to issue requests to SonarQube Cloud via the MCP bridge.
In addition to the local binary, the readme documents using the MCP introspector for development. The inspector can run in a stdio configuration or as a server (SSE) to provide a streaming endpoint for MCP messages. The suggested commands include:
- npx @modelcontextprotocol/inspector go run main.go (stdio)
- go run main.go --transport sse (SSE server)
- npx @modelcontextprotocol/inspector npx mcp-remote@next http://localhost:8080/sse (bridge to remote)
- npx @modelcontextprotocol/inspector (interactive inspector)
Tools and capabilities available via this MCP server include representing SonarQube Cloud API interactions within the MCP ecosystem, token-based authentication via SONAR_TOKEN, and the ability to run in different transport modes (stdio or SSE) for integration with various MCP clients and IDE tools.
How to install
Prerequisites:
- Go (for building from source)
- goreleaser (for releases)
- Access to the SonarQube Cloud API and a token for authentication (SONAR_TOKEN)
Installation steps:
-
Install Go and goreleaser
- Mac/Linux: curl -sSL https://go.dev/dl/go1.20.0.linux-amd64.tar.gz | tar -xz -C /usr/local export PATH=$PATH:/usr/local/go/bin
- Install goreleaser: curl -sL https://git.io/goreleaser | bash
-
Build a snapshot for local testing bash goreleaser build --snapshot --clean
-
Build a release (optional) and generate binaries goreleaser release --skip-publish --snapshot --clean
-
Run the resulting binary (example in stdio mode) ./path/to/sonar-mcp-server -t stdio
-
Prepare environment variables (example) export SONAR_TOKEN="<your-sonar-token>" export BASE_URL="https://sonar-mcp-server.example.com"
-
If you want to deploy via Cloud Run (as per the README), ensure you have the Google Cloud SDK installed and configured, then follow the deployment steps included in the README.
Additional notes
Tips and notes:
- The server expects a SonarQube Cloud API token via SONAR_TOKEN for authentication. Do not commit tokens in config files.
- The BASE_URL environment variable can be used by the server to construct callback or API endpoints when deployed behind proxies or in managed environments.
- If you plan to use the MCP inspector, you can run the stdio inspector via npx @modelcontextprotocol/inspector go run main.go or SSE via the provided go run/main.go --transport sse commands, depending on your workflow.
- When deploying to Cloud Run, you may need to create and attach Secrets (e.g., sonar-token) and set environment variables using --set-secrets and --set-env-vars as demonstrated in the README.
- For local development, using the inspector with direct http://localhost:8080/sse can simplify testing MCP message flows with the Sonar MCP server.
Related MCP Servers
flux-operator
GitOps on Autopilot Mode
lingti-bot
đ⥠ãæįŽčŗä¸ æįä¸ēį 䏿ŦĄįŧč¯ å°å¤æ§čĄ æéæĨå Ĩãį AI Bot
kodit
đŠâđģ MCP server to index external repositories
mcp-sdk-go
Model Context Protocol(MCP) SDK for Go
unsplash
đ A MCP server for Unsplash image search.
kroki
Kroki-MCP is a Go-based Model Context Protocol tool that converts textual diagram definitions (PlantUML, Mermaid, and more) into images via a Kroki backend. Designed for simplicity and flexibility, it supports both local and remote Kroki servers, offers configurable settings, and outputs multiple formats â making it ideal for developers building AI