ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Sonar MCP Server

โดย igorolvรุ่น 0.1.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.igorolv/sonar-mcp-server

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Read-only SonarQube Community Build access for AI agents: issues, hotspots, rules, code snippets

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ
  • ต้องใส่ค่าเหล่านี้: SONAR_URL, SONAR_TOKEN

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • Dockerติดตั้ง Docker ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "sonar": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "ใส่ค่าของคุณ",
        "SONAR_TOKEN": "ใส่ค่าของคุณ",
        "SONAR_DEFAULT_PROJECT_KEY": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add sonar --env SONAR_URL='ใส่ค่าของคุณ' --env SONAR_TOKEN='ใส่ค่าของคุณ' --env SONAR_DEFAULT_PROJECT_KEY='ใส่ค่าของคุณ' -- docker run -i --rm -e SONAR_URL -e SONAR_TOKEN -e SONAR_DEFAULT_PROJECT_KEY ghcr.io/igorolv/sonar-mcp-server:0.1.0

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "sonar": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "ใส่ค่าของคุณ",
        "SONAR_TOKEN": "ใส่ค่าของคุณ",
        "SONAR_DEFAULT_PROJECT_KEY": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "sonar": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SONAR_URL",
        "-e",
        "SONAR_TOKEN",
        "-e",
        "SONAR_DEFAULT_PROJECT_KEY",
        "ghcr.io/igorolv/sonar-mcp-server:0.1.0"
      ],
      "env": {
        "SONAR_URL": "ใส่ค่าของคุณ",
        "SONAR_TOKEN": "ใส่ค่าของคุณ",
        "SONAR_DEFAULT_PROJECT_KEY": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • SONAR_URL จำเป็น env
    Base URL of the SonarQube instance, e.g. https://sonar.example.com
  • SONAR_TOKEN ความลับ จำเป็น env
    SonarQube user token (My Account -> Security -> Generate Tokens)
  • SONAR_DEFAULT_PROJECT_KEY env
    Project key used when a tool call does not name one

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub igorolv ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 32464 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 44% ของอีก 32464 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 32464 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Sonar MCP Server ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: SONAR_URL, SONAR_TOKEN

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.0) เข้า registry 2 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Docker ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, yontu

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

โดย formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

รันบนเครื่อง★ 440MITอัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

Remote Desktop Commander

โดย desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

รันบนคลาวด์★ 211อัปเดต เมื่อวาน
ติดตั้ง

yontu

โดย senrecep

Türkçe yazı denetimi: TDK kuralları, yapay zekâ izleri, metin türüne göre üslup.

รันบนเครื่องอัปเดต วันนี้
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

Sonar MCP Server

A local MCP server providing read-only access to a SonarQube Community Build (26.4+) instance via its web-api. It lets AI agents (Claude Code, Cursor, VS Code Copilot, etc.) fetch a project's issue list, the files and locations where they occur, rule descriptions, source-code snippets around issues, and Security Hotspots.

Typical scenario: "find and fix Sonar issues in such-and-such project" — the LLM calls listIssues, optionally getRule and getIssueSnippets, and edits files locally.

Why this server

There is an official SonarSource MCP server, but it targets SonarQube 10+ (and SonarCloud) and assumes a cloud-style deployment. This server is built for self-hosted SonarQube Community Build 26.4+ installations that expose the classic /api/ web-api. It supports both Standard Experience and MQR mode, handling per-software-quality impacts when the instance runs in MQR mode.

It is also intentionally narrower in scope:

  • Read-only by design. The server never creates, updates, or deletes anything in SonarQube — no marking issues as false-positive, no editing comments, no admin endpoints. The token's write permissions in SonarQube are irrelevant because the server never calls those endpoints.
  • Curated tool set. Instead of mirroring the SonarQube API surface, the server exposes a small, focused set of tools (13 in total) chosen for a single workflow: *let an AI agent read Sonar's findings and fix the code based on them*. Listing components, issues and hotspots, drilling into a single finding, fetching the rule explanation, and pulling the source-code snippet around the location — and that's it. Anything outside this "diagnose -> fix the code locally" loop is deliberately left out to keep the tool list small and the agent's choices unambiguous.

In short: a focused, read-only bridge from a self-hosted SonarQube Community Build to an AI coding agent.

Quick start

  1. Install JDK 25+.
  2. Download sonar-mcp-server.jar from the latest release, or build it yourself: ./gradlew bootJar (see Build). A Docker image is published as well.
  3. Get your SonarQube URL and user token (see Configuration).
  4. Add the JAR to your client's MCP configuration (see Connecting to an AI client).

For Claude Code that is one command:

claude mcp add --scope user -e SONAR_URL=https://sonar.example.com -e SONAR_TOKEN=your_token -- sonar java -jar /path/to/sonar-mcp-server.jar

Architecture

The server only supports the stdio transport.

┌─────────────┐     stdio      ┌──────────────────┐    web-api     ┌──────────┐

│ AI agent │ <------------> │ sonar-mcp- │ -------------> │ SonarQube│ │ (Claude Code│ stdin/stdout │ server (Java) │ HTTP + Bearer │ CB 26.4+│ │ Cursor...) │ │ │ auth (token) │ │ └─────────────┘ └──────────────────┘ └──────────┘

The AI client spawns the server as a child process; communication uses the MCP protocol over stdin/stdout. The server does not open any HTTP port and accepts no incoming connections.

Tools

The server exports 13 read-only MCP tools.

Projects
ToolDescription
listProjectsList of SonarQube projects. Parameters: query (name substring), limit, offset. Returns key, name, qualifier.
listComponentsSearch/browse components inside a project using Sonar's component tree. Parameters: projectKey, query, qualifiers, branch / pullRequest, limit, offset. Returns opaque component key values plus path, qualifier, name, language, and project. Use returned key values unchanged as listIssues.componentKeys; do not pass Java package names directly as component keys.
getProjectProject overview: header info (name, qualifier, visibility, description, version, last analysis date), quality gate status with failed conditions, and curated metrics (ncloc, bugs, vulnerabilities, security hotspots, code smells, coverage, duplicated lines density, technical debt in minutes, alert status). Parameters: projectKey, branch (opt.), pullRequest (opt.).
listProjectBranchesList of branches analysed for the project. Each entry: name, isMain, type (LONG/SHORT/BRANCH), excludedFromPurge, analysisDate, qualityGateStatus, plus bugs/vulnerabilities/codeSmells counts. No pagination — Sonar returns all branches at once.
listProjectPullRequestsList of PR analyses for the project. Each entry: PR key (use as pullRequest= elsewhere), title, branch (head), base, url, analysisDate, qualityGateStatus, plus bugs/vulnerabilities/codeSmells counts. Empty list if the Sonar install has no DevOps integration.
Issues
ToolDescription
listIssuesFlat list of issues for a project. Parameters: projectKey (required unless defaulted), componentPathPrefix (opt.) — a single subtree-or-file filter relative to the Sonar project root (e.g. bc-doc/src/main/java/ru/foo or bc-doc/src/main/java/ru/foo/Bar.java); convert Java/Kotlin package dots to slashes; honours directory boundaries (bc-doc/src does not match bc-doc/srcExtra). Plus severities, types, statuses, rules, branch / pullRequest (mutually exclusive), resolved, limit, offset. By default returns only open issues (resolved=false, statuses OPEN/CONFIRMED/REOPENED). Each item contains the rule, severity, type, status, file path, line, primary textRange, and secondary flows for cross-file rules. When componentPathPrefix is used, the server scans the project and filters client-side; the scan is capped (default 10000 issues) — if the cap is hit, pathPrefixTruncated=true in the response.
getIssueDetails of a single issue by key plus its change history (changelog). Accepts optional branch / pullRequest.
getIssueSnippetsSource-code snippets around all issue locations (primary plus flows for cross-file rules). For each location: componentPath, language, and an array of source lines with SCM info. Useful when the repository isn't available locally or you need to see exactly the file version Sonar analyzed. Accepts optional branch / pullRequest — important when the issue lives on a non-main ref whose files differ from main.
getProjectIssuesSummaryAggregated summary of open issues in a project: total plus breakdowns by severity, type, status, rule, tag, and SCM author. Parameters mirror listIssues (incl. componentPathPrefix) except pagination.
getProjectIssuesBreakdownMulti-module aggregation of issues by logical module and rule. Module is derived from the first componentPath segment. Parameters mirror getProjectIssuesSummary.
Rules
ToolDescription
getRuleDetails of a Sonar rule by key (e.g. java:S1234): title, severity, type, language, tags, description sections (introduction, root cause, how to fix, resources). Backed by an in-memory cache — repeated calls are free.
Security Hotspots
ToolDescription
listHotspotsList of Security Hotspots for a project. Hotspots are a separate category from issues, marking spots that require manual security review. By default Sonar returns hotspots in status TO_REVIEW. Parameters: projectKey, componentPathPrefix (opt.) — same prefix semantics as on listIssues, status (opt.), branch / pullRequest (opt., mutually exclusive), limit, offset. Subject to the same client-side scan cap (pathPrefixTruncated flag in the response).
getHotspotSecurity Hotspot details: full rule description (risk, vulnerability, fix recommendations), primary textRange, secondary flows, changelog. Hotspot keys are globally unique, so no branch/pullRequest parameter is needed.

All tools are read-only — no data in SonarQube is modified.

Working with branches and pull requests

Sonar analyses a *branch* and a *pull request* as two distinct, mutually exclusive scopes. The Sonar web-api accepts either branch= or pullRequest= on a single request, never both.

  • `branch` — long-lived branches (main, develop, feature/...). Resolved as: explicit branch argument → SONAR_DEFAULT_BRANCH → none (Sonar uses the project's main branch).
  • `pullRequest` — the Sonar PR key, usually the PR/MR number. Independent from branch analyses; PR analyses often contain the most relevant findings for in-flight work. Pull request keys never fall back to a server-level default — pass them explicitly.

Passing both branch and pullRequest to the same tool call is an error. Use listProjectBranches / listProjectPullRequests to discover available refs.

Branch scoping is load-bearing. Each Sonar branch is a separate analysis: open-issue counts on main and on a feature branch can differ a lot, because the feature branch may have new fixes (or new code) that have not been merged. If the agent silently omits branch=, it reads from main (or SONAR_DEFAULT_BRANCH) and may miss work already done on a feature branch — or worse, fix the same problem twice. When the user's local git is on feature/..., agents should call listProjectBranches first, find the matching Sonar branch, and pass it explicitly to every issue / summary / breakdown call.

As a server-side safety net, listIssues, getProjectIssuesSummary, and getProjectIssuesBreakdown attach a branchAdvisory field to their response when (1) neither branch nor pullRequest was passed AND (2) the project has other branches analysed in Sonar. The advisory carries the effective (main) branch name and the list of non-main branches sorted by most recent analysisDate. The field is absent otherwise.

Stack

  • Java 25, Spring Boot 4.0.0, Spring AI MCP 2.0.0 (stdio transport)
  • Jackson 3 (tools.jackson) for JSON
  • Gradle 9.3.1 with version catalog (gradle/libs.versions.toml)

Build

# Point to a JDK 25+ if it's not the default:

export JAVA_HOME="$HOME/.jdks/jdk-25.0.2"

./gradlew build

On Windows: .\gradlew.bat build.

Output: build/libs/sonar-mcp-server.jar

Configuration

The server needs a SonarQube URL and token; the rest is optional.

VariableDescription
SONAR_URLSonarQube base URL (e.g. http://sonar.example.com)
SONAR_TOKENSonarQube user token
SONAR_DEFAULT_PROJECT_KEYDefault SonarQube project key. When set, listIssues, getProjectIssuesSummary, listHotspots can be called without projectKey.
SONAR_DEFAULT_BRANCHDefault Sonar branch. When set, all branch-aware tools (listIssues, getIssue, getIssueSnippets, getProjectIssuesSummary, listHotspots) fall back to this branch when branch is omitted. Without it Sonar uses the project's main branch.
SONAR_MCP_DATA_DIRLocal data directory for the server; defaults to ~/.sonar-mcp-server

| SONAR_MCP_PAGINATION_DEFAULT_LIMIT | Default page limit for list tools; defaults t

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx