Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/skillspector/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from skillspector.constants import RISK_THRESHOLD
from skillspector.graph import graph
from skillspector.logging_config import get_logger, set_level
from skillspector.mcp_registry import scan_registry
from skillspector.multi_skill import MultiSkillDetectionResult, detect_skills
from skillspector.suppression import build_baseline_dict, dump_baseline, load_baseline

Expand Down Expand Up @@ -253,6 +254,13 @@ def scan(
help="Show detailed progress.",
),
] = False,
mcp_registry: Annotated[
bool,
typer.Option(
"--mcp-registry",
help="Scan an MCP Registry payload or URL instead of a skill.",
),
] = False,
) -> None:
"""
Scan a skill for security vulnerabilities.
Expand Down Expand Up @@ -284,6 +292,33 @@ def scan(
chain when unset; AWS_REGION default: us-west-2)
NVIDIA_INFERENCE_KEY for the NVIDIA providers
"""
if mcp_registry:
if recursive or baseline is not None or show_suppressed or yara_rules_dir is not None:
console.print(
"[red]Error:[/red] --mcp-registry cannot be combined with "
"--recursive, --baseline, --show-suppressed, or --yara-rules-dir"
)
raise typer.Exit(code=2)
if format != FormatChoice.json:
console.print("[red]Error:[/red] --mcp-registry currently supports only --format json")
raise typer.Exit(code=2)
try:
result = scan_registry(input_path)
report = json.dumps(result, indent=2)
if output:
output.write_text(report, encoding="utf-8")
console.print(f"Report saved to: {output}")
else:
print(report)
if result["risk_score"] > RISK_THRESHOLD:
raise typer.Exit(code=1)
except typer.Exit:
raise
except Exception as e:
console.print(f"[red]Error:[/red] {e}")
raise typer.Exit(code=2) from e
return

if verbose:
set_level("DEBUG")

Expand Down
Loading