Zed
Set up the SonarQube MCP Server in Zed and start using Sonar tools with your agent.
Zed is a next-generation code editor built for performance and collaboration. Use this MCP server setup when you want Sonar tools available within a Zed AI workflow.
The SonarQube MCP Server is available as a Zed extension. If you need a custom configuration, a separate repository for Zed is available at https://github.com/SonarSource/sonarqube-mcp-server-zed.
If you prefer using the SonarQube-hosted MCP server instead, see below.
Use the configuration generator
Use the official SonarQube MCP Server configuration generator to get a configuration code snippet for your setup:
Identify the target MCP Client.
Find your #common-variables.
Choose a hosting method.
Enter the information into the configuration generator.
Paste the generated configuration into your configuration file.
Manual setup
Environment variables
The following common variables are required. SONARQUBE_TOKEN applies to stdio transport only. For HTTP, HTTPS, or the embedded SonarQube Cloud MCP server, use the Authorization: Bearer <YourSonarQubeUserToken> header instead.
SONARQUBE_TOKEN: Your SonarQube user token (stdio transport).SONARQUBE_ORG: Your SonarQube Cloud organization key. Required for SonarQube Cloud only.SONARQUBE_URL: Your SonarQube Server or Community Build URL. Also required for SonarQube Cloud in the US region (https://sonarqube.us). Not needed for SonarQube Cloud in the EU region.
Important: Your SonarQube token is a sensitive credential. Use environment variables to pass tokens rather than hardcoding them in configuration files. Never commit tokens to version control.
Transport options
The Zed extension for the SonarQube MCP Server uses Stdio transport. It's also the transport mode used in your Agentic Analysis and Context Augmentation workflows.
Note: The Zed extension supports Stdio transport only. For HTTPS or HTTP transport, use the custom configuration repository.
Stdio
Navigate to the Extensions view in Zed and search for SonarQube MCP Server. When installing the extension, you'll be prompted to enter the necessary environment variables:
Warning: User tokens are required when setting up connected mode or an MCP server between SonarQube Server and SonarQube for IDE. Your binding won't function properly if you use project tokens, global tokens, or scoped organization tokens during setup.
Note: SONARQUBE_URL should be defined as
https://sonarqube.useach time you use a SonarQube Cloud configuration (SONARQUBE_TOKEN+SONARQUBE_ORG) and want to connect to a US-region instance. See the Connecting to SonarQube Cloud in the US region section for details.
Zed with SonarQube Cloud
Zed with SonarQube Server
The docker_path is the path to a container runtime executable. Examples:
Linux/macOS:
/usr/bin/dockeror/usr/local/bin/dockerWindows:
C:\Program Files\Docker\Docker\resources\bin\docker.exe
Tip: To verify the connection, ask your AI agent to call the SonarQube MCP
ping_systemtool. For example: "Ping the SonarQube MCP server."
Tip: Restart your AI agent for good measure, although it might not be required.
Agentic analysis and context augmentation
To set up Agentic Analysis and Context Augmentation, the recommended methods are the SonarQube plugin or SonarQube CLI. See the Make your agent verify its code and Add context to generate better code pages.
When using these services, your SONARQUBE_TOKEN lets your local MCP server configured for Stdio mode authenticate to the SonarQube Cloud API. See the Agentic Analysis and Context Augmentation pages for more information.
SonarQube-hosted MCP server
To avoid running and maintaining your own MCP infrastructure while always using the current server version, connect to a SonarQube-hosted MCP server:
SonarQube Cloud-hosted: the MCP server embedded in SonarQube Cloud. It exposes a smaller, fixed subset of tools. See the SonarQube Cloud-hosted page.
SonarQube Server-hosted: the MCP server installed as an extension on SonarQube Server (Developer, Enterprise, and Data Center editions), available on SonarQube Server 2026.3 and later. See the SonarQube Server-hosted page.
Use Sonar tools from Zed
Once connected, Zed can call SonarQube MCP tools on your behalf. See the tools page for the full list of available tools.
Last updated
Was this helpful?

