MCP guide · AI Code Scanner

@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):
npm install -g @guardbee/mcp-ai-code-scanneror via npx (recommended with -y in config):
npx -y @guardbee/mcp-ai-code-scannerCLI: npx @guardbee/mcp-ai-code-scanner scan ./src --fail-on=high --format=sarif > results.sarif. 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:
{
"mcpServers": {
"guardbee-ai-code-scanner": {
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}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”
Related links
See surface risk with Guardbee
MCP servers speed up security work in chat. Start a 14-day free trial for brand scans and BeeAI.
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.