Get the FREE Ultimate OpenClaw Setup Guide →

sonarlint

A Model Context Protocol (MCP) server that brings enterprise-grade code analysis to Claude Desktop and other MCP clients using SonarLint's standalone SLOOP backend.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nielspeter-sonarlint-mcp-server npx -y @nielspeter/sonarlint-mcp-server

How to use

This MCP server provides real-time SonarLint code analysis via the MCP protocol. It runs as a standalone Node.js-based service that, when connected through an MCP client like Claude Desktop or Claude Code, exposes tools to analyze files and code snippets with SonarLint rules. You can start using it by launching the server through npx, then configure your MCP client to point at the server using the provided command and arguments. Once configured, you can invoke tools such as analyze_file, analyze_files, analyze_content, list_active_rules, and health_check to perform single-file analyses, batch analyses, or quick checks of the server health. The server’s results include issues, suggested quick fixes, and a running summary of detected problems, making it suitable for iterative code review and guidance within conversations.

How to install

Prerequisites:

  • Node.js version 20.0.0 or higher
  • An MCP client (e.g., Claude Desktop or Claude Code)

Quick start (no install required):

  1. Run the MCP server directly via npx:
npx @nielspeter/sonarlint-mcp-server

Note: The SLOOP backend (~70MB) will download automatically on first run.

If you want to run from source (for development):

git clone https://github.com/nielspeter/sonarlint-mcp-server.git
cd sonarlint-mcp-server
npm install  # Auto-downloads SLOOP backend (~70MB)
npm run build

Configure the MCP server in your MCP client (examples below).

Additional notes

Tips and caveats:

  • The SLOOP backend is downloaded on first run; ensure you have internet access during initial startup.
  • Node.js 20.x+ is required for compatibility with the server.
  • The server stores analysis results in memory for multi-turn conversations; restart clears session state.
  • When used with Claude Desktop, restart Claude after adding the MCP server configuration.
  • If you run into issues with the backend download, try re-running npm install or running with npm run build to fetch dependencies.
  • Supported languages include JavaScript, TypeScript, and Python; check available rules and plugin detections via list_active_rules.
  • The npm package name to reference in MCP client configurations is @nielspeter/sonarlint-mcp-server.

Related MCP Servers

Sponsor this space

Reach thousands of developers