Zed
Set up the SonarQube MCP Server in Zed and start using Sonar tools from your agent.
Zed is a next-generation code editor built for performance and collaboration. Use this 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.
Set up MCP for Zed
Environment variables
The following Common variables are required. Note that 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.
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.
Connection and transport
Install the extension
Navigate to the Extensions view in Zed and search for SonarQube MCP Server. When installing the extension, you will be prompted to enter the necessary environment variables:
User tokens are required when setting up connected mode or an MCP Server between SonarQube (Server, Cloud) and SonarQube for IDE. Note that the binding will not function properly if project tokens, global tokens, or scoped organization tokens are used during the setup process.
This code sample configures the MCP server using Stdio transport, where SONARQUBE_TOKEN is passed as an environment variable.
For HTTP, HTTPS, or the MCP Server in SonarQube Cloud, the SONARQUBE_TOKEN header is deprecated. Pass the token using the "Authorization": "Bearer <YourSonarQubeUserToken>" header instead.
Zed with SonarQube Cloud
SONARQUBE_URL should be defined as https://sonarqube.us each time you use a SonarQube Cloud configuration (SONARQUBE_TOKEN + SONARQUBE_ORG) and want to connect to US instance. See the Common variables article which explains when to use these variables.
Zed with SonarQube Server
The docker_path is the path to a Docker executable. Examples:
Linux/macOS:
/usr/bin/dockeror/usr/local/bin/dockerWindows:
C:\Program Files\Docker\Docker\resources\bin\docker.exe
To build the extension, run cargo build.
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.
Concrete workflow examples for this IDE will be added after engineering review.
Last updated
Was this helpful?

