> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-mcp-server/resources/troubleshooting.md).

# Troubleshooting

What to do when you have problems engaging with the SonarQube MCP Server.

SonarQube MCP Server's logs will be written to the `<STORAGE_PATH>/logs/mcp.log` file, as defined by your [Base variables](https://docs.sonarsource.com/sonarqube-mcp-server/reference/environment-variables.md#base-variables).

If your MCP server is running in a container and you're using its default storage path, check the `/app/storage/logs/mcp.log` file within the running container.

When `SONARQUBE_DEBUG_ENABLED` is set to `true`, debug logging is enabled. Debug logs are written to both the log file and STDERR. This parameter is useful for troubleshooting connectivity or configuration issues. Default: `false`.

## Common issues

### OAuth sign-in is unavailable for your MCP client

Check whether your client is listed among the [supported OAuth clients](https://docs.sonarsource.com/sonarqube-mcp-server/setup/sonarqube-cloud-hosted.md#supported-oauth-clients) for the SonarQube Cloud-hosted MCP server. OAuth requires your client to support Client ID Metadata Documents (CIMD) and Sonar to approve its metadata URL.

For an unlisted client, follow the [client approval guidance](https://docs.sonarsource.com/sonarqube-mcp-server/setup/sonarqube-cloud-hosted.md#if-your-client-is-not-listed) to request approval through the Sonar Community or ask the vendor to add CIMD support. If your client supports Streamable HTTP and custom authorization headers, [connect with a SonarQube user token](https://docs.sonarsource.com/sonarqube-mcp-server/setup/sonarqube-cloud-hosted.md#manual-setup) instead.

### "SonarQube server version is not supported"

SonarQube MCP Server checks the connected SonarQube Server or SonarQube Community Build version at startup. Startup fails when the instance is older than SonarQube Server 2025.1 or SonarQube Community Build 25.1:

```
SonarQube server version is not supported, minimum version is SQS 2025.1 or SQCB 25.1
```

**Solution:** Upgrade to a supported release. This check runs only when you connect to SonarQube Server or SonarQube Community Build. It does not run for SonarQube Cloud.

### "Feature is not working" or "Missing tools/functionality"

You may be running an outdated Docker image. Docker caches images locally, so you will not automatically receive updates.

**Solution:** Update to the latest version:

```bash
docker pull sonarsource/sonarqube-mcp:latest
```

After pulling the latest image, restart your MCP client to use the updated version.

Optionally, add the `--pull=always` flag to your docker run command to always check for and pull the latest version:

```bash
docker run --init --pull=always -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG sonarsource/sonarqube-mcp
```

### "I want to pin to a specific version"

Browse available tags at [sonarsource/sonarqube-mcp](https://hub.docker.com/r/sonarsource/sonarqube-mcp/tags) and reference the version you want. Some releases are also tagged with the major and minor version of the SonarQube Server they align with, followed by an MCP patch number (for example, `sonarsource/sonarqube-mcp:2026.5.0` for SonarQube Server 2026.5). The patch number increases for each MCP release that targets that SonarQube Server version. If you run SonarQube Server 2026.5 or newer, see [Install the MCP from Docker image](https://docs.sonarsource.com/sonarqube-mcp-server/setup/sonarqube-server-hosted.md#install-the-mcp-from-docker-image) to choose the tag.

```bash
docker pull sonarsource/sonarqube-mcp:1.21.0.2975

docker run --init -i --rm \
  -e SONARQUBE_TOKEN -e SONARQUBE_ORG \
  sonarsource/sonarqube-mcp:1.21.0.2975
```

In your MCP client config, use `sonarsource/sonarqube-mcp:<version>` instead of `sonarsource/sonarqube-mcp` and remove `--pull=always` so Docker does not silently upgrade the image.

### SonarQube Cloud organization is unresolved

In stdio mode, when `SONARQUBE_ORG` is not set, the server lists the organizations for your user token at startup.

* **One organization:** The server selects it as the default
* **Zero or multiple organizations:** The organization stays unresolved. Call `list_organizations`, then pass a key as `organization`, or set `SONARQUBE_ORG`
* **Failed to list organizations:** The server stops and reports `Failed to list SonarQube Cloud organizations for the provided token. Verify the token is valid, or set SONARQUBE_ORG explicitly.` Check that the server can reach SonarQube Cloud

See [SONARQUBE\_ORG](https://docs.sonarsource.com/sonarqube-mcp-server/reference/environment-variables.md#sonarqube_org) for details.

For additional help, visit the [Sonar Community MCP category](https://community.sonarsource.com/c/mcp/54).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-mcp-server/resources/troubleshooting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
