SCA-Triage MCP Server
This MCP server lets AI assistants perform deep security auditing of Java/Spring projects using ripgrep and optional ast-grep.
Search many concrete strings, methods, regexes, or built-in vulnerability profiles (e.g. deserialization, sqli, xxe, ssrf, jndi-rmi) in one ripgrep pass, with grouped results by pattern/file, line numbers, snippets, and match limits.
Analyze a Java/Spring project’s structure: find
pom.xml/build.gradle(.kts), extract Java, Spring Boot and Spring Framework versions, list key dependencies with versions/scopes, and surface config files likeapplication.ymlandapplication.properties.Assess real exploitability of vulnerable components by searching imports/usages of supplied FQCNs or keywords, grouping hits by architectural layer (controller/service/repository/test/etc.), and flagging controller/web-layer usage as
[HIGH].Use optional
ast-grepverification to discard matches found only in comments or string literals, marking candidates asast_verified,ast_rejected, ortext_onlywhen verification is unavailable.Classify files as controllers based on Spring web annotations even when the path lacks a
controllertoken, improving[HIGH]reachability detection.Run via stdio, SSE, or Streamable HTTP for integration with clients such as Cline, Claude Desktop, Cursor, Open WebUI, or Docker Compose.
Optionally resolve and clone GitLab projects by project name when GitLab environment variables are configured.
Provides security auditing tools for Java/Spring projects, including multi-pattern vulnerability searches, project structure analysis, and usage triage.
Analyzes Spring Boot projects by extracting Spring Boot versions, dependencies, and configuration files for security assessment.
Searches Spring Security configuration patterns such as SecurityFilterChain, permitAll, csrf().disable, and @PreAuthorize to identify insecure settings.
Click on "Deploy 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., "@SCA-Triage MCP Server audit this Spring Boot project for deserialization and SSRF sinks"
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.
SCA-Triage MCP Server
A powerful MCP (Model Context Protocol) server for AI assistants (Cline, Claude
Desktop, Cursor, etc.) that performs deep security auditing of Java/Spring
projects using the ripgrep (rg) utility.
The server exposes three tools that let an AI find dangerous sink methods, inventory dependencies, and assess the real exploitability of vulnerable components — without bloating the context.
Capabilities (Tools)
1. search_multi_patterns — multi-pattern search
Searches for a list of concrete strings/methods/regexes or a ready-made
vulnerability profile (e.g. deserialization) in one efficient pass through
ripgrep (multiple -e). Results are grouped by pattern and file, with line
numbers and code snippets.
Arguments:
patterns(list[str], optional) — concrete strings, methods, regexes.profile(string, optional) — a security profile (see below).path(string, optional, default.) — subdirectory to narrow the scope.max_matches(int, default500) — limit on total matches.
2. analyze_project_structure — project overview
Locates and parses pom.xml / build.gradle(.kts), extracts the Java,
Spring Boot, Spring Framework versions, key dependencies (with scope and
version) and configuration files (application.yml, application.properties).
Arguments:
project_root(string).
3. analyze_vulnerability_usage — applicability audit
Checks the real exposure of the project: searches for imports/usages of
vulnerable components and groups them by architectural layer (Controller, Service,
Repository, Test, etc.), flagging controller usages as
[HIGH] (potentially externally reachable).
Arguments:
components(list[str]orstring) — FQCN or keywords.project_root(string, optional, default.).max_matches(int, optional).
False-positive filtering. If
ast-grepis installed, matches that ripgrep found inside comments/string literals are discarded before final categorization. Each candidate receives an explicit status:ast_verified(structurally confirmed),ast_rejected(purely textual match — discarded) ortext_only(verification unavailable/timeout/error — candidate kept, but flagged as unverified). Matching is done by line and column ranges, which correctly distinguishes multiple expressions on the same line. Results are cached by(file, pattern, mtime, size).
Related MCP server: Security-Use MCP Server
Security profiles (for search_multi_patterns)
Profile | What it searches for |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Union of all profiles (broad sweep) |
Profiles can be combined with an explicit patterns list — they are merged and
deduplicated.
Installation
1. Install the ripgrep utility
OS | Command |
macOS (Homebrew) |
|
Debian / Ubuntu / Kali |
|
Fedora |
|
Arch |
|
Windows (Chocolatey) |
|
Verification:
rg --version # e.g. ripgrep 15.2.02. (Optional) Install ast-grep for false-positive filtering
ast-grep (the sg binary) is used in analyze_vulnerability_usage to discard
matches that ripgrep found inside comments and string literals — this
reduces the number of false positives. It is an optional binary installed the
same way as ripgrep. Without it, the server works as before, relying only on
ripgrep.
OS / manager | Command |
macOS (Homebrew) |
|
Linux (cargo) |
|
Linux / Windows / macOS (npm) |
|
Nix |
|
Download the binary manually | see GitHub Releases |
Verification:
ast-grep --version # or: sg --versionImportant (Linux). On Linux the
sgcommand is already taken by the systemsetgroupsutility from theutil-linuxpackage (/usr/bin/sg). Therefore, on Linux it is recommended to use the full nameast-grep, or make sure the directory containing the ast-grep binary (e.g.~/.cargo/bin) comes before/usr/bininPATH. The server can detect the systemsgand in that case correctly falls back to ripgrep. In the Docker image ast-grep is placed in/usr/local/bin(overriding/usr/bin/sg).
3. Install the Python dependencies
Python 3.10+ is required.
cd sca-triage-mcp
# (recommended) isolated environment
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt # or: pip install mcpImportant. On some distributions (Kali, Debian 12+) system Python is
protected by PEP 668. Use venv (as above) or the --break-system-packages flag.
3. Verify the server works
python server.py # runs in stdio mode (MCP clients connect on their own)Open WebUI (native MCP over HTTP)
Starting with MCP SDK 2.x the server supports a native HTTP transport
(Streamable HTTP) directly from server.py — a separate REST bridge is no longer
needed. Open WebUI connects as to a regular MCP server over HTTP.
Streamable HTTP (recommended)
python server.py --transport streamable-http --port 8000
# listens on http://127.0.0.1:8000, endpoint: /mcpFor external access (e.g. if Open WebUI runs in Docker):
python server.py --transport streamable-http --host 0.0.0.0 --port 8000In Open WebUI add the server (User settings → Tools, or the MCP servers section
of the configuration) with the URL http://<host>:8000/mcp (type — MCP over
HTTP/SSE). Both Streamable HTTP (/mcp) and legacy SSE are supported.
Additional flags:
Flag | Purpose |
| transport (default |
| address for HTTP transports (default |
| port (default |
| endpoint path (default |
| respond with JSON instead of SSE (no request back-channel) |
| disable session management |
SSE (legacy)
python server.py --transport sse --port 8000
# endpoint: /sse (messages — /messages/)Manual verification
curl -X POST http://127.0.0.1:8000/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'The response contains an mcp-session-id which must be passed in the
mcp-session-id header for subsequent requests (tools/list, tools/call).
Note about
webui_proxy.py. Thewebui_proxy.pyscript (a pure REST bridge on stdlib + an OpenAPI schema) remains in the repository as an alternative for environments that specifically need HTTP/REST without SSE. When using the native transport it is not required.
Security. The HTTP transport performs no authentication and exposes auditing of the server's filesystem. Run it on the local host (
127.0.0.1) or behind a reverse proxy with authorization.
Running via Docker Compose
A turnkey recipe for Open WebUI — docker-compose.yml starts our server in
streamable-http mode and (optionally) Open WebUI itself in a shared docker
network.
docker compose up -d --buildService | What it does |
| our MCP server (Streamable HTTP, |
| UI at |
Projects are mounted from the host directory ${SCA_PROJECTS_DIR:-~/projects}
into /projects:ro inside the container. In requests, pass
project_root="/projects/<subdir-name>".
Connecting in Open WebUI:
Type — MCP (Streamable HTTP).
URL —
http://sca-triage:8000/mcp(by service name inside the docker network).If you forwarded the port to the host —
http://localhost:8000/mcp.
Startup parameters are set via environment variables: SCA_TRANSPORT,
SCA_HOST, SCA_PORT, SCA_MCP_PATH (alias SCA_STREAMABLE_HTTP_PATH).
Resolving projects from GitLab (optional)
Instead of an explicit project_root=/projects/... you can just write the
GitLab project name in the prompt: "analyze the services/shop project". The
server will find the project via the GitLab REST API (v4) by
path_with_namespace and clone it into a temporary directory, then run the normal
pipeline (ripgrep → ast-grep → layer classification).
Required environment variables (see also .env.example):
Variable | What to set |
| self-hosted GitLab base URL, e.g. |
| Personal/Group Access Token with |
| writable directory for clones inside the container (default |
Important:
Cloning is done over HTTPS with a token; the token is masked in logs/errors.
The container must have network access to
GITLAB_URL(for a self-hosted GitLab on the internal network — a correspondingly configured docker network).If
GITLAB_URLis not set — resolution falls back to local directories (SCA_PROJECTS_DIR/ existing paths), as before.
Which directory to specify in SCA_CLONE_DIR
This is the directory writable by the process that runs server.py — the
server clones GitLab projects there. The main mistake is specifying a path that
does not exist or is not writable, which causes a PermissionError: [Errno 13]
(or No such file or directory) at clone time. Rules by scenario:
Scenario | What to set | Why |
Docker Compose (as in |
| a path inside the container, created in the image ( |
Docker with your own volume | a path mounted into the container, e.g. | the volume must be writable for |
Local run ( | any writable directory, e.g. | the process runs as your user; the directory must exist |
What not to do:
❌ don't specify a host path like
/opt/projectswhen running in Docker — such a path does not exist inside the container and the clone will fail withPermissionError;❌ don't specify an empty/nonexistent directory without creating it first (
mkdir -p <dir>) if you run without permission to create the parent;❌ don't specify a read-only directory (for example, one mounted as
:ro).
Simplest approach: leave the default value (in Docker it is already
/tmp/sca-clones; for local runs you can set any writable path). The value is
not required in .env — if SCA_CLONE_DIR is not set, the server uses
/tmp/sca-clones in all modes.
Setup in VS Code + Cline
In Cline, click the MCP Servers button in the top-right corner and add a new server, or edit the configuration file manually.
The
cline_mcp_settings.jsonfile is usually located in one of these places:~/.cline/cline_mcp_settings.json~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Add the following section (use absolute paths):
{
"mcpServers": {
"sca-triage": {
"command": "/absolute/path/to/sca-triage-mcp/.venv/bin/python",
"args": [
"/absolute/path/to/sca-triage-mcp/server.py"
],
"env": {},
"disabled": false,
"alwaysAllow": [
"search_multi_patterns",
"analyze_project_structure",
"analyze_vulnerability_usage"
]
}
}
}Windows — use the path to
python.exeinside thevenv:C:\\path\\to\\sca-triage-mcp\\.venv\\Scripts\\python.exe
Restart Cline / reconnect the server. The tool list should now include
search_multi_patterns,analyze_project_structureandanalyze_vulnerability_usage.
Example queries for a comprehensive audit
Deserialization check
Scan the project at /home/user/my-api for deserialization vulnerabilities
(the deserialization profile) and show all dangerous sink methods.search_multi_patterns(profile="deserialization", path="/home/user/my-api")Dependencies and versions overview
Analyze the structure of the project at /home/user/my-api: Java, Spring Boot
versions, key dependencies and configs.analyze_project_structure(project_root="/home/user/my-api")Applicability audit of a vulnerable component
Check whether XStream (CVE-2021-21341) is actually used in the project and how
externally reachable it is.analyze_vulnerability_usage(
components=["com.thoughtworks.xstream.XStream"],
project_root="/home/user/my-api"
)The result shows in which layers the component appears, and flags [HIGH] if it
is used in the Controller/Web/REST layers (externally reachable), or
[LOW] — if only inside services/tests.
Searching for a list of specific methods
Find occurrences of Runtime.getRuntime().exec, ProcessBuilder and Class.forName.search_multi_patterns(
patterns=["Runtime.getRuntime().exec", "ProcessBuilder", "Class.forName"],
path="/home/user/my-api"
)File structure
sca-triage-mcp/
├── server.py # main MCP server (3 tools)
├── profiles.py # vulnerability profiles and pattern sets
├── rg_runner.py # ripgrep wrapper (subprocess + --json parsing)
├── project_analyzer.py # parsing pom.xml / build.gradle and configs
├── webui_proxy.py # HTTP/REST bridge for Open WebUI (no dependencies)
├── requirements.txt # dependencies (mcp)
├── pyproject.toml # package metadata
├── cline_mcp_settings.example.json # example configuration for Cline
└── README.md # this documentationHow it works
A single
rgpass. All patterns are passed to a singleripgrepcall via multiple-e(for literals —--fixed-strings, for regexes — regular mode). This is several times faster than sequential runs.Machine-readable output.
rg --jsonis used with parsing ofmatchevents, so there is no need to parse fragile text output.Ignoring service directories.
target/,build/,.gradle/,.mvn/,.idea/,bin/,.git/,node_modules/, as well as binary artifacts (*.class,*.jar,*.zip, …) are excluded from the search.Compact output. Results are grouped by pattern → file → line (with
max_matcheslimits and truncation of long lines) so as not to overload the AI context.Clear errors. When
rgis missing the server returns installation instructions; an invalid profile/path produces a clear message listing the available profiles.False-positive filtering via
ast-grep. Used inanalyze_vulnerability_usage: for each file where ripgrep found a hit, an additionalsg --lang java --pattern ... --jsonis run (strictly file-by-file, with a 2 s timeout) and matches inside comments/string literals are discarded. ripgrep↔ast-grep matching is done by[line, column)ranges, not just the line number, so multiple expressions on the same line are distinguished correctly. Ifast-grepis unavailable, timed out, returned an error or invalid JSON, the candidate is not discarded but flagged astext_only(unverified). The output reports counters (ast_verified/ast_rejected/text_only), errors and timeouts, as well as the analysis-completeness flag (complete/incomplete). Results are cached by(file, pattern, mtime, size), and the total number of AST checks is limited by a per-tool-call budget.Code-based layer classification. The layer of a file is determined not only by its path, but also by its content: if a file contains Spring web-layer annotations (
@RestController,@Controller,@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping, plus Spring Security@PreAuthorize/@Secured/@PostAuthorizeand GraphQL/WebFlux@QueryMapping/@SchemaMapping), it is forcibly classified ascontrollerand receives the[HIGH]flag — even if there is nocontrollertoken in the path (for example, a rootApp.java). Files are read safely (utf-8,errors="replace", size limit) with an LRU cache keyed by(path, mtime, size).
License / disclaimer
The tool is intended for legitimate security auditing of your own or authorized projects. Use for unauthorized testing is prohibited and governed by applicable law.
Available Tools
3 toolsanalyze_project_structureB
Analyze a Java/Spring project: locate pom.xml / build.gradle(.kts), extract Java, Spring Boot and Spring Framework versions, list key dependencies with versions/scopes, and surface configuration files (application.yml / application.properties).
Inputs: project_root (required).
analyze_vulnerability_usageA
Assess whether vulnerable components are actually used in a project. For each component, search imports/usages (FQCN or artifact keywords), group hits by architectural layer (controller/service/test/...), and flag externally-reachable usages to help estimate real exploitability. Layers are resolved from file paths AND file contents: any file declaring @RestController/@Controller/@RequestMapping/@GetMapping/@PostMapping/@PutMapping/@DeleteMapping is treated as a controller ([HIGH]) even when its path has no web/controller token. project_root must be an absolute path to the target project.
Inputs: components (required), max_matches, project_root.
search_multi_patternsA
Run a single, efficient ripgrep pass over a Java/Spring project for a list of patterns or a named security profile (e.g. 'deserialization'). Returns matches grouped by pattern and file with line numbers and code snippets. Build/service dirs (target/, build/, .gradle/, .mvn/, .idea/, bin/) are always ignored.
Inputs: path, profile, patterns, max_matches.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct role: raw pattern search, project metadata extraction, and vulnerability-usage assessment. There is mild overlap between search_multi_patterns and analyze_vulnerability_usage, since the latter performs import/usage searches internally, but the descriptions make the boundary clear (generic grep vs. component-level exploitability triage).
All three names follow a consistent snake_case verb_noun pattern (search_multi_patterns, analyze_project_structure, analyze_vulnerability_usage). Two share the 'analyze_' prefix on distinct objects, which reads predictably.
Three well-scoped, non-trivial tools fit a focused SCA triage workflow without bloat. It is on the lean side, but each tool earns its place rather than being a thin single-purpose wrapper.
The surface covers search, build-file/dependency discovery, and usage-based exploitability assessment, but there is no way to match discovered dependencies against a vulnerability database/CVE feed, nor to emit a structured triage report or read an arbitrary file. An agent would hit dead ends when the actual CVE-to-dependency correlation is needed.
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Security scanner for AI-written code: SAST, secrets, dependencies, IaC, containers and DAST.
Deep security scans of repos you own from your editor: dependency CVEs, SAST, git-history secrets.
Threat modeling, code/cloud/pipeline scanning, shadow-AI discovery, compliance checks and fixes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered Java source code vulnerability auditing through function-level taint analysis. Performs reverse tracking from dangerous functions to external entry points to automatically discover potential security vulnerability chains.119-
- AlicenseAqualityDmaintenanceEnables AI assistants to scan project dependencies and Infrastructure as Code files for security vulnerabilities and misconfigurations. It also provides automated fixing capabilities to remediate identified security issues.183MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to understand and analyze Spring Boot codebases through static analysis, allowing natural language queries about endpoints, classes, dependencies, and architecture without running the application.13MIT
- AlicenseBqualityBmaintenanceEnables AI agents to run deterministic, fully local static security and compliance audits of code, configurations, and dependencies through 32 MCP tools covering 24 vulnerability categories. It also detects the project stack, generates risk reports and checklists, suggests stack-aware remediations, and re-validates fixes to confirm vulnerabilities were eliminated.321MIT