Skip to content
Skillpedia
βœ“ Official Β· SonarSource● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyProgramming

SonarQube MCP Server

Lets your AI agent check code quality and security with SonarQube Server or Cloud, including code snippets.

679 stars on GitHubby SonarSourceLicense NOASSERTIONUpdated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add sonarqube -e SONARQUBE_TOKEN="<your value>" -- docker run -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG -e SONARQUBE_URL docker.io/sonarsource/sonarqube-mcp

What to fill in

NameWhat it isRequired
SONARQUBE_TOKENYour SonarQube USER tokenYes
SONARQUBE_ORGYour SonarQube Cloud organization key (if using SonarQube Cloud)No
SONARQUBE_URLYour SonarQube Server URL (if using SonarQube Server)No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

What quality issues does Sonar report in my project?
Analyze this code snippet for security problems.

What it is

This is the official SonarSource server that connects AI assistants to SonarQube Server or SonarQube Cloud. The agent can use your project's quality and security analysis, and it can analyze code snippets directly in the conversation. It usually runs from a container image.

What it can do

  • Connect to SonarQube Cloud with a token and organization
  • Connect to SonarQube Server with a user token and URL
  • Analyze code snippets inside the agent
  • Use code quality and security results from SonarQube

When to use

  • β€ΊWhen you want your agent to look at quality issues Sonar found in your project.
  • β€ΊWhen you want a code snippet checked for security problems.
  • β€ΊWhen you want fixes guided by your team's existing Sonar rules.

What you need

Docker (or another container runtime) and a SonarQube token. For Cloud, also your organization key. For Server, your server URL.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

The readme does not state a license or price. You need a SonarQube Server or Cloud account.

Is it official?

Yes, it is made by SonarSource.

Does it work with SonarQube Cloud US?

Yes. Set SONARQUBE_URL to https://sonarqube.us.

Which clients are covered?

Antigravity, Claude Code, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI and coding agent, Kiro and others.

How do I protect my token?

Use environment variables, do not hardcode it in commands, and never commit it to version control.

Is there a setup helper?

Yes, an online configuration generator at mcp.sonarqube.com/config-generator.html.

If it does not work

  • β€ΊCheck that Docker (or Podman) is installed and running.
  • β€ΊCheck that SONARQUBE_TOKEN is set, plus SONARQUBE_ORG for Cloud or SONARQUBE_URL for Server.
  • β€ΊFor SonarQube Server, use a user token, not a project token.

5 new skills a week. 1 minute to read.