SonarQube Cloud-hosted
The SonarQube Cloud-hosted configuration ensures you use the most up to date version of the SonarQube MCP Server and gives you access to a subset of tools.
To always use the most up-to-date version of the SonarQube MCP Server, connect directly to the SonarQube Cloud-hosted MCP server. No local setup is required.
Use the SonarQube MCP server embedded in SonarQube Cloud to avoid running and maintaining your own MCP infrastructure while always using the current server version. The embedded server exposes a smaller, fixed subset of tools.
Note: If you use SonarQube for IDE, its AI Integrations setup workflow only configures a self-hosted MCP server. See Manual setup to connect to this Cloud-hosted MCP server instead.

Sign in with OAuth
Sonar's hosted SonarQube Cloud MCP service accepts OAuth alongside SonarQube tokens. Use one of the supported OAuth clients and sign in when prompted. You do not add OAuth server settings to the client configuration. Existing SonarQube token clients keep working.
Point the client at https://api.sonarcloud.io/mcp. For a US-region organization, use https://api.sonarqube.us/mcp.
The mcp:tools:read and mcp:tools:write scopes independently control access to read and write tools, subject to your Cloud permissions. A call outside those scopes fails with Insufficient OAuth scope.
Select an organization with list_organizations, then pass that key as organization on the tool call. An OAuth request that includes a SONARQUBE_ORG header fails with SONARQUBE_ORG is not supported for OAuth requests. Use the tool organization argument.
Self-hosted deployments continue to use SonarQube tokens. OAuth for SonarQube Server is not supported yet.
Supported OAuth clients
OAuth sign-in with the SonarQube Cloud-hosted MCP server requires your client to use Client ID Metadata Documents (CIMD). A CIMD is a public document that identifies an OAuth client. Sonar must also approve the client's metadata URL.
The following clients are approved for OAuth sign-in:
ChatGPT
Claude (claude.ai)
Claude Code
Codex
Cursor
GitHub Copilot desktop
Visual Studio Code
Zed
Use a version of your client that supports CIMD. This list covers OAuth sign-in only. A client that sends a SonarQube user token in an Authorization header does not need to be listed.
If your client is not listed
If your client is not listed, check its documentation or ask its vendor whether it supports CIMD for MCP OAuth:
If it supports CIMD, request its addition to Sonar's allowlist through the Sonar Community MCP category. Include the client name, version, and public metadata URL or vendor documentation. Sonar reviews each request before approving a client.
If it does not support CIMD, ask the client vendor to add it. Sonar cannot enable OAuth for that client through allowlisting alone.
If your client supports Streamable HTTP and custom authorization headers, connect with a SonarQube user token instead.
Use the configuration generator
Use the official SonarQube MCP Server configuration generator to get a SonarQube token configuration snippet. For OAuth, see Sign in with OAuth. To use the generator:
Identify your agent.
Find your common variables.
Enter the information into the SonarQube MCP Server configuration generator with the SonarQube Cloud (embedded) configuration.
Paste the generated configuration into your configuration file.
Manual setup
Use this configuration when the client authenticates with a SonarQube user token. To sign in with OAuth instead, see Sign in with OAuth.
Add this configuration to your mcp.json file in your AI-enabled client config folder.
Note: For a SonarQube token,
SONARQUBE_ORGis optional. Set the header to fix the organization for that request, or omit it and passorganizationon organization-aware tools. OAuth requests reject this header. See SONARQUBE_ORG and Sign in with OAuth.
Note: Replace your
"url"withhttps://api.sonarqube.us/mcpif you're connecting to a SonarQube Cloud organization in the US region.
Optional headers include:
SONARQUBE_READ_ONLY: Boolean. Set to
trueto enable read-only mode orfalseto allow write operations (default).SONARQUBE_TOOLSETS: The embedded MCP server includes a default list of toolsets. A subset of this list can be defined:
analysis,coverage,dependency-risks,duplications,quality-gates,issues,measures,projects,rules,security-hotspotsSonar Vortex analysis is not available on the SonarQube Cloud-hosted MCP server because it requires a local filesystem mount. To use Sonar Vortex analysis, set up a local MCP Server using Stdio.
For more details about the tools in each toolset, see the SonarQube MCP Server Tools page.
Warning: Using the optional headers replaces the default configuration. For example, when you add
"SONARQUBE_TOOLSETS": "issues,projects", you won't load thesecurity-hotspotsandquality-gatestoolsets.
Tool availability with SonarQube Cloud
When you use the SonarQube MCP Server through SonarQube Cloud, you get a smaller, fixed set of tools compared to running the MCP Server yourself. This is by design and can't be changed:
Heavy analysis tools are disabled to protect the shared SonarQube Cloud infrastructure.
Sonar Vortex analysis and context are not available because they require a local filesystem mount, which the hosted environment cannot provide. To use Sonar Vortex, set up a local MCP Server using Stdio. The recommended methods are the SonarQube plugin or SonarQube CLI; see the Sonar Vortex analysis and Sonar Vortex context pages.
SonarQube for IDE bridge tools (
analyze_file_listandtoggle_automatic_analysis) are not available because the hosted environment cannot reach SonarQube for IDE on your machine. To use them, set up a local MCP Server using Stdio.Rarely used, non-default tools are excluded to keep the MCP context small and focused.
For the complete list of tools supported by a self-hosted SonarQube MCP Server, see the Tools page.
Last updated
Was this helpful?

