
SAST MCP Server
io.github.Skyrxin由 GitHub 帳號 Skyrxin 發布v0.8.3更新於 Oct 24, 2026
11-scanner SAST/DAST MCP server with closed-loop remediation, SBOM/SARIF, and CI integrations
概覽
本機 MCP 伺服器,讓 AI 助理用 11 款 SAST、SCA 與 DAST 掃描器檢查程式碼,並對結果進行分診、匯出與修復。
- 可以做什麼
- 用單一掃描器或平行執行全部已安裝掃描器掃描程式碼,支援只掃描 git 變更、掃描完整 git 歷史中的密鑰,以及透過 Docker Compose 對執行中的應用程式做容器映像掃描和 OWASP ZAP 動態掃描。依嚴重度與信心度過濾、分頁,並帶稽核紀錄地抑制誤報與管理忽略清單。儲存與比對基準,執行 PASS/FAIL 策略判定,匯出 SARIF、SBOM(CycloneDX/SPDX)、HTML/PDF 報告與合規報告。匯入外部 SARIF,並用 VEX 處置結論分診問題。產生修復提示詞、透過 git apply 套用統一 diff,並執行含重掃與回滾的閉環修復。將結果上傳到 DefectDojo 或 GitHub Code Scanning,在 PR/MR 上留言,建立 Jira 工單,發送 Slack/Teams 通知。
- 適用情境
- 適合讓助理審查程式碼庫或合併請求中的漏洞、檢查相依套件與 IaC 設定問題、在 git 歷史中尋找外洩的密鑰,或依嚴重度門檻做 CI 把關。也適合需要 SARIF/SBOM 輸出,或需要由代理提出並驗證修補程式的修復流程的團隊。
- 執行需求
- 以 stdio 在本機執行,通常透過 uvx 或 pip 安裝(Python)。伺服器能力取決於同時安裝的掃描器:完整 Docker 映像內建九款掃描器,pip 附加套件增加四款,其餘(CodeQL、OWASP ZAP、Trivy、Grype、Gitleaks、OSV-Scanner、Bearer)需另行安裝。DAST 與映像掃描需要 Docker。選用整合需要憑證:DEFECTDOJO_URL 與 DEFECTDOJO_API_KEY、GITHUB_TOKEN、GITLAB_TOKEN、SLACK_WEBHOOK_URL、TEAMS_WEBHOOK_URL、JIRA_*;HTTP 傳輸可用 SAST_MCP_JWT_SECRET 或 SAST_MCP_API_KEY 啟用驗證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 SAST MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
SAST MCP Server
[PyPI version] [sast-mcp-server MCP server] [Python 3.10+] [License: MIT] [CI] [codecov]
Static Application Security Testing (SAST) for AI agents. A production-ready MCP server that gives any AI agent the ability to scan code for security vulnerabilities.
Supports 11 industry-standard scanners:
Works with any MCP-compatible agent: Gemini CLI, Claude Desktop, OpenAI Agents, Cursor, Windsurf, and more.
Features
- 🔍 11 SAST/SCA/DAST scanners with a unified output format
- 🌳 AST-aware context — shows the full enclosing function, not just a line number
- 📊 Severity & confidence filtering — focus on what matters
- 🔀 Git diff mode — scan only modified files for incremental reviews
- 🙈 Ignore management — suppress false positives with audit trail
- 📄 Pagination — handle large codebases without overwhelming the agent
- 🌐 Dual transport — stdio (local) or Streamable HTTP (remote deployments)
- 🔐 JWT & API key authentication — secure remote deployments
- 📦 One command install —
pip install sast-mcp-server - 🚀 Multi-scanner mode — run all installed scanners in parallel with deduplication
- 📋 SARIF export — CI/CD integration with GitHub, GitLab, Azure DevOps
- 🏗️ IaC scanning — Terraform, Kubernetes, Docker security policies
- 🔑 Secret detection — find hardcoded API keys, tokens, and passwords in code and git history
- 📦 SCA / dependency CVEs — scan lock files for known vulnerabilities against the OSV database
- 🕷️ DAST — dynamic baseline scans of running apps via OWASP ZAP + Docker
- 📈 Baselines & trend tracking — cache scans and diff against a saved baseline
- 🤖 MCP Prompts & Resources — pre-built security workflows and live dashboards for agents
- 📤 Dashboard integrations — push SARIF results to DefectDojo or GitHub Code Scanning
- 🩹 AI-assisted remediation — generate fix prompts and apply agent-written patches via
git apply
Quick Start
The server is only as useful as the scanners installed alongside it. Pick the install path that matches how much of the toolset you want out of the box.
Option 1 — Full container (recommended: 9 scanners, zero setup)
Bundles bandit, njsscan, bearer, semgrep, trivy, checkov, gitleaks,
osv-scanner, and grype so scan_all works immediately. Or bring up an HTTP
server with one command:
Option 2 — pip extra (4 pip-installable scanners)
Option 3 — minimal / custom
Then install whichever scanners you need (binary scanners aren't pip packages):
What ships where
At startup the server logs how many scanners it can actually see (e.g.
Scanners available: 9/11 (...)), and thelist_scannerstool //readyendpoint report the same — so it's always obvious what you have.
Usage with AI Agents
Gemini CLI
Install as an extension:
Or add to your ~/.gemini/settings.json:
Claude Desktop
Add to your claude_desktop_config.json:
See full Claude Desktop guide.
Cursor IDE
Add to Cursor Settings → MCP Servers:
See full Cursor guide.
OpenAI Agents SDK
See full OpenAI guide.
Available MCP Tools
scan_vulnerabilities
Scan a directory for security vulnerabilities using a specific scanner.
scan_all
Run ALL installed scanners in parallel with automatic deduplication. Recommended for comprehensive security scanning.
scan_git_history
Scan the entire .git history for leaked secrets and credentials using Gitleaks.
run_active_scan
Run a dynamic (DAST) baseline scan with OWASP ZAP by orchestrating a Docker Compose stack.
export_sarif
Export scan results in SARIF 2.1.0 format for CI/CD integration.
list_scanners
List available scanners, their installation status, and supported languages.
ignore_vulnerability
Suppress a finding from future scans (with audit trail).
unignore_vulnerability
Re-enable a previously suppressed finding.
list_ignored_vulnerabilities
Show all currently suppressed findings for a project.
save_baseline
Run a scan and cache the results as a named baseline for future trend comparison.
compare_baseline
Compare a fresh scan against a saved baseline to highlight new and fixed findings.
upload_to_defectdojo
Import a SARIF export into a DefectDojo engagement. Requires DEFECTDOJO_URL
and DEFECTDOJO_API_KEY environment variables.
upload_to_github
Upload a SARIF report to GitHub Code Scanning. Requires a GITHUB_TOKEN with
security_events: write scope.
generate_fix_prompt
Package a cached finding's vulnerable code and context into an LLM-ready prompt that asks for a strict unified diff fix.
apply_patch
Apply an agent-generated unified diff to disk via git apply (paths that escape
the target directory are rejected).
evaluate_policy
Run all scanners and return an explicit PASS/FAIL verdict for CI gating.
export_sbom
Run all scanners and export an SBOM / vulnerability report. In CycloneDX mode, if Syft is installed the component inventory is the full dependency list (not just vulnerable packages).
generate_report
Run all scanners and render an executive security report.
compliance_report
Map findings to a compliance framework and report the posture.
scan_image
Scan a container image reference for vulnerabilities and secrets (Trivy or Grype).
remediate_and_verify
Closed-loop remediation: dry-run a patch, apply it, re-scan, and confirm the finding is gone (rolling the patch back on failure).
import_sarif
Ingest an external SARIF file (Snyk, Veracode, CI jobs, …) into the normalized finding pipeline so it joins dedup / baselines / dashboards.
triage_finding
Get an exploitability/false-positive assessment prompt, or record a CycloneDX VEX decision (suppressing dispositions also add the finding to the ignore-list).
comment_on_pr
Post a security summary on a GitHub PR or GitLab merge request. Requires
GITHUB_TOKEN or GITLAB_TOKEN (+ optional GITLAB_URL).
notify_slack / notify_teams
Send a notification to a Slack or Microsoft Teams incoming webhook
(SLACK_WEBHOOK_URL / TEAMS_WEBHOOK_URL).
create_jira_issue
Open a Jira issue for a finding. Requires JIRA_URL, JIRA_EMAIL, JIRA_API_TOKEN.
Tip:
scan_vulnerabilities,scan_all, andscan_git_historyacceptoutput_format="json"for machine-readable results in CI/agent pipelines.
Auth: On HTTP transports every tool is scope-gated —
scan:read(scans, reports, exports),scan:write(baselines, patches, uploads, notifications),config:write(ignore list). SetSAST_MCP_JWT_SECRETand issue scoped JWTs.
SARIF / CI/CD Integration
Export scan results in SARIF 2.1.0 format for integration with CI/CD platforms:
Compatible with: GitHub Code Scanning, GitLab SAST, Azure DevOps, VS Code SARIF Viewer.
Remote Deployment (Streamable HTTP)
For remote or cloud-hosted deployments, the 2026 MCP standard uses Streamable HTTP.
You can secure the server with JWT Bearer Authentication by setting a secret. Alternatively, for backward compatibility, you can use a static API key.
Note: The old
ssetransport is deprecated. Please migrate tostreamable-http.
Core Workflows
1. Unified Vulnerability Scanning
Run any of the installed scanners individually (scan_vulnerabilities(scanner_name="bandit")) or run all of them at once using scan_all.
2. Deep Secret & Dynamic Scanning
Use scan_git_history to find API keys leaked years ago, or run_active_scan to spin up your application with Docker Compose and test it dynamically with OWASP ZAP.
3. Baseline & Trend Tracking
Save a scan as a named baseline and compare future scans against it to track new vulnerabilities, fixed issues, and severity trends over time.
save_baseline(target_path=".", tag="main")compare_baseline(target_path=".", tag="main")
4. CI/CD Integration
Export scan results to SARIF format (export_sarif) to integrate with GitHub Code Scanning, GitLab SAST, or any other SARIF-compatible platform.
5. MCP Prompts (Security Workflows)
Pre-built security workflows that guide AI agents:
security_review: Full codebase assessmentfix_vulnerability: Focused remediation advisorpr_security_check: Scan only git diffs and enforce a severity gatecompliance_report: Generate an OWASP Top 10 or PCI-DSS report
6. MCP Resources (Security Dashboards)
Read-only contextual data for AI agents without running a full scan:
sast://dashboard/{path}: Security posture dashboardsast://config: Server configuration and statussast://scanners: Available scanners and languagessast://cache/{path}/latest: Latest scan results metadata
7. Dashboard Upload & AI-Assisted Remediation
Push SARIF results to external platforms and remediate findings with agent-written patches:
upload_to_defectdojo/upload_to_github: Push a SARIF export to a dashboardgenerate_fix_prompt: Build an LLM-ready prompt for a specific findingapply_patch: Apply the resulting unified diff viagit apply
Docker
Pre-built images are published to GHCR on every release:
Prefer to build locally?
CodeQL and OWASP ZAP are not bundled in the image — CodeQL ships a multi-GB bundle (mount at runtime) and ZAP's
run_active_scanorchestrates Docker on the host.
Reliability
"Production-ready" isn't a slogan here — it's measured in CI on every push:
- 226 tests, 74% line coverage (Codecov), green across Python 3.10–3.13, with mypy type-checking enforced.
- Self-scan, every build. The server runs its own scanners against its own code in CI; the SARIF + summary are published as the
self-scan-reportartifact. A snapshot lives inexamples/self-scan/. - Load-tested HTTP transport.
scripts/loadtest.pyruns in CI against the Streamable HTTP server: a local run sustains ~210 req/s at p95 ≈ 290 ms with zero failures across/health,/ready,/metricsunder 30 concurrent workers. - Ops endpoints —
/health(liveness),/ready(cached scanner inventory, 503 when none installed),/metrics(Prometheus text). - Bounded under load — a configurable concurrency cap (
SAST_MCP_MAX_CONCURRENT_SCANS) around subprocess scanners, per-client token-bucket rate limiting (SAST_MCP_RATE_LIMIT_PER_MIN) for HTTP transports, per-scanner timeouts, and an optional incremental-scan cache.
Run the load test yourself:
Configuration
Environment Variables
Operational endpoints (HTTP transports)
When running with --transport streamable-http, the server exposes:
Incremental scans
scan_vulnerabilities and scan_all accept use_cache=true: the server
fingerprints the target's files and reuses the previous scan when nothing has
changed, so repeated scans in a session are fast.
Development
Project Structure
License
來源:README.md,提交 d9a8431
工具
0版本歷史
1- v0.8.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分