SonarQube MCP Server fails "Unauthorized" error on version 9.9.8 - Version compatibility unclear

Environment

  • SonarQube Server or Cloud? SonarQube Server 9.9.8
  • Deployment type (STDIO/HTTP, Docker/JAR): Docker
  • Client / AI tool using MCP (if applicable): Cursor

Description

I’m attempting to connect the SonarQube MCP Server (Docker image mcp/sonarqube:latest) to our SonarQube Server instance but receiving an authentication error, despite having valid credentials.

Environment:

  • SonarQube Server Version: 9.9.8.100196

  • MCP Server: Docker image mcp/sonarqube:latest (updated 15 days ago)

  • Token Type: User token with squ_ prefix (freshly generated)

  • Connection: Docker container with --network host

Error Message:

Exception in thread “main” org.sonarsource.sonarqube.mcp.serverapi.exception.UnauthorizedException:
SonarQube answered with Not authorized. Please check server credentials.
at org.sonarsource.sonarqube.mcp.serverapi.ServerApiHelper.handleError(ServerApiHelper.java:135)
at org.sonarsource.sonarqube.mcp.serverapi.ServerApiHelper.get(ServerApiHelper.java:52)
at org.sonarsource.sonarqube.mcp.serverapi.features.FeaturesApi.listFeatures(FeaturesApi.java:36)
at org.sonarsource.sonarqube.mcp.SonarQubeMcpServer.loadBackendIndependentTools(SonarQubeMcpServer.java:272)

Troubleshooting Performed:

  1. Verified token validity:
  • Token authentication endpoint returns: {“valid”:true} :white_check_mark:

  • System status endpoint accessible: {“status”:“UP”,“version”:“9.9.8.100196”} :white_check_mark:

  1. Tested API endpoints manually:
  • /api/authentication/validate → 200 OK :white_check_mark:

  • /api/features/list → 200 OK (returns features) :white_check_mark:

  • /api/v2/features → 404 Not Found :cross_mark:

    Configuration
    
    
    {
    
      "command": "docker",
    
      "type": "stdio",
    
      "args": ["run", "--network", "host", "-i", "--rm", 
    
               "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_URL",
    
               "mcp/sonarqube"],
    
      "env": {
    
        "SONARQUBE_TOKEN": "squ_xxx...",
    
        "SONARQUBE_URL": "http://internal.server.com/sonar"
    
      }
    
    }
    

SonarQube Team, do you have any thought on these MCP server configuration questions?

Hi,

I invite you to familiarize yourself with the FAQ, and in particular this section:

I created a topic, when can I expect a response?

This is an open community with people volunteering their free time to provide assistance. We’re eager to contribute to the community, but you are not guaranteed a fast response.

Be patient

  • Wait a few days before bumping a topic that hasn’t received a response.

Regarding your question, your version is past EOL. You should update to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your update path is:

9.9.8 → 2025.1.4 → 2026.1

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after update, please come back to us.

 
HTH,
Ann