Environment
- SonarQube Server or Cloud? both
- Deployment type (STDIO/HTTP, Docker/JAR): Docker
- Client / AI tool using MCP (if applicable): Cursor
Description
We’re deploying the official SonarQube MCP Server as a centralized service in Google Cloud Run. The container listens on HTTP inside (bound to $PORT). Clients (Cursor/Kiro/etc.) connect to the public HTTPS endpoint.
Question 1: Token Ownership and Scope for Container Initialization
"I am setting up the SonarQube MCP Server in a containerized environment to integrate with SonarCloud. The documentation mentions that a
SONARQUBE_TOKENis required for container initialization.My question is regarding the identity and permissions of this token:
Ownership: Since this token is used by the container service and not a specific end-user, should it be created under a dedicated ‘Service Account’ user, or does it need to be a Personal Access Token (PAT) from an Organization Admin?
Permissions: What are the minimum required permissions for this initialization token? Does it require ‘Administer’ rights at the organization level, or is ‘Execute Analysis’ / ‘Browse’ sufficient just to wake up the service?
Type: Can I use a ‘Scoped Organization Token’ for this, or must it specifically be a ‘User Token’ as seen in some local setup guides?"
Question 2: Handling Multiple Organizations in a Multi-Tenant Setup
"I have a set of users split across two different SonarCloud organizations (Org A and Org B). When initializing the MCP server container, I am required to provide the
SONARQUBE_ORGvariable.
Initialization: If the container is initialized with the name of ‘Org A’, will users from ‘Org B’ still be able to use the MCP tools to query their projects, provided they pass their own user tokens in the headers?
Multi-Org Support: Does a single MCP Server container support multiple organizations simultaneously, or do I need to deploy a separate container instance for every organization I want to support?"
Question 3: Client-Side vs. Server-Side Organization Logic
"When an AI assistant (like Claude or Cursor) makes a request through the MCP server, it often provides an organization key.
If I have already provided an organization name at the container level during startup, does the container enforce that specific organization for all requests? Or is the container-level organization only used for a ‘system check’ during startup, allowing the client-side organization name to override it for specific tool calls?"