SAST MCP Server
v0.8.311-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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory or file to scan. |
git_diff_only | boolean | If true, only reports findings in files modified in git diff. |
limit | integer | Maximum number of findings to return (for pagination). |
min_confidence | string | Minimum confidence to report (LOW, MEDIUM, HIGH). |
min_severity | string | Minimum severity to report (LOW, MEDIUM, HIGH, CRITICAL). |
offset | integer | Pagination offset. |
output_format | string | 'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI). |
scanner_name | string | The scanner to use ('bandit', 'njsscan', 'bearer', 'semgrep'). Defaults to 'bearer'. |
use_cache | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
finding_hash * | string | The unique hash of the finding to ignore (shown in scan results). |
target_path * | string | The root directory of the project (where .sast-mcp-ignore.json lives). |
reason | string | Optional justification for ignoring the vulnerability. |
unignore_vulnerability Unignore Vulnerability
Remove a vulnerability from the ignore list so it appears in future scans again.
| Parameter | Type | Description |
|---|---|---|
finding_hash * | string | The unique hash of the finding to unignore. |
target_path * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
min_severity | string | Minimum severity threshold (defaults to LOW). |
output_format | string | 'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI). |
target_path | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
docker_compose_file * | string | The name of the docker-compose file (e.g. docker-compose.yml). |
target_path * | string | Path to the directory containing the docker-compose file. |
target_url * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory or file to scan. |
min_confidence | string | Minimum confidence to report (LOW, MEDIUM, HIGH). |
min_severity | string | Minimum severity to report (LOW, MEDIUM, HIGH, CRITICAL). |
output_path | string | Optional path to write the SARIF file. If empty, returns the SARIF JSON as a string. |
scanner_name | string | The 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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory or file to scan. |
git_diff_only | boolean | If true, only reports findings in files modified in git diff. |
limit | integer | Maximum number of findings to return (for pagination). |
min_confidence | string | Minimum confidence to report (LOW, MEDIUM, HIGH). |
min_severity | string | Minimum severity to report (LOW, MEDIUM, HIGH, CRITICAL). Defaults to MEDIUM to reduce noise from multiple scanners. |
offset | integer | Pagination offset. |
output_format | string | 'markdown' (human-readable, default) or 'json' (machine-readable list of findings for agents / CI). |
use_cache | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
image_ref * | string | The image reference to scan. |
min_severity | string | Minimum severity to report (LOW, MEDIUM, HIGH, CRITICAL). |
output_format | string | 'markdown' (default) or 'json'. |
scanner_name | string | 'trivy' (default) or 'grype'. |
save_baseline Save Baseline
Run a scan and save the results as a named baseline for future comparison.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory to scan. |
min_confidence | string | Minimum confidence to include (LOW, MEDIUM, HIGH). |
min_severity | string | Minimum severity to include (LOW, MEDIUM, HIGH, CRITICAL). |
scanner_name | string | Scanner 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'. |
tag | string | A 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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory to scan. |
min_confidence | string | Minimum confidence (LOW, MEDIUM, HIGH). |
min_severity | string | Minimum severity (LOW, MEDIUM, HIGH, CRITICAL). |
scanner_name | string | Scanner to use. Defaults to 'bearer'. |
tag | string | The 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``).
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to the directory to scan. |
baseline_tag | string | Baseline tag to diff against when ``fail_on_new`` is set. |
fail_on_new | boolean | If true, fail when findings are new vs. the baseline. |
max_critical | integer | Max allowed CRITICAL findings (default 0). -1 = unlimited. |
max_high | integer | Max allowed HIGH findings. -1 = unlimited (default). |
max_medium | integer | Max allowed MEDIUM findings. -1 = unlimited (default). |
min_confidence | string | Minimum confidence to include in the scan. |
min_severity | string | Minimum severity to include in the scan. |
output_format | string | '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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to scan. |
format | string | 'cyclonedx' (default) or 'spdx'. |
min_severity | string | Minimum severity to include. |
output_path | string | File path to write the SBOM (empty = return inline). |
sca_only | boolean | Include 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).
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to scan. |
format | string | 'html' (default) or 'pdf'. PDF requires the optional [pdf] extra (`pip install "sast-mcp-server[pdf]"`). |
min_severity | string | Minimum severity to include. |
output_path | string | File 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.
| Parameter | Type | Description |
|---|---|---|
target_path * | string | The absolute path to scan. |
framework | string | 'owasp' (default), 'sans', 'pci', or 'cis'. |
min_severity | string | Minimum severity to include. |
output_path | string | Optional 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=...)`.
| Parameter | Type | Description |
|---|---|---|
engagement_id * | integer | Numeric ID of the target DefectDojo engagement. |
sarif_path * | string | Path to a SARIF file produced by `export_sarif`. |
active | boolean | Mark imported findings as active. |
verified | boolean | Mark 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=...)`.
| Parameter | Type | Description |
|---|---|---|
commit_sha * | string | Full SHA of the commit the results apply to. |
ref * | string | Fully qualified ref, e.g. `refs/heads/main`. |
repo * | string | Repository in `owner/name` form. |
sarif_path * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
body * | string | Markdown comment body (e.g. a scan summary or gate result). |
pr_number * | integer | PR number (GitHub) or merge request IID (GitLab). |
provider * | string | 'github' or 'gitlab'. |
repo * | string | For 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.
| Parameter | Type | Description |
|---|---|---|
message * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
message * | string | The message body (Markdown supported). |
title | string | Card 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.
| Parameter | Type | Description |
|---|---|---|
description * | string | Issue description (plain text). |
project_key * | string | The Jira project key (e.g. 'SEC'). |
summary * | string | Issue title. |
issue_type | string | Jira 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`.
| Parameter | Type | Description |
|---|---|---|
finding_hash * | string | Hash of the finding to remediate (shown in scan output). |
target_path * | string | Root of the scanned project (must have a `.sast-mcp-cache`). |
context_window | integer | Source 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.
| Parameter | Type | Description |
|---|---|---|
patch * | string | The unified diff text to apply. |
target_path * | string | Directory the patch paths are relative to. |
check_only | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
finding_hash * | string | Hash of the finding to fix (from earlier scan output). |
patch * | string | The unified diff to apply (e.g. produced via generate_fix_prompt). |
target_path * | string | Root of the scanned project (with a `.sast-mcp-cache`). |
auto_rollback | boolean | Revert the patch if verification fails (default True). |
scanner_name | string | Scanner 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.
| Parameter | Type | Description |
|---|---|---|
sarif_path * | string | Path to a SARIF 2.1.0 JSON file. |
target_path * | string | Project root the SARIF results belong to (for caching). |
save | boolean | Cache the imported findings so compare_baseline / dashboards see them (default True). |
scanner_name | string | Name to record as the source scanner (default 'external'). |
triage_finding Triage Finding
Triage a finding: get an exploitability prompt, or record a VEX decision.
| Parameter | Type | Description |
|---|---|---|
finding_hash * | string | Hash of the finding to triage. |
target_path * | string | Root of the scanned project (with a `.sast-mcp-cache`). |
disposition | string | VEX state keyword (empty = return a triage prompt instead). |
justification | string | Rationale (CycloneDX justification keyword for not_affected, otherwise free text). |