SAST MCP Server
Enables AI agents to scan code for security vulnerabilities using multiple static analysis tools, with support for filtering, deduplication, and CI/CD integration.
README
SAST MCP Server
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 7 industry-standard scanners:
| Scanner | Languages / Scope | Type |
|---|---|---|
| Bandit | Python | Security linter |
| njsscan | JavaScript, Node.js | Static analysis |
| Bearer | Python, JS, Ruby, Java, Go, PHP | Data-flow SAST |
| Semgrep | 30+ languages | Rule-based SAST |
| Trivy | All (CVEs, Secrets, IaC) | Multi-scanner |
| CodeQL | Python, JS, Java, Go, C/C++, C#, Ruby, Swift | Semantic SAST |
| Checkov | Terraform, K8s, Docker, CloudFormation | IaC policy scanner |
Works with any MCP-compatible agent: Gemini CLI, Claude Desktop, OpenAI Agents, Cursor, Windsurf, and more.
Features
- 🔍 7 SAST scanners with 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 SSE/HTTP (remote deployments)
- 🔐 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
- 📦 SCA / dependency CVEs — scan lock files for known vulnerabilities
Quick Start
Install
pip install sast-mcp-server
Or run directly without installing:
uvx sast-mcp-server
Install at least one scanner
# Python projects
pip install bandit
# JavaScript/Node.js projects
pip install njsscan
# Multi-language (recommended)
pip install semgrep
# IaC, secrets, and dependency CVEs (recommended)
# See: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
# IaC policy scanning
pip install checkov
# Deep semantic analysis
# See: https://github.com/github/codeql-cli-binaries/releases
# Data-flow analysis
# See: https://docs.bearer.com/installation/
Usage with AI Agents
Gemini CLI
Install as an extension:
gemini extensions install https://github.com/Skyrxin/sast-mcp-server
Or add to your ~/.gemini/settings.json:
{
"mcpServers": {
"sast": {
"command": "uvx",
"args": ["sast-mcp-server"]
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sast": {
"command": "uvx",
"args": ["sast-mcp-server"]
}
}
}
See full Claude Desktop guide.
Cursor IDE
Add to Cursor Settings → MCP Servers:
{
"mcpServers": {
"sast": {
"command": "uvx",
"args": ["sast-mcp-server"]
}
}
}
See full Cursor guide.
OpenAI Agents SDK
from agents.mcp import MCPServerStdio
sast_server = MCPServerStdio(command="uvx", args=["sast-mcp-server"])
See full OpenAI guide.
Available MCP Tools
scan_vulnerabilities
Scan a directory for security vulnerabilities using a specific scanner.
| Parameter | Type | Default | Description |
|---|---|---|---|
target_path |
string | required | Path to scan |
scanner_name |
string | "bearer" |
Scanner: bandit, njsscan, bearer, semgrep, trivy, codeql, checkov |
min_severity |
string | "LOW" |
Minimum severity: LOW, MEDIUM, HIGH, CRITICAL |
min_confidence |
string | "LOW" |
Minimum confidence: LOW, MEDIUM, HIGH |
git_diff_only |
bool | false |
Only scan git-modified files |
limit |
int | 50 |
Max findings to return |
offset |
int | 0 |
Pagination offset |
scan_all
Run ALL installed scanners in parallel with automatic deduplication. Recommended for comprehensive security scanning.
| Parameter | Type | Default | Description |
|---|---|---|---|
target_path |
string | required | Path to scan |
min_severity |
string | "MEDIUM" |
Minimum severity (higher default to reduce noise) |
min_confidence |
string | "LOW" |
Minimum confidence |
git_diff_only |
bool | false |
Only scan git-modified files |
limit |
int | 50 |
Max findings to return |
offset |
int | 0 |
Pagination offset |
export_sarif
Export scan results in SARIF 2.1.0 format for CI/CD integration.
| Parameter | Type | Default | Description |
|---|---|---|---|
target_path |
string | required | Path to scan |
scanner_name |
string | "bearer" |
Scanner to use |
min_severity |
string | "LOW" |
Minimum severity |
min_confidence |
string | "LOW" |
Minimum confidence |
output_path |
string | "" |
File path to write SARIF (empty = return as string) |
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.
SARIF / CI/CD Integration
Export scan results in SARIF 2.1.0 format for integration with CI/CD platforms:
# In your CI pipeline, use the MCP tool:
# export_sarif(target_path=".", scanner_name="semgrep", output_path="results.sarif")
# Then upload to GitHub Code Scanning:
# gh api /repos/{owner}/{repo}/code-scanning/sarifs -f sarif=@results.sarif
Compatible with: GitHub Code Scanning, GitLab SAST, Azure DevOps, VS Code SARIF Viewer.
Remote Deployment (SSE)
Run the server over HTTP/SSE for remote agent access:
# Start SSE server on port 8080
sast-mcp-server --transport sse --port 8080
# With API key authentication (recommended for production)
SAST_MCP_API_KEY=your-secret-key sast-mcp-server --transport sse --port 8080
Docker
docker build -t sast-mcp-server .
docker run -p 8080:8080 -e SAST_MCP_API_KEY=your-key sast-mcp-server --transport sse
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
SAST_MCP_TIMEOUT |
300 |
Scan timeout in seconds |
SAST_MCP_LOG_LEVEL |
INFO |
Log level: DEBUG, INFO, WARNING, ERROR |
SAST_MCP_API_KEY |
(none) | API key for SSE authentication |
Development
# Clone and install with dev dependencies
git clone https://github.com/Skyrxin/sast-mcp-server.git
cd sast-mcp-server
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Lint
ruff check sast_mcp_server/
# Run locally
python -m sast_mcp_server
Project Structure
sast_mcp_server/
├── __init__.py # Package version
├── __main__.py # python -m entry point
├── server.py # FastMCP server with all tools
├── models.py # Typed data models (Finding, Severity, etc.)
├── sarif.py # SARIF 2.1.0 export and parsing
├── aggregator.py # Multi-scanner parallel execution + deduplication
├── scanners/
│ ├── base.py # Abstract scanner base class
│ ├── factory.py # Scanner registry and factory
│ ├── bandit.py # Bandit (Python)
│ ├── njsscan.py # njsscan (JavaScript)
│ ├── bearer.py # Bearer (multi-language)
│ ├── semgrep.py # Semgrep (30+ languages)
│ ├── trivy.py # Trivy (CVEs, secrets, IaC)
│ ├── codeql.py # CodeQL (deep semantic SAST)
│ └── checkov.py # Checkov (IaC policies)
└── enrichment/
├── ast_context.py # AST-aware code context extraction
├── git_diff.py # Git diff for incremental scanning
└── ignore_manager.py # Finding ignore list management
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。