Назад к каталогу
sonarqube-mcp-server

sonarqube-mcp-server

Сообщество

от SonarSource

0.0
0 отзывов

SonarQube MCP Server

Установка

docker run -i --rm \

Описание

# SonarQube MCP Server [![Build](https://github.com/SonarSource/sonarqube-mcp-server/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/SonarSource/sonarqube-mcp-server/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=SonarSource_sonarqube-mcp-server&metric=alert_status&token=364a508a1e77096460f8571d8e66b41c99c95bea)](https://sonarcloud.io/summary/new_code?id=SonarSource_sonarqube-mcp-server) 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. ## Quick setup The simplest method is to rely on our container image hosted at [mcp/sonarqube](https://hub.docker.com/r/mcp/sonarqube). Read below if you want to build it locally. > **Note:** While the examples below use `docker`, any OCI-compatible container runtime works (e.g., Podman, nerdctl). Simply replace `docker` with your preferred tool. <details> **<summary>Claude Code</summary>** * To connect with SonarQube Cloud: `claude mcp add sonarqube --env SONARQUBE_TOKEN=<token> --env SONARQUBE_ORG=<org> -- docker run -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_ORG mcp/sonarqube` * To connect with SonarQube Server: `claude mcp add sonarqube --env SONARQUBE_TOKEN=<token> --env SONARQUBE_URL=<url> -- docker run -i --rm -e SONARQUBE_TOKEN -e SONARQUBE_URL mcp/sonarqube` </details> <details> **<summary>Codex CLI</summary>** In `~/.codex/config.toml`, add the following configuration: * To connect with SonarQube Cloud: ``` [mcp_servers.sonarqube] command = "docker" args = ["run", "--rm", "-i", "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_ORG", "mcp/sonarqube"] env = { "SONARQUBE_TOKEN" = "<YOUR_USER_TOKEN>", "SONARQUBE_ORG" = "<YOUR_ORG>" } ``` * To connect with SonarQube Server: ``` [mcp_servers.sonarqube] command = "docker" args = ["run", "--rm", "-i", "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_URL", "mcp/sonarqube"] env = { "SONARQUBE_TOKEN" = "<YOUR_TOKEN>", "SONARQUBE_URL" = "<YOUR_SERVER_URL>" } ``` </details> <details> **<summary>Cursor</summary>** * To connect with SonarQube Cloud: [![Install for SonarQube Cloud](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=sonarqube&config=eyJlbnYiOnsiU09OQVJRVUJFX1RPS0VOIjoiWU9VUl9UT0tFTiIsIlNPTkFSUVVCRV9PUkciOiJZT1VSX1NPTkFSUVVCRV9PUkcifSwiY29tbWFuZCI6ImRvY2tlciBydW4gLWkgLS1ybSAtZSBTT05BUlFVQkVfVE9LRU4gLWUgU09OQVJRVUJFX09SRyBtY3Avc29uYXJxdWJlIn0%3D) * To connect with SonarQube Server: [![Install for SonarQube Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=sonarqube&config=eyJlbnYiOnsiU09OQVJRVUJFX1RPS0VOIjoiWU9VUl9VU0VSX1RPS0VOIiwiU09OQVJRVUJFX1VSTCI6IllPVVJfU09OQVJRVUJFX1VSTCJ9LCJjb21tYW5kIjoiZG9ja2VyIHJ1biAtaSAtLXJtIC1lIFNPTkFSUVVCRV9UT0tFTiAtZSBTT05BUlFVQkVfVVJMIG1jcC9zb25hcnF1YmUifQ%3D%3D) </details> <details> **<summary>Gemini CLI</summary>** You can install our MCP server extension by using the following command: `gemini extensions install https://github.com/SonarSource/sonarqube-mcp-server` You will need to set the required environment variables before starting Gemini: ``` SONARQUBE_TOKEN="<token>" SONARQUBE_ORG="<org>" // For SonarQube Cloud, empty otherwise SONARQUBE_URL="<url>" // For SonarQube Server, empty otherwise ``` Once installed, the extension will be installed under `<home>/.gemini/extensions/sonarqube-mcp-server/gemini-extension.json`. </details> <details> **<summary>GitHub Copilot CLI</summary>** After starting Copilot CLI, run the following command to add the SonarQube MCP server: `/mcp add` You will have to provide different information about the MCP server, you can use tab to navigate between fields. * To connect with SonarQube Cloud: ``` Server Name: sonarqube Server Type: Local (Press 1) Command: docker Arguments: run, --rm, -i, -e, SONARQUBE_TOKEN, -e, SONARQUBE_ORG, mcp/sonarqube Environment Variables: SONARQUBE_TOKEN=<YOUR_TOKEN>,SONARQUBE_ORG=<YOUR_ORG> Tools: * ``` * To connect with SonarQube Server: ``` Server Name: sonarqube Server Type: Local (Press 1) Command: docker Arguments: run, --rm, -i, -e, SONARQUBE_TOKEN, -e, SONARQUBE_ORG, mcp/sonarqube Environment Variables: SONARQUBE_TOKEN=<YOUR_USER_TOKEN>,SONARQUBE_URL=<YOUR_SERVER_URL> Tools: * ``` The configuration file is located at `~/.copilot/mcp-config.json`. </details> <details> **<summary>GitHub Copilot coding agent</summary>** GitHub Copilot coding agent can leverage the SonarQube MCP server directly in your CI/CD. To add the secrets to your Copilot environment, follow the Copilot [documentation](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp#setting-up-a-copilot-environment-for-copilot-coding-agent). Only secrets with names prefixed with **COPILOT_MCP_** will be available

Отзывы (0)

Пока нет отзывов. Будьте первым!