SAST MCP Server

v0.8.3
io.github.Skyrxin/sast-mcp-server Checked 1 day ago Published 5 months ago

11-scanner SAST/DAST MCP server with closed-loop remediation, SBOM/SARIF, and CI integrations

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scan_vulnerabilities Scan Vulnerabilities

Scan a target directory for security vulnerabilities using a SAST tool.

ParameterTypeDescription
target_path *stringThe absolute path to the directory or file to scan.
git_diff_onlybooleanIf true, only reports findings in files modified in git diff.
limitintegerMaximum number of findings to return (for pagination).
min_confidencestringMinimum confidence to report (LOW, MEDIUM, HIGH).
min_severitystringMinimum severity to report (LOW, MEDIUM, HIGH, CRITICAL).
offsetintegerPagination offset.
output_formatstring'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI).
scanner_namestringThe scanner to use ('bandit', 'njsscan', 'bearer', 'semgrep'). Defaults to 'bearer'.
use_cachebooleanIf true, reuse the last cached scan when the target's files are unchanged (incremental scan). Ignored when git_diff_only is set.

ignore_vulnerability Ignore Vulnerability

Ignore a specific vulnerability finding so it won't appear in future scans.

ParameterTypeDescription
finding_hash *stringThe unique hash of the finding to ignore (shown in scan results).
target_path *stringThe root directory of the project (where .sast-mcp-ignore.json lives).
reasonstringOptional justification for ignoring the vulnerability.

unignore_vulnerability Unignore Vulnerability

Remove a vulnerability from the ignore list so it appears in future scans again.

ParameterTypeDescription
finding_hash *stringThe unique hash of the finding to unignore.
target_path *stringThe root directory of the project.

list_scanners List Scanners

List all available SAST scanners, their status, and supported languages. Returns information about each scanner including whether it is installed and ready to use, what languages it supports, and how to install it.

list_ignored_vulnerabilities List Ignored Vulnerabilities

List all currently ignored vulnerability findings for a project.

ParameterTypeDescription
target_path *stringThe root directory of the project.

scan_git_history Scan Git History

Scan the entire git history for leaked secrets and credentials using Gitleaks. Traditional SAST only scans the current state of files. This tool deeply analyzes the `.git` directory to find API keys, passwords, and tokens that were committed in the past but may still be valid.

ParameterTypeDescription
min_severitystringMinimum severity threshold (defaults to LOW).
output_formatstring'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI).
target_pathstringPath to the repository root (must contain a .git directory).

run_active_scan Run Active Scan

Run an active dynamic scan (DAST) using OWASP ZAP. Unlike SAST which only looks at code, this orchestrates spinning up the application via Docker Compose, waiting for it to be ready, and then running a ZAP dynamic baseline scan against the running instance.

ParameterTypeDescription
docker_compose_file *stringThe name of the docker-compose file (e.g. docker-compose.yml).
target_path *stringPath to the directory containing the docker-compose file.
target_url *stringThe URL of the target application once it's up (e.g. http://localhost:8080).

export_sarif Export Sarif

Run a SAST scan and export results in SARIF 2.1.0 format for CI/CD integration. SARIF is the industry standard format consumed by GitHub Code Scanning, GitLab SAST, Azure DevOps, and other CI/CD platforms.

ParameterTypeDescription
target_path *stringThe absolute path to the directory or file to scan.
min_confidencestringMinimum confidence to report (LOW, MEDIUM, HIGH).
min_severitystringMinimum severity to report (LOW, MEDIUM, HIGH, CRITICAL).
output_pathstringOptional path to write the SARIF file. If empty, returns the SARIF JSON as a string.
scanner_namestringThe scanner to use ('bandit', 'njsscan', 'bearer', 'semgrep', 'trivy', 'codeql', 'checkov'). Defaults to 'bearer'.

scan_all Scan All

Scan with ALL installed scanners in parallel, returning deduplicated results. Automatically detects which scanners are installed, runs them concurrently, and deduplicates findings across scanners using content-based hashing. This is the recommended tool for comprehensive security scanning.

ParameterTypeDescription
target_path *stringThe absolute path to the directory or file to scan.
git_diff_onlybooleanIf true, only reports findings in files modified in git diff.
limitintegerMaximum number of findings to return (for pagination).
min_confidencestringMinimum confidence to report (LOW, MEDIUM, HIGH).
min_severitystringMinimum severity to report (LOW, MEDIUM, HIGH, CRITICAL). Defaults to MEDIUM to reduce noise from multiple scanners.
offsetintegerPagination offset.
output_formatstring'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI).
use_cachebooleanIf true, reuse the last cached scan_all when the target's files are unchanged (incremental scan). Ignored with git_diff_only.

scan_image Scan Image

Scan a container image for vulnerabilities and secrets. Pulls and analyzes a container image reference (e.g. `nginx:1.25`, `ghcr.io/org/app@sha256:...`) with Trivy or Grype, returning the same normalized findings as a source scan.

ParameterTypeDescription
image_ref *stringThe image reference to scan.
min_severitystringMinimum severity to report (LOW, MEDIUM, HIGH, CRITICAL).
output_formatstring'markdown' (default) or 'json'.
scanner_namestring'trivy' (default) or 'grype'.

save_baseline Save Baseline

Run a scan and save the results as a named baseline for future comparison.

ParameterTypeDescription
target_path *stringThe absolute path to the directory to scan.
min_confidencestringMinimum confidence to include (LOW, MEDIUM, HIGH).
min_severitystringMinimum severity to include (LOW, MEDIUM, HIGH, CRITICAL).
scanner_namestringScanner to use, or 'scan_all' to baseline the deduplicated results of every installed scanner (recommended for policy gating with `evaluate_policy(fail_on_new=True)`). Defaults to 'bearer'.
tagstringA name for this baseline (e.g., 'main', 'pre-release'). Defaults to 'latest'.

compare_baseline Compare Baseline

Compare current scan results against a saved baseline. Shows new vulnerabilities, fixed vulnerabilities, and severity trends.

ParameterTypeDescription
target_path *stringThe absolute path to the directory to scan.
min_confidencestringMinimum confidence (LOW, MEDIUM, HIGH).
min_severitystringMinimum severity (LOW, MEDIUM, HIGH, CRITICAL).
scanner_namestringScanner to use. Defaults to 'bearer'.
tagstringThe baseline tag to compare against. Defaults to 'latest'.

evaluate_policy Evaluate Policy

Run all scanners and evaluate findings against a CI security policy. Returns an explicit PASS/FAIL verdict suitable for gating a pipeline. A threshold of ``-1`` means "no limit" for that severity. When ``fail_on_new`` is set, the result also fails if any finding is new relative to the named baseline (created with ``save_baseline``).

ParameterTypeDescription
target_path *stringThe absolute path to the directory to scan.
baseline_tagstringBaseline tag to diff against when ``fail_on_new`` is set.
fail_on_newbooleanIf true, fail when findings are new vs. the baseline.
max_criticalintegerMax allowed CRITICAL findings (default 0). -1 = unlimited.
max_highintegerMax allowed HIGH findings. -1 = unlimited (default).
max_mediumintegerMax allowed MEDIUM findings. -1 = unlimited (default).
min_confidencestringMinimum confidence to include in the scan.
min_severitystringMinimum severity to include in the scan.
output_formatstring'markdown' (default) or 'json' (machine-readable verdict).

export_sbom Export Sbom

Run all scanners and export an SBOM / vulnerability report. Produces the supply-chain artifact enterprises expect. In CycloneDX mode, if Syft is installed the component inventory is the *full* dependency list (not just vulnerable packages); otherwise components are derived from findings. SPDX mode emits an SPDX 2.3 document.

ParameterTypeDescription
target_path *stringThe absolute path to scan.
formatstring'cyclonedx' (default) or 'spdx'.
min_severitystringMinimum severity to include.
output_pathstringFile path to write the SBOM (empty = return inline).
sca_onlybooleanInclude only dependency (SCA) findings (default). Set False to include every finding as a vulnerability entry.

generate_report Generate Report

Run all scanners and render an executive security report (HTML or PDF).

ParameterTypeDescription
target_path *stringThe absolute path to scan.
formatstring'html' (default) or 'pdf'. PDF requires the optional [pdf] extra (`pip install "sast-mcp-server[pdf]"`).
min_severitystringMinimum severity to include.
output_pathstringFile path to write the report (empty = return inline HTML; required for PDF since it is binary).

compliance_report Compliance Report

Map findings to a compliance framework and report the posture. Buckets all findings against OWASP Top 10, SANS CWE Top 25, PCI DSS, or CIS using each finding's CWE / OWASP metadata.

ParameterTypeDescription
target_path *stringThe absolute path to scan.
frameworkstring'owasp' (default), 'sans', 'pci', or 'cis'.
min_severitystringMinimum severity to include.
output_pathstringOptional path to write the markdown report.

upload_to_defectdojo Upload To Defectdojo

Upload a SARIF report to a DefectDojo engagement. Requires the DEFECTDOJO_URL and DEFECTDOJO_API_KEY environment variables. Generate the SARIF file first with `export_sarif(output_path=...)`.

ParameterTypeDescription
engagement_id *integerNumeric ID of the target DefectDojo engagement.
sarif_path *stringPath to a SARIF file produced by `export_sarif`.
activebooleanMark imported findings as active.
verifiedbooleanMark imported findings as verified.

upload_to_github Upload To Github

Upload a SARIF report to GitHub Code Scanning. Requires a GITHUB_TOKEN environment variable with `security_events: write` scope. Generate the SARIF file first with `export_sarif(output_path=...)`.

ParameterTypeDescription
commit_sha *stringFull SHA of the commit the results apply to.
ref *stringFully qualified ref, e.g. `refs/heads/main`.
repo *stringRepository in `owner/name` form.
sarif_path *stringPath to a SARIF file produced by `export_sarif`.

comment_on_pr Comment On Pr

Post a security summary comment on a GitHub PR or GitLab merge request. Credentials come from environment variables only: GITHUB_TOKEN for GitHub, or GITLAB_TOKEN (+ optional GITLAB_URL) for GitLab.

ParameterTypeDescription
body *stringMarkdown comment body (e.g. a scan summary or gate result).
pr_number *integerPR number (GitHub) or merge request IID (GitLab).
provider *string'github' or 'gitlab'.
repo *stringFor GitHub, 'owner/name'. For GitLab, the numeric project ID or URL-encoded 'group/project' path.

notify_slack Notify Slack

Send a notification to the configured Slack incoming webhook. Requires the SLACK_WEBHOOK_URL environment variable.

ParameterTypeDescription
message *stringThe message text (Slack mrkdwn supported).

notify_teams Notify Teams

Send a notification to the configured Microsoft Teams incoming webhook. Requires the TEAMS_WEBHOOK_URL environment variable.

ParameterTypeDescription
message *stringThe message body (Markdown supported).
titlestringCard title.

create_jira_issue Create Jira Issue

Open a Jira issue for a security finding. Requires the JIRA_URL, JIRA_EMAIL, and JIRA_API_TOKEN environment variables.

ParameterTypeDescription
description *stringIssue description (plain text).
project_key *stringThe Jira project key (e.g. 'SEC').
summary *stringIssue title.
issue_typestringJira issue type name (default 'Bug').

generate_fix_prompt Generate Fix Prompt

Build an LLM-ready prompt to fix a cached finding as a unified diff. Recovers the finding (by hash) from the scan cache, extracts an expanded window of the vulnerable source, and returns a prompt engineered to make an LLM emit a strict unified diff. After generating the patch, apply it with `apply_patch`.

ParameterTypeDescription
finding_hash *stringHash of the finding to remediate (shown in scan output).
target_path *stringRoot of the scanned project (must have a `.sast-mcp-cache`).
context_windowintegerSource lines to include before/after the finding.

apply_patch Apply Patch

Apply an agent-generated unified diff to files under target_path. Uses `git apply`, which refuses paths that escape the target directory. Run with `check_only=True` first to verify the patch applies cleanly before writing changes.

ParameterTypeDescription
patch *stringThe unified diff text to apply.
target_path *stringDirectory the patch paths are relative to.
check_onlybooleanIf True, validate without modifying any files.

remediate_and_verify Remediate And Verify

Apply a fix and prove it worked: scan → patch → re-scan → confirm gone. The closed remediation loop. Recovers the finding by hash, dry-runs the patch, re-scans the affected file before and after applying it, and returns PASS only if the finding's hash disappears **and** no new finding of equal or higher severity is introduced. On failure (and when ``auto_rollback``), the patch is reverted so the working tree is left clean.

ParameterTypeDescription
finding_hash *stringHash of the finding to fix (from earlier scan output).
patch *stringThe unified diff to apply (e.g. produced via generate_fix_prompt).
target_path *stringRoot of the scanned project (with a `.sast-mcp-cache`).
auto_rollbackbooleanRevert the patch if verification fails (default True).
scanner_namestringScanner to re-scan with. Defaults to the finding's originating scanner, falling back to all scanners.

import_sarif Import Sarif

Ingest an external SARIF file into the normalized finding pipeline. Lets results from any SARIF-producing tool (Snyk, Veracode, CodeQL, a CI job, etc.) join the same dedup / baseline / dashboard flow as native scans. The findings are re-enriched with AST context and stable hashes on import.

ParameterTypeDescription
sarif_path *stringPath to a SARIF 2.1.0 JSON file.
target_path *stringProject root the SARIF results belong to (for caching).
savebooleanCache the imported findings so compare_baseline / dashboards see them (default True).
scanner_namestringName to record as the source scanner (default 'external').

triage_finding Triage Finding

Triage a finding: get an exploitability prompt, or record a VEX decision.

ParameterTypeDescription
finding_hash *stringHash of the finding to triage.
target_path *stringRoot of the scanned project (with a `.sast-mcp-cache`).
dispositionstringVEX state keyword (empty = return a triage prompt instead).
justificationstringRationale (CycloneDX justification keyword for not_affected, otherwise free text).