Agent Security Scanner Mcp

io.github.sinewaveaiPublished by GitHub account sinewaveaiv2.0.1Updated Oct 24, 2026

Security layer for AI agents: blocks prompt injection, detects fake packages, scans vulnerabilities.

Overview

AI-generated overview

Local security scanner that checks AI-written code, prompts, MCP servers, and suggested packages for vulnerabilities and injection risks.

What you can do
Runs rule-based scans over a project, a diff, a single file, a prompt, or an MCP server and returns findings with an A-F grade. Tool families cover code and repo security, MCP and skill auditing, prompt and action safety, package hallucination detection, SBOM generation and vulnerability checks, and compliance evidence. An optional bundled semantic review agent uses an LLM provider to look for context-aware issues.
When to use it
Use it before trusting code, dependencies, prompts, or MCP tools produced or suggested by an AI agent, and before opening a pull request or adding a new MCP server. It complements rather than replaces tools like npm audit.
Requirements
Runs locally as an npm package over stdio; Node.js and npx are needed. No accounts, API keys, or environment variables are declared. The optional semantic review agent requires a chosen LLM provider (for example a CLI or OpenAI) and sends code to that provider.
Before you install
Rule-based CLI and MCP scans are described as local, but the bundled semantic review agent sends code to the LLM provider you select. Scans read project files and repository history, and some commands write output files such as scan results and share copy. Review what is sent before enabling semantic review on private code.

Installation

In SourceWeft

  1. Open Agent Security Scanner Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

[ProofLayer]

agent-security-scanner-mcp

Security scanner for AI coding agents, MCP servers, prompts, and AI-suggested packages.

Run it before Claude Code, Cursor, Windsurf, Cline, OpenCode, or another agent trusts new code, tools, prompts, or dependencies.

[npm downloads] [npm version] [License: MIT] [CI]

Copy-Paste Start

Scan any repo and get an A-F agent security grade:

bash
npx agent-security-scanner-mcp scan-project . --verbosity compact

Install the scanner into your AI coding client:

bash
npx agent-security-scanner-mcp init claude-code

Replace claude-code with cursor, claude-desktop, windsurf, cline, kilo-code, opencode, or cody.

Audit an MCP server before adding it to an agent:

bash
npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact

Check AI-generated imports for package hallucinations:

bash
npx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact

What It Catches

RiskWhy agents need itCommand
Vulnerable generated codeAgents can introduce SQL injection, XSS, command injection, unsafe crypto, and secretsscan-project, scan-security, scan-diff
MCP server attacksMCP tools can poison descriptions, spoof names, exfiltrate env vars, or execute commandsscan-mcp
Prompt injectionAgents often process untrusted docs, tickets, pages, and tool outputscan-prompt
Unsafe agent actionsCatch dangerous shell/file/network actions before executionscan-action
Hallucinated packagesAI often invents dependency names that attackers can later squatcheck-package, scan-packages
SBOM and CVEsGenerate CycloneDX SBOMs and scan dependencies with OSV.devsbom-generate, sbom-vulnerabilities
Semantic reviewLLM-powered review that uses project intent to find context-aware issuescr-agent

Screenshots

Project Scan

[Project scan demo]

MCP Server Audit

[MCP audit demo]

Package Hallucination Detection

[Package hallucination demo]

Demos

Run a safe local demo that creates intentionally vulnerable fixtures, scans them, and cleans them up.

bash
# MCP audit demo: tool poisoning, spoofed tool name, command execution, secret exposurenpx agent-security-scanner-mcp demo --type mcp --no-prompt
# Package hallucination demo: real imports mixed with fake AI-generated package namesnpx agent-security-scanner-mcp demo --type packages --no-prompt

Expected demo shape:

json
{  "grade": "F",  "findings_count": 8,  "findings": [    {      "rule": "mcp.description-injection",      "severity": "ERROR",      "message": "Tool description contains imperative language directed at the LLM."    },    {      "rule": "mcp.tool-name-spoofing",      "severity": "ERROR",      "message": "Tool name is close to a well-known MCP tool name."    }  ]}

Install In Your Agent

bash
npx agent-security-scanner-mcp init claude-code
ClientSetup
Claude Codenpx agent-security-scanner-mcp init claude-code
Cursornpx agent-security-scanner-mcp init cursor
Claude Desktopnpx agent-security-scanner-mcp init claude-desktop
Windsurfnpx agent-security-scanner-mcp init windsurf
Clinenpx agent-security-scanner-mcp init cline
Kilo Codenpx agent-security-scanner-mcp init kilo-code
OpenCodenpx agent-security-scanner-mcp init opencode
Codynpx agent-security-scanner-mcp init cody
Interactive pickernpx agent-security-scanner-mcp init

Then restart the client. Your agent can call the scanner as an MCP tool.

Agent Playbook

Paste this into an agent task when you want it to work safely:

text
Before trusting new code, dependencies, prompts, or MCP tools, run:
1. npx agent-security-scanner-mcp scan-project . --verbosity compact2. npx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact when imports change3. npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact before adding MCP servers4. npx agent-security-scanner-mcp scan-diff --base main --target HEAD before opening a PR
Fix high-confidence security findings before continuing.

Common Workflows

Before You Trust An Agent-Written PR

bash
npx agent-security-scanner-mcp scan-diff --base main --target HEAD --verbosity compactnpx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact

Before Installing An MCP Server

bash
npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact

Before Adding A Dependency Suggested By AI

bash
npx agent-security-scanner-mcp check-package express npmnpx agent-security-scanner-mcp scan-packages ./package.json npm --verbosity compact

Add CI

bash
npx agent-security-scanner-mcp init-ci github

Generate Share Copy From A Real Scan

bash
npx agent-security-scanner-mcp scan-project . --verbosity compact > scan-result.jsonnpx agent-security-scanner-mcp share-kit --scan-result scan-result.json --output share-kit.md

CLI Reference

CommandUse
scan-project <dir>Full project scan with A-F grade
scan-security <file>Single-file security scan
scan-diff --base main --target HEADScan changed files only
scan-mcp <path>Audit an MCP server before install
scan-prompt "<text>"Detect prompt injection and jailbreak attempts
scan-action <type> <value>Pre-execution safety check for shell/file/network actions
check-package <name> <ecosystem>Verify one package exists
scan-packages <file> <ecosystem>Verify imports/dependencies in a file
doctorCheck local setup health
quickstart --client cursorGenerate repo-specific next steps
share-kitGenerate public-safe launch/share copy
export-vantaExport scan evidence to the ProofLayer Vanta integration

All scanner outputs support context-friendly verbosity:

bash
--verbosity minimal   # counts only, best for CI--verbosity compact   # default, best for agents and humans--verbosity full      # audit/debug detail

MCP Tools For Agents

When installed as an MCP server, agents get these tool families:

Tool familyPurpose
scan_security, fix_security, scan_git_diff, scan_projectCode and repo security
scan_mcp_server, scan_skillMCP and AI skill security
scan_agent_prompt, scan_agent_actionPrompt/action safety
check_package, scan_packagesPackage hallucination detection
sbom_generate, sbom_scan_vulnerabilities, sbom_diff, sbom_export_reportSupply-chain and release evidence
get_compliance_controls, evaluate_complianceSOC2/GDPR/AIUC-1 technical evidence
scanner_healthRuntime diagnostics

Why Developers Install It

  • One npx command gives an A-F security grade for AI-written code.
  • MCP-specific checks catch risks that normal SAST tools miss.
  • Package hallucination detection checks 4.3M+ package names across npm, PyPI, RubyGems, crates.io, pub.dev, CPAN, and raku.land.
  • Output is compact by default so coding agents can read it without burning the context window.
  • Works as a CLI, MCP server, GitHub Action workflow, Apify Actor, and semantic review agent.
  • MIT licensed.

Semantic Code Review

cr-agent is bundled with the npm package for LLM-powered semantic review. It reads project intent, then looks for code that violates that intent.

bash
npx cr-agent analyze ./path/to/project -p claude-cli --verbosenpx cr-agent analyze ./path/to/project -p openai --format sarif

Use it when rule-based scanning is not enough and the question is, "Does this code make sense for what this project is supposed to do?"

SBOM And Compliance Evidence

bash
npx agent-security-scanner-mcp sbom-generate .npx agent-security-scanner-mcp sbom-vulnerabilities .npx agent-security-scanner-mcp sbom-check-hallucinations .npx agent-security-scanner-mcp evaluate-compliance . --framework soc2-technical

Useful before releases, SOC 2 evidence collection, vendor reviews, and AI-generated dependency changes.

Apify Actor

Run the scanner as an Apify Actor when you want a hosted API or scheduled scans:

json
{  "actorId": "folkloric_morale/agent-security-scanner",  "input": {    "target": "repository",    "repoUrl": "https://github.com/your-org/your-agent.git",    "repositoryScanMode": "quick",    "includeTestFiles": false,    "maxRepositoryFiles": 150,    "severityThreshold": "medium"  }}

Latest Release

v4.5.8 adds diff-scoped cr-agent semantic review, fixes nested repository diff lookups, and filters semantic findings to changed hunks so PR reviews stay focused on code that actually changed.

Detailed release history lives in CHANGELOG.md. The older README-embedded changelog is archived at archive/README_CHANGELOG_ARCHIVE.md.

FAQ

Is this only for MCP servers? No. It scans normal repos, diffs, prompts, actions, packages, SBOMs, MCP servers, and AI skills.

Does it send my source code anywhere? Rule-based CLI and MCP scans are local. cr-agent uses the provider you choose for semantic review.

Is it a replacement for npm audit? No. It complements npm audit by catching AI-specific risks: hallucinated packages, prompt injection, MCP tool poisoning, unsafe agent actions, and vulnerable generated code.

What should I run first? Run npx agent-security-scanner-mcp scan-project . --verbosity compact.

Links

License

MIT

Source: README.md at commit ef3f20e

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v2.0.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts