Skip to main content
Glama
dozzman
by dozzman

SonarCloud MCP Server

An MCP server that provides tools for fetching SonarCloud issues related to pull requests.

Example prompt:

Fetch the list of OPEN or ACCEPTED issues from sonarcloud for this PR, which are assigned to __me__, fix them and push the changes to this PR.

Emphasis on the __me__ part, which is a special value in the sonarcloud API to reference the current user (token owner). You can stick this in your .claude/tools folder as sonarcloud-issues.md to have a shortcut which requests claude code to fetch and fix issues from SonarCloud.

Features

  • Fetch issues from SonarCloud for specific pull requests

  • Filter by organization, project, and PR number

  • Supports authentication via API token

  • Returns formatted issue data with severity, type, and location information

Related MCP server: SonarQube MCP Server

Installation

Prerequisite: Generate a SonarCloud API token

Follow the instructions in the SonarCloud documentation to generate a SonarCloud API token.

# Build the Docker image
npm run docker:build

# Or build directly
docker build -t sonarcloud-mcp .

Option 2: Local Installation

npm ci
npm run build

Usage

Docker Usage

Run via docker:

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

Local Usage

Export the required environment variables and run the server:

export SONARCLOUD_TOKEN=your_token_here
export SONARCLOUD_ORGANISATION=your_organisation_here
export SONARCLOUD_PROJECT_KEY=your_project_key_here
npm start

Environment Variables

  • SONARCLOUD_TOKEN: Your SonarCloud API token (required)j

  • 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)

Claude Desktop / Claude Code Integration

Add to your claude_desktop_config.json or claude.json:

{
  "mcpServers": {
    "sonarcloud": {
      "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_ORGANISATION": "<your organisation here>",
        "SONARCLOUD_PROJECT_KEY": "<your project key here>"
      }
    }
  }
}

Local Configuration

Add to your claude_desktop_config.json or claude.json:

{
  "mcpServers": {
    "sonarcloud-mcp": {
      "command": "node",
      "args": [
        "/path/to/sonarcloud_mcp/dist/index.js"
      ],
      "env": {
        "SONARCLOUD_TOKEN": "<your token here>",
        "SONARCLOUD_ORGANISATION": "<your organisation here>",
        "SONARCLOUD_PROJECT_KEY": "<your project key here>"
      }
    }
  }
}

Available Tools

  • fetch_sonarcloud_issues: Fetches SonarCloud issues for a specific pull request.

Available Tools

2 tools
fetch_sonarcloud_issuesC

Fetch SonarCloud issues for a specific pull request

ParametersJSON Schema
NameRequiredDescriptionDefault
additionalFieldsNoComma-separated list of the optional fields to be returned in response. Action plans are dropped in 5.5, it is not returned in the response.
ascNoAscending sort (default: true)
assignedNoTo retrieve assigned or unassigned issues
assigneesNoComma-separated list of assignee logins. The value '__me__' can be used as a placeholder for user who performs the request
authorNoSCM accounts. To set several values, the parameter must be called once for each value.
branchNoBranch key
cleanCodeAttributeCategoriesNoComma-separated list of clean code attribute categories.
componentKeysNoComma-separated list of component keys. Retrieve issues associated to a specific list of components (and all its descendants). A component can be a project, directory or file.
createdAfterNoTo retrieve issues created after the given date (inclusive). Either a date (server timezone) or datetime can be provided. If this parameter is set, createdSince must not be set
createdAtNoDatetime to retrieve issues created during a specific analysis
createdBeforeNoTo retrieve issues created before the given date (inclusive). Either a date (server timezone) or datetime can be provided.
createdInLastNoTo retrieve issues created during a time span before the current time (exclusive). Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. If this parameter is set, createdAfter must not be set
cweNoComma-separated list of CWE identifiers. Use 'unknown' to select issues not associated to any CWE.
facetsNoComma-separated list of the facets to be computed. No facet is computed by default.
impactSeveritiesNoComma-separated list of impact severities.
impactSoftwareQualitiesNoComma-separated list of software qualities.
issueStatusesNoComma-separated list of issue statuses
issuesNoComma-separated list of issue keys
languagesNoComma-separated list of languages. Available since 4.4
onComponentOnlyNoReturn only issues at a component's level, not on its descendants (modules, directories, files, etc). This parameter is only considered when componentKeys or componentUuids is set. (default: false)
organizationNoOrganization key
owaspTop10NoComma-separated list of OWASP Top 10 lowercase categories.
owaspTop10-2021NoComma-separated list of OWASP Top 10 - 2021 lowercase categories.
pNo1-based page number (default: 1)
psNoPage size. Must be greater than 0 and less or equal than 500 (default: 100)
pullRequestNoPull request id
resolvedNoTo match resolved or unresolved issues
rulesNoComma-separated list of coding rule keys. Format is <repository>:<rule>
sNoSort field
sinceLeakPeriodNoTo retrieve issues created since the leak period. If this parameter is set to a truthy value, createdAfter must not be set and one component id or key must be provided. (default: false)
sonarsourceSecurityNoComma-separated list of SonarSource security categories. Use 'others' to select issues not associated with any category
tagsNoComma-separated list of tags.
tokenNoSonarCloud API token (optional if set in environment)

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It does not mention side effects, required authentication, rate limits, pagination behavior (though the schema includes p and ps), or what happens when no criteria are specified. The description is too sparse to inform the AI about critical runtime behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but omits essential information for a tool with 33 parameters. It is not front-loaded with the most important usage details. While every word is justified, the overall structure fails to earn its place due to under-specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a complex input schema with 33 parameters, no output schema, and no annotations. The description only covers one use case (pull request) and does not mention common filtering patterns, response structure, or limitations. It is not adequate for an AI to understand the full scope and proper invocation of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description adds no parameter-specific meaning beyond what the schema already provides. For example, it does not highlight that 'pullRequest' is a key parameter or explain how it interacts with other filters. The schema itself is well-documented, so the description adds no extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Fetch' and identifies the resource 'SonarCloud issues' with a qualifier 'for a specific pull request'. However, this is overly narrow because the tool supports filtering by many other criteria (branch, componentKeys, etc.), not only pull requests. The purpose is clear but misleadingly constrained.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling 'summarize_sonarcloud_issues'. There is no mention of when not to use it, prerequisites, or context-dependent preferences. The lack of usage direction forces the AI to infer from the schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarize_sonarcloud_issuesB

Get a high-level summary of SonarCloud issues for a PR

ParametersJSON Schema
NameRequiredDescriptionDefault
pullRequestNoPull request id
tokenNoSonarCloud API token (optional if set in environment)
impactSeveritiesNoComma-separated list of impact severities.
sinceLeakPeriodNoTo retrieve issues created since the leak period. If this parameter is set to a truthy value, createdAfter must not be set and one component id or key must be provided. (default: false)
issueStatusesNoComma-separated list of issue statuses

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations. Description does not disclose whether the tool modifies state, requires authentication beyond token (optional in schema), or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded, no redundant information. Efficient but perhaps too brief for a 5-param tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Description lacks details about the output format, what 'high-level summary' means, and any prerequisites. Despite full schema coverage, the return value and usage constraints are unclear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema descriptions already cover 100% of parameters. The tool description adds no additional semantic meaning for any parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get', the resource 'high-level summary of SonarCloud issues', and the scope 'for a PR', distinguishing it from the sibling tool 'fetch_sonarcloud_issues'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this summary tool vs the sibling 'fetch_sonarcloud_issues'. Lacks explicit conditions or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.0
    • First observedfetch_sonarcloud_issues
    • First observedsummarize_sonarcloud_issues

TDQS

B3.2/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one fetches issues, the other provides a summary. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tools follow a consistent 'verb_noun' naming pattern (fetch_sonarcloud_issues, summarize_sonarcloud_issues), making the naming predictable and clear.

Tool Count3/5

With only 2 tools, the server feels thin. While it may serve a narrow purpose, the tool count is at the borderline of being insufficient for a typical server scope.

Completeness3/5

The tools cover fetching and summarizing issues for a PR, but are missing operations like retrieving details for a single issue or listing all issues for a project. The surface is notably incomplete for broader SonarCloud operations.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A server that provides tools for retrieving SonarQube project metrics and quality data through a simplified message-based approach, allowing users to programmatically access metrics, historical data, and component-level information from SonarQube.
    14
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server for SonarQube that enables LLM agents to discover projects, analyze code quality metrics, check Quality Gate status, search issues with filters, and rank projects by worst-performing metrics. It provides read-only, safe access to SonarQube instances with structured outputs and error handling.
    5
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dozzman/sonarcloud-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server