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. Scan any repo and get an A-F agent security grade: Install the scanner into your AI coding client: Replace claude-code with cursor, claude-desktop, windsurf, cline, kilo-code, opencod
npx mdskills install sinewaveai/agent-security-scanner-mcp@sinewaveai? Sign in with GitHub to claim this listing.Comprehensive security scanner detecting AI-specific risks across code, prompts, MCP servers, and packages.
1<div align="center">23<img src="./prooflayer-logo.png" alt="ProofLayer" width="360"/>45# agent-security-scanner-mcp67**Security scanner for AI coding agents, MCP servers, prompts, and AI-suggested packages.**89Run it before Claude Code, Cursor, Windsurf, Cline, OpenCode, or another agent trusts new code, tools, prompts, or dependencies.1011[](https://www.npmjs.com/package/agent-security-scanner-mcp)12[](https://www.npmjs.com/package/agent-security-scanner-mcp)13[](LICENSE)14[](https://github.com/sinewaveai/agent-security-scanner-mcp/actions/workflows/test.yml)1516</div>1718## Copy-Paste Start1920Scan any repo and get an A-F agent security grade:2122```bash23npx agent-security-scanner-mcp scan-project . --verbosity compact24```2526Install the scanner into your AI coding client:2728```bash29npx agent-security-scanner-mcp init claude-code30```3132Replace `claude-code` with `cursor`, `claude-desktop`, `windsurf`, `cline`, `kilo-code`, `opencode`, or `cody`.3334Audit an MCP server before adding it to an agent:3536```bash37npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact38```3940Check AI-generated imports for package hallucinations:4142```bash43npx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact44```4546## What It Catches4748| Risk | Why agents need it | Command |49| --- | --- | --- |50| Vulnerable generated code | Agents can introduce SQL injection, XSS, command injection, unsafe crypto, and secrets | `scan-project`, `scan-security`, `scan-diff` |51| MCP server attacks | MCP tools can poison descriptions, spoof names, exfiltrate env vars, or execute commands | `scan-mcp` |52| Prompt injection | Agents often process untrusted docs, tickets, pages, and tool output | `scan-prompt` |53| Unsafe agent actions | Catch dangerous shell/file/network actions before execution | `scan-action` |54| Hallucinated packages | AI often invents dependency names that attackers can later squat | `check-package`, `scan-packages` |55| SBOM and CVEs | Generate CycloneDX SBOMs and scan dependencies with OSV.dev | `sbom-generate`, `sbom-vulnerabilities` |56| Semantic review | LLM-powered review that uses project intent to find context-aware issues | `cr-agent` |5758## Screenshots5960### Project Scan61626364### MCP Server Audit65666768### Package Hallucination Detection69707172## Demos7374Run a safe local demo that creates intentionally vulnerable fixtures, scans them, and cleans them up.7576```bash77# MCP audit demo: tool poisoning, spoofed tool name, command execution, secret exposure78npx agent-security-scanner-mcp demo --type mcp --no-prompt7980# Package hallucination demo: real imports mixed with fake AI-generated package names81npx agent-security-scanner-mcp demo --type packages --no-prompt82```8384Expected demo shape:8586```json87{88 "grade": "F",89 "findings_count": 8,90 "findings": [91 {92 "rule": "mcp.description-injection",93 "severity": "ERROR",94 "message": "Tool description contains imperative language directed at the LLM."95 },96 {97 "rule": "mcp.tool-name-spoofing",98 "severity": "ERROR",99 "message": "Tool name is close to a well-known MCP tool name."100 }101 ]102}103```104105## Install In Your Agent106107```bash108npx agent-security-scanner-mcp init claude-code109```110111| Client | Setup |112| --- | --- |113| Claude Code | `npx agent-security-scanner-mcp init claude-code` |114| Cursor | `npx agent-security-scanner-mcp init cursor` |115| Claude Desktop | `npx agent-security-scanner-mcp init claude-desktop` |116| Windsurf | `npx agent-security-scanner-mcp init windsurf` |117| Cline | `npx agent-security-scanner-mcp init cline` |118| Kilo Code | `npx agent-security-scanner-mcp init kilo-code` |119| OpenCode | `npx agent-security-scanner-mcp init opencode` |120| Cody | `npx agent-security-scanner-mcp init cody` |121| Interactive picker | `npx agent-security-scanner-mcp init` |122123Then restart the client. Your agent can call the scanner as an MCP tool.124125## Agent Playbook126127Paste this into an agent task when you want it to work safely:128129```text130Before trusting new code, dependencies, prompts, or MCP tools, run:1311321. npx agent-security-scanner-mcp scan-project . --verbosity compact1332. npx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact when imports change1343. npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact before adding MCP servers1354. npx agent-security-scanner-mcp scan-diff --base main --target HEAD before opening a PR136137Fix high-confidence security findings before continuing.138```139140## Common Workflows141142### Before You Trust An Agent-Written PR143144```bash145npx agent-security-scanner-mcp scan-diff --base main --target HEAD --verbosity compact146npx agent-security-scanner-mcp scan-packages ./src/app.ts npm --verbosity compact147```148149### Before Installing An MCP Server150151```bash152npx agent-security-scanner-mcp scan-mcp ./path/to/mcp-server --verbosity compact153```154155### Before Adding A Dependency Suggested By AI156157```bash158npx agent-security-scanner-mcp check-package express npm159npx agent-security-scanner-mcp scan-packages ./package.json npm --verbosity compact160```161162### Add CI163164```bash165npx agent-security-scanner-mcp init-ci github166```167168### Generate Share Copy From A Real Scan169170```bash171npx agent-security-scanner-mcp scan-project . --verbosity compact > scan-result.json172npx agent-security-scanner-mcp share-kit --scan-result scan-result.json --output share-kit.md173```174175## CLI Reference176177| Command | Use |178| --- | --- |179| `scan-project <dir>` | Full project scan with A-F grade |180| `scan-security <file>` | Single-file security scan |181| `scan-diff --base main --target HEAD` | Scan changed files only |182| `scan-mcp <path>` | Audit an MCP server before install |183| `scan-prompt "<text>"` | Detect prompt injection and jailbreak attempts |184| `scan-action <type> <value>` | Pre-execution safety check for shell/file/network actions |185| `check-package <name> <ecosystem>` | Verify one package exists |186| `scan-packages <file> <ecosystem>` | Verify imports/dependencies in a file |187| `doctor` | Check local setup health |188| `quickstart --client cursor` | Generate repo-specific next steps |189| `share-kit` | Generate public-safe launch/share copy |190| `export-vanta` | Export scan evidence to the ProofLayer Vanta integration |191192All scanner outputs support context-friendly verbosity:193194```bash195--verbosity minimal # counts only, best for CI196--verbosity compact # default, best for agents and humans197--verbosity full # audit/debug detail198```199200## MCP Tools For Agents201202When installed as an MCP server, agents get these tool families:203204| Tool family | Purpose |205| --- | --- |206| `scan_security`, `fix_security`, `scan_git_diff`, `scan_project` | Code and repo security |207| `scan_mcp_server`, `scan_skill` | MCP and AI skill security |208| `scan_agent_prompt`, `scan_agent_action` | Prompt/action safety |209| `check_package`, `scan_packages` | Package hallucination detection |210| `sbom_generate`, `sbom_scan_vulnerabilities`, `sbom_diff`, `sbom_export_report` | Supply-chain and release evidence |211| `get_compliance_controls`, `evaluate_compliance` | SOC2/GDPR/AIUC-1 technical evidence |212| `scanner_health` | Runtime diagnostics |213214## Why Developers Install It215216- One `npx` command gives an A-F security grade for AI-written code.217- MCP-specific checks catch risks that normal SAST tools miss.218- Package hallucination detection checks 4.3M+ package names across npm, PyPI, RubyGems, crates.io, pub.dev, CPAN, and raku.land.219- Output is compact by default so coding agents can read it without burning the context window.220- Works as a CLI, MCP server, GitHub Action workflow, Apify Actor, and semantic review agent.221- MIT licensed.222223## Semantic Code Review224225`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.226227```bash228npx cr-agent analyze ./path/to/project -p claude-cli --verbose229npx cr-agent analyze ./path/to/project -p openai --format sarif230```231232Use 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?"233234## SBOM And Compliance Evidence235236```bash237npx agent-security-scanner-mcp sbom-generate .238npx agent-security-scanner-mcp sbom-vulnerabilities .239npx agent-security-scanner-mcp sbom-check-hallucinations .240npx agent-security-scanner-mcp evaluate-compliance . --framework soc2-technical241```242243Useful before releases, SOC 2 evidence collection, vendor reviews, and AI-generated dependency changes.244245## Apify Actor246247Run the scanner as an Apify Actor when you want a hosted API or scheduled scans:248249```json250{251 "actorId": "folkloric_morale/agent-security-scanner",252 "input": {253 "target": "repository",254 "repoUrl": "https://github.com/your-org/your-agent.git",255 "repositoryScanMode": "quick",256 "includeTestFiles": false,257 "maxRepositoryFiles": 150,258 "severityThreshold": "medium"259 }260}261```262263## Latest Release264265`v4.5.5` reduces Dockerfile scan noise: `chmod 755` no longer reports as dangerous, while world-writable and setuid/setgid modes still flag. The latest product loop reports `0.9463` precision and a `0.0530` false-positive rate.266267Detailed release history lives in [CHANGELOG.md](./CHANGELOG.md). The older README-embedded changelog is archived at [archive/README_CHANGELOG_ARCHIVE.md](./archive/README_CHANGELOG_ARCHIVE.md).268269## FAQ270271**Is this only for MCP servers?**272No. It scans normal repos, diffs, prompts, actions, packages, SBOMs, MCP servers, and AI skills.273274**Does it send my source code anywhere?**275Rule-based CLI and MCP scans are local. `cr-agent` uses the provider you choose for semantic review.276277**Is it a replacement for npm audit?**278No. It complements npm audit by catching AI-specific risks: hallucinated packages, prompt injection, MCP tool poisoning, unsafe agent actions, and vulnerable generated code.279280**What should I run first?**281Run `npx agent-security-scanner-mcp scan-project . --verbosity compact`.282283## Links284285- [npm package](https://www.npmjs.com/package/agent-security-scanner-mcp)286- [GitHub issues](https://github.com/sinewaveai/agent-security-scanner-mcp/issues)287- [Full changelog](./CHANGELOG.md)288- [Code review agent docs](./code-review-agent/README.md)289290## License291292MIT293
Full transparency — inspect the skill content before installing.