> 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-community-build/extension-guide/sonarqube-mcp-server.md).

# MCP Server

The SonarQube MCP Server is designed to integrate code quality and code security tools with your favorite MCP clients.

For complete details about the SonarQube MCP Server, please see the main page in the [SonarQube MCP Server](https://docs.sonarsource.com/sonarqube-mcp-server/) documentation.

## Overview <a href="#overview" id="overview"></a>

The SonarQube MCP Server is a [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) server that provides seamless integration with SonarQube Server or SonarQube Cloud for code quality and code security. It enables the analysis of code snippets directly within the agent context and allows you to retrieve information and perform actions on your SonarQube Server instance or SonarQube Cloud organization. Check the MCP [Prerequisites](/sonarqube-mcp-server/setup/prerequisites.md) page for compatibility details.

Upon receiving a request from an MCP client, the SonarQube MCP Server calls the SonarQube Cloud or SonarQube Server API to perform actions:

<figure><img src="broken://spaces/KXW79zfYFiA8incTvwZK/files/1aQsVxN4965WbY8uLZ5w" alt="Overview of the SonarQube MCP Server setup."><figcaption></figcaption></figure>

## Setting up the SonarQube MCP Server <a href="#setting-up-the-sonarqube-mcp-server" id="setting-up-the-sonarqube-mcp-server"></a>

See the SonarQube MCP Server [IDE/CLI quickstart guides](/sonarqube-mcp-server/setup/quickstart-guides.md) for the easiest way to get going.

> **Note:** If you use a commercial edition of SonarQube (Developer, Enterprise, or Data Center edition) on SonarQube Server 2026.3 or later, you can run the MCP server directly on your SonarQube Server instance with no separate process to manage. See [SonarQube Server-hosted](/sonarqube-mcp-server/setup/sonarqube-server-hosted.md) for details.

## Tools <a href="#tools" id="tools"></a>

Once the SonarQube MCP server is connected, its tools become available. The current list of all tools available with the SonarQube MCP Server are listed on the [Tools](/sonarqube-mcp-server/reference/tools.md) page.


---

# 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-community-build/extension-guide/sonarqube-mcp-server.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.
