- Home
- MCP servers
- SonarCloud
SonarCloud
- javascript
4
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"dozzman-sonarcloud-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SONARCLOUD_TOKEN",
"-e",
"SONARCLOUD_ORGANISATION",
"-e",
"SONARCLOUD_PROJECT_KEY",
"sonarcloud-mcp"
],
"env": {
"SONARCLOUD_TOKEN": "<your token here>",
"SONARCLOUD_PROJECT_KEY": "<your project key here>",
"SONARCLOUD_ORGANISATION": "<your organisation here>"
}
}
}
}You can fetch and format SonarCloud pull request issues with this MCP server. It connects to SonarCloud using your API token and returns details like severity, type, and location for issues tied to a specific PR, helping you quickly identify and fix problems before merging.
How to use
You will run the MCP server in one of two ways: via Docker for a ready-to-use container, or locally with Node.js. In either case you provide your SonarCloud credentials and project details. Then you request issues for a specific pull request and the server returns a structured list you can act on.
How to install
Prerequisites you need before starting:
Install Docker if you plan to run the MCP server as a container.
Install Node.js and npm to run the MCP server locally.
Generate a SonarCloud API token following SonarCloud guidelines.
# Build the Docker image
npm run docker:build
# Or build directly
docker build -t sonarcloud-mcp .
Additional configuration and usage notes
Environment variables you will use:
- SONARCLOUD_TOKEN: Your SonarCloud API token (required)
- SONARCLOUD_ORGANISATION: Your SonarCloud organization key (optional, can be passed as a parameter)
- SONARCLOUD_PROJECT_KEY: Your SonarCloud project key (optional, can be passed as a parameter)
Docker and local usage both rely on these variables. You can initialize them directly in your shell or pass them through your container run command.
docker run -i --rm \
-e SONARCLOUD_TOKEN=your_token_here \
-e SONARCLOUD_ORGANISATION=your_organisation_here \
-e SONARCLOUD_PROJECT_KEY=your_project_key_here \
sonarcloud-mcp
Troubleshooting tips
If you encounter authentication errors, re-check your SONARCLOUD_TOKEN and ensure it has access to the specified organization and project.
If no issues are returned, verify that the PR number, organization, and project key values exactly match your SonarCloud setup.
Available tools
fetch_sonarcloud_issues
Fetches SonarCloud issues for a specific pull request and returns formatted data including severity, type, and location.