AI Code Scanner
MCP server that scans code for insecure LLM/AI integration patterns — client-exposed API keys, unsafe handling of model output, excessive agent tool permissions, and PII sent to third-party LLMs

@guardbee/mcp-ai-code-scanner scans your codebase for common LLM/AI integration security patterns. Where the secret scanner hunts credentials, this package hunts patterns: trust in model output, agent tool privileges, and PII sent to third-party LLMs.
What does it do?
It flags risks like OpenAI dangerouslyAllowBrowser, AI keys in NEXT_PUBLIC_ bundles, eval(llmOutput), shelling model output, unvalidated JSON.parse, unbounded agent loops, and raw user input in system prompts — each finding includes a recommendation.
Who is it for?
- Product teams shipping LLM features
- Security reviews focused on OWASP LLM Top 10 themes
- Teams adding an AI-security gate with SARIF in CI
- Developers who want this check inside Claude or Cursor
What it is not
- Full AST/semantic SAST replacement (heuristic text patterns)
- Credential leak scanning (use Secret Scanner)
- Runtime exploit verification
Features
| Feature | Description |
|---|---|
| 10 patterns / 5 categories | client-exposure, output-handling, excessive-agency, data-privacy, prompt-injection |
| Recommendations | Why it’s risky and what to do |
| SARIF 2.1.0 | GitHub Code Scanning-ready output |
| guardbee.yml | fail-on, max-files, exclude rules |
| Local scan | No Guardbee API key |
MCP tools
| Tool | Description |
|---|---|
scan_text | Scan a text/code snippet |
scan_file | Single file |
scan_directory | Directory (skips node_modules, .git, dist) |
list_patterns | List supported patterns |
Install with npm
Global install (handy for Claude Desktop / Cursor):
<code class="language-bash">npm install -g @guardbee/mcp-ai-code-scanner</code>or via npx (recommended with -y in config):
<code class="language-bash">npx -y @guardbee/mcp-ai-code-scanner</code>npm: @guardbee/mcp-ai-code-scanner
<code class="language-bash">npx @guardbee/mcp-ai-code-scanner scan ./src --fail-on=high --format=sarif > results.sarif</code>Opt out of telemetry with GUARDBEE_TELEMETRY=0.
Claude Desktop configuration
Config file paths:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Merge this block, then restart Claude Desktop:
<code class="language-json">{
"mcpServers": {
"guardbee-ai-code-scanner": {
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}</code>Cursor and other MCP clients
In Cursor, add the same command / args / env under Settings → MCP. stdio MCP servers use the same contract as Claude Desktop.
Example prompts in Claude
- “Scan this project for AI security patterns: /Users/me/my-app/src”
- “Does this React component render LLM output unsafely?”
- “Which patterns do you support? list_patterns”
Frequently asked questions
Vs Secret Scanner?+
Secret Scanner finds credentials; AI Code Scanner finds LLM integration anti-patterns. Complementary.
False positives?+
Heuristic — designed for low FP, still review findings manually.
API key?+
No — fully local/filesystem.
More in this category
@guardbee/mcp-dependency-auditor
Dependency Auditor
Dependency vulnerability scanner (OSV) for npm and pip manifests, with single-package lookups for PyPI, crates.io, Maven, Go and RubyGems; CLI and MCP server
Learn more@guardbee/mcp-reverse-shield
Reverse Shield
MCP server that audits shipped apps for how easily they can be reverse engineered — exposed source maps, missing minification/R8/.NET obfuscation, debug info and unstripped symbols, debuggable flags, Electron fuses, unsigned binaries and embedded secrets across web bundles, Electron, Android APK/AAB, iOS IPA, Unity, PyInstaller, Java and native/.NET binaries — with baselines for CI and build-config fix suggestions
Learn more@guardbee/mcp-secret-scanner
Secret Scanner
Secret scanner for code, git history and AI agent transcripts: 76 provider patterns, entropy checks, live key verification and SARIF, as a CLI and an MCP server
Learn more@guardbee/mcp-security-engineer
Security Engineer Bridge
MCP server that lets your coding agent (Claude Code, Cursor) fix GuardBee AI Security Engineer findings in your own repository and verify the fixes
Learn more@guardbee/mcp-slopsquat-scanner
Slopsquat Scanner
MCP server that checks every dependency declared in package.json/requirements.txt/pyproject.toml against the real npm/PyPI registry -- flags names that don't exist at all (likely LLM-hallucinated dependencies an attacker may have pre-registered, i.e. slopsquatting) and names that exist but were only very recently published
Learn more
See your security posture in minutes
Add your domain, run a read-only scan and get a prioritised list of fixes. No installation required.