Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context
If you want an AI assistant working directly with SonarQube, the sonarqube mcp server is the bridge. Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context.
The SonarQube MCP Server is a Model Context Protocol (MCP) server that enables seamless integration with SonarQube Server or Cloud for code quality and security. It also supports the analysis of code snippet directly within the agent context.
Once connected, the assistant can call these 9 tools directly:
SONARQUBE_TOKEN — Your SonarQube Cloud tokenSONARQUBE_ORG — Your organization keySONARQUBE_URL — (Optional) Set to https://sonarqube.us for SonarQube Cloud USSTORAGE_PATH — Mandatory absolute path to a writable directory where SonarQube MCP Server will store its files (e.g., for creation, updates, and persistence), it isSONARQUBE_PROJECT_KEY — Optional default project key. When set, all tools that require a project key will use this value automatically — the projectKey parameter is removed from theirSONARQUBE_IDE_PORT — Optional port number between 64120 and 64130 used to connect SonarQube MCP Server with SonarQube for IDESONARQUBE_DEBUG_ENABLED — When set to true, enables debug logging. Debug logs are written to both the log file and STDERR. Useful for troubleshooting connectivity or configurationSONARQUBE_LOG_TO_FILE_DISABLED — When set to true, disables writing logs to disk entirely. No log files will be created under STORAGE_PATH/logs/. Useful in containerized or ephemeralBase — You should add the following variable when running the MCP Server:The server is distributed via a container image as sonarsource/sonarqube-mcp, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
Before the server will start you need to supply 8 environment variables: SONARQUBE_TOKEN, SONARQUBE_ORG, SONARQUBE_URL, SONARQUBE_IDE_PORT, YOUR_TOKEN, YOUR_USER_TOKEN, YOUR_SERVER_URL, SONAR_TOKEN. Keep credentials in your client's env block or a secrets manager rather than committing them.
Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. SonarQube sits in that group, and the shape of its toolset — SONARQUBE_TOKEN, SONARQUBE_ORG, SONARQUBE_URL among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| SONARQUBE_TOKEN | Your SonarQube Cloud token |
| SONARQUBE_ORG | Your organization key |
| SONARQUBE_URL | (Optional) Set to https://sonarqube.us for SonarQube Cloud US |
| STORAGE_PATH | Mandatory absolute path to a writable directory where SonarQube MCP Server will store its files (e.g., for creation, updates, and persistence), it is automatically provided when using the container image |
| SONARQUBE_PROJECT_KEY | Optional default project key. When set, all tools that require a project key will use this value automatically — the projectKey parameter is removed from their schema entirely. Useful when working on a single project. |
| SONARQUBE_IDE_PORT | Optional port number between 64120 and 64130 used to connect SonarQube MCP Server with SonarQube for IDE. |
| SONARQUBE_DEBUG_ENABLED | When set to true, enables debug logging. Debug logs are written to both the log file and STDERR. Useful for troubleshooting connectivity or configuration issues. Default: false. |
| SONARQUBE_LOG_TO_FILE_DISABLED | When set to true, disables writing logs to disk entirely. No log files will be created under STORAGE_PATH/logs/. Useful in containerized or ephemeral environments where file logging is undesirable. Default: false. |
| Base | You should add the following variable when running the MCP Server: |
{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": ["run", "--init", "--pull=always", "-i", "--rm", "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_ORG", "sonarsource/sonarqube-mcp"],
"env": {
"SONARQUBE_TOKEN": "<YOUR_TOKEN>",
"SONARQUBE_ORG": "<YOUR_ORG>"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| SONARQUBE_TOKEN | Credential the server authenticates with. | Yes |
| SONARQUBE_ORG | Configuration value read at startup. | Optional |
| SONARQUBE_URL | Endpoint or connection string the server talks to. | Yes |
| SONARQUBE_IDE_PORT | Configuration value read at startup. | Optional |
| YOUR_TOKEN | Credential the server authenticates with. | Yes |
| YOUR_USER_TOKEN | Credential the server authenticates with. | Yes |
| YOUR_SERVER_URL | Endpoint or connection string the server talks to. | Yes |
| SONAR_TOKEN | Credential the server authenticates with. | Yes |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.