mcp-sast-cov
Provides tools for interacting with SonarQube's Web API to retrieve code quality overviews, issue lists, and project information, including quality gates, coverage, duplications, and security hotspots.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-sast-covShow SonarQube quality gate status for project manageposition-api on develop branch"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Starter Server (TypeScript)
MCP server ตัวอย่างที่เขียนด้วย TypeScript ใช้ @modelcontextprotocol/sdk
สถาปัตยกรรมคร่าวๆ
flowchart LR
U[ผู้ใช้พิมพ์คำถาม] --> C[Claude]
C -->|เลือกเรียก tool ที่เหมาะสม| E[MCP Starter Extension\n(Node process บนเครื่องนี้)]
E -->|REST API + token| S[(SonarQube)]
E -->|REST API + auth key| CV[(Coverity Connect)]
S -->|Quality Gate / issues| E
CV -->|projects / streams / defects| E
E -->|ผลลัพธ์เป็นข้อความ| C
C -->|สรุปคำตอบ| URelated MCP server: SonarQube MCP Server
Tools ที่มีให้
Tool | ใช้ทำอะไร |
| ทดสอบว่า server เชื่อมต่อได้ไหม |
| ตัวอย่างเรียก API สาธารณะ (Open-Meteo) — ไว้ดูโครงสร้างโค้ดเฉยๆ |
| ภาพรวมคุณภาพโค้ดจาก SonarQube: Quality Gate, coverage, duplications, security hotspots (New Code + Overall Code) |
| รายการ issue ที่ SonarQube ตรวจเจอ กรองตามความรุนแรง/ประเภท/New Code ได้ |
| ค้นหา/ดูรายชื่อโปรเจกต์ทั้งหมดใน SonarQube (ใช้ตอนไม่รู้ project key) |
| ดูรายชื่อโปรเจกต์ทั้งหมดใน Coverity Connect |
| ดูรายชื่อ stream ใน Coverity (ใช้หาชื่อ stream ก่อนค้นหา defect) |
| ค้นหา defect ใน stream หนึ่งๆ กรองตาม impact/status ได้ |
| [debug] เรียก path ใดๆ ใต้ Coverity API v2 ดิบๆ ใช้ตอน tool อื่น error |
เตรียม SonarQube token
เข้า SonarQube → มุมขวาบน → My Account → Security
สร้าง token ใหม่ (ประเภท User Token หรือ Project Analysis Token ก็ได้ ขอแค่มีสิทธิ์ Browse โปรเจกต์ที่จะดู)
copy token เก็บไว้ (จะเห็นครั้งเดียว)
เตรียม Coverity Connect Auth Key
เข้า Coverity Connect → คลิกชื่อผู้ใช้มุมขวาบน → หาเมนู Authentication Keys (หรือ Configuration > Users ถ้าเป็น admin)
สร้าง auth key ใหม่ จะได้ไฟล์ JSON ประมาณนี้:
{"key":"xxx","id":10077,"username":"user6","comments":{"host":"coverity2025.pttdigital.com",...}}เอาค่าไปตั้งเป็น environment variable:
COVERITY_USERNAME= ค่าใน fieldusernameCOVERITY_AUTH_KEY= ค่าใน fieldkeyCOVERITY_BASE_URL= URL ของ Coverity Connect เช่นhttps://coverity2025.pttdigital.com
หมายเหตุความน่าเชื่อถือ: Coverity ไม่มีเอกสาร REST API เปิดสาธารณะครบเหมือน SonarQube ทำให้ endpoint/field ใน
src/coverity.tsเป็นการประกอบร่างจากตัวอย่างที่หาได้ ความมั่นใจปานกลาง — ถ้าเรียกlist_coverity_projects/list_coverity_streams/get_coverity_issuesแล้ว error ให้ใช้ toolcoverity_debug_requestเรียก path เดียวกันแบบ raw ดู response จริงแล้วเอา error message มาปรับโค้ดต่อ (เหมือนที่เจอกับ SonarQube ตอน/projects/searchต้องเปลี่ยนเป็น/components/search)
วิธีรัน
npm install
cp .env.example .env # แล้วใส่ SONAR_BASE_URL / SONAR_TOKEN ลงในไฟล์ .env
npm run build
npm startหมายเหตุ: ตอนรันผ่าน
npm startตรงๆ จะไม่มีอะไรเกิดขึ้นถ้าไม่มี MCP client ต่อเข้ามา — server แค่รอรับคำสั่งผ่าน stdio เท่านั้น
token อ่านมาจากไหน
โค้ดอ่านจาก environment variable SONAR_BASE_URL / SONAR_TOKEN ล้วนๆ ซึ่งมาได้ 2 ทาง:
npm start— ใช้node --env-file-if-exists=.envโหลดไฟล์.envให้อัตโนมัติ (ต้องใช้ Node 20.12+)ผ่าน MCP client (Claude Desktop / Claude Code) — client รัน
node dist/index.jsเอง ไม่ผ่าน npm ดังนั้นไฟล์.envจะไม่ถูกโหลด ต้องใส่ค่าในบล็อกenvของ config ตามตัวอย่างด้านล่าง
วิธีทดสอบด้วย MCP Inspector
npx @modelcontextprotocol/inspector \
-e SONAR_BASE_URL=https://sonarqube.example.com \
-e SONAR_TOKEN=your_token_here \
node dist/index.jsจะเปิดหน้าเว็บให้เลือก tool แล้วกรอก projectKey (เช่น manageposition-api) และ branch (เช่น develop/bau) ทดสอบเรียกดูผลลัพธ์ได้ทันที
วิธีเชื่อมกับแอป Claude (แบบ Extension — สำหรับแอปรุ่นใหม่ที่มีหน้า Settings > Extensions)
แอป Claude รุ่นใหม่ (ที่มี Cowork mode) ใช้ระบบ Extension แทนการแก้ไฟล์ config ตรงๆ โปรเจกต์นี้มีไฟล์ manifest.json เตรียมไว้ให้แล้ว:
npm install && npm run buildให้เรียบร้อย (ต้องมีdist/และnode_modules/ในโปรเจกต์ เพราะตอนโหลดเป็น extension จะไม่รันnpm installให้)เปิดแอป Claude → Settings → Extensions
กด "Install unpacked extension" แล้วเลือกโฟลเดอร์นี้ทั้งโฟลเดอร์ (ที่มี
manifest.jsonอยู่ข้างใน)จะมีฟอร์มให้กรอก SonarQube Base URL และ SonarQube Token — กรอกให้ครบ
Enable extension แล้วลองถามในแชทได้เลย
manifest.jsonเขียนตามสเปก Desktop Extension (DXT) เท่าที่ทราบ ถ้า error ให้ copy ข้อความมาดู จะปรับให้ตรงสเปกจริง
วิธีเชื่อมกับ Claude Desktop
เปิดไฟล์ config ของ Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json) แล้วเพิ่ม:
{
"mcpServers": {
"mcp-starter": {
"command": "node",
"args": ["D:\\noom\\MCP\\mcp-starter_2\\dist\\index.js"],
"env": {
"SONAR_BASE_URL": "https://sonarqube.example.com",
"SONAR_TOKEN": "your_token_here"
}
}
}
}แล้ว restart Claude Desktop จากนั้นถามได้เลย เช่น "Quality Gate ของ manageposition-api branch develop/bau ผ่านไหม"
วิธีเชื่อมกับ Claude Code
claude mcp add mcp-starter \
--env SONAR_BASE_URL=https://sonarqube.example.com \
--env SONAR_TOKEN=your_token_here \
-- node /absolute/path/to/mcp-starter/dist/index.jsโครงสร้างโปรเจกต์
src/
index.ts - นิยาม tools ทั้งหมด และจุดเริ่มรัน server
sonarqube.ts - ฟังก์ชันเรียก SonarQube Web API (แยกออกมาให้ทดสอบ/แก้ง่าย)
sonar.check.ts - self-check ของตัวแปลงข้อมูล รันด้วย `npm run check`Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
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
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Access New Relic observability data through MCP - query metrics, logs, traces, entities, and more
Query metrics, targets, entities, and team data in your Steep workspace via MCP.
Revternal MCP — wraps the Revternal Developer Intelligence API
Related MCP Servers
AlicenseBqualityDmaintenanceAllows developers to query security findings (SAST issues, secrets, patches) using natural language within AI-assisted tools like Claude Desktop, Cursor, and other MCP-compatible environments.179MIT- FlicenseNot gradedqualityDmaintenanceEnables access to SonarQube code quality analysis through MCP, including issue searching, metrics retrieval, and quality gate status.-
- AlicenseNot gradedqualityBmaintenanceEnables AI-driven static application security testing (SAST) through MCP, allowing users to scan codebases, detect vulnerabilities, and triage findings using natural language.646MIT
- AlicenseAqualityCmaintenanceEnables policy-first defensive security operations for MCP, providing repository and web-security analysis with controlled authorization, scoped execution, and auditability.9MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/suwitk/mcp-sast-cov'
If you have feedback or need assistance with the MCP directory API, please join our Discord server