Build your SonarQube MCP Server
The SonarQube MCP Server can be launched using Docker, installed using our JAR, and you can build your own server is needed. This page helps you get started with all of those options.
As described in the MCP Server setup in your IDE, launching the SonarQube MCP server is most easily done using Docker. However, you do have other options.
Build locally
We recommend setting up the SonarQube MCP Server with Docker as explained in the Launch the server with Docker article, but if you want to build it locally, check out the Prerequisites, then follow these steps:
Clone the SonarQube MCP Server project from the sonarqube-mcp-server repository.
Run the following Gradle command to clean the project and build the application: ./gradlew clean build -x test. The JAR file will be created in
build/libs/.Perform the manual installation as explained below.
If you prefer, the JAR file is downloadable as an Asset on the MCP server Releases page.
Manual installation
After you’ve built the SonarQube MCP Server locally, you’ll need to manually install it in your MCP client. Add the following to your MCP configuration’s JSON file.
The main difference between the server setup of SonarQube Cloud and SonarQube server is:
SonarQube Cloud requires a user token and an organization name.
SonarQube Server and SonarQube Community Build require a user token and server URL.
{
"sonarqube": {
"command": "java",
"args": [
"-jar",
"<PathToYourSonarQubeMCPServerJAR>"
],
"env": {
"STORAGE_PATH": "<PathToYourMCPStorage>",
"SONARQUBE_TOKEN": "<YourSonarQubeToken>",
"SONARQUBE_ORG": "<YourOrganization>"
}
}
}{
"sonarqube": {
"command": "java",
"args": [
"-jar",
"<PathToYourSonarQubeMCPServerJAR>"
],
"env": {
"STORAGE_PATH": "<PathToYourMCPStorage>",
"SONARQUBE_TOKEN": "<YourSonarQubeUserToken>",
"SONARQUBE_URL": "<YourSonarQubeURL>"
}
}
}User tokens are required when setting up connected mode or an MCP Server between SonarQube Server and SonarQube for IDE. Note that binding will not function properly if SonarQube Server project tokens or global tokens are used during the setup process.
Deployment options.
Depending on your user environment, you may want to deploy your MCP server in different ways. Check out the page about configuring your server and pick the right Transport mode for you.
Last updated
Was this helpful?

