Guardbee.ai
@guardbee/mcp-ai-code-scanner

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

v0.5.1MIT · Open sourceNode.js · stdio
Install
$ npx -y @guardbee/mcp-ai-code-scanner
Claude Desktop / Cursor config
{
  "mcpServers": {
    "ai-code-scanner": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-ai-code-scanner"
      ]
    }
  }
}
@guardbee/mcp-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

FeatureDescription
10 patterns / 5 categoriesclient-exposure, output-handling, excessive-agency, data-privacy, prompt-injection
RecommendationsWhy it’s risky and what to do
SARIF 2.1.0GitHub Code Scanning-ready output
guardbee.ymlfail-on, max-files, exclude rules
Local scanNo Guardbee API key

MCP tools

ToolDescription
scan_textScan a text/code snippet
scan_fileSingle file
scan_directoryDirectory (skips node_modules, .git, dist)
list_patternsList supported patterns

Install with npm

Global install (handy for Claude Desktop / Cursor):

bash
<code class="language-bash">npm install -g @guardbee/mcp-ai-code-scanner</code>

or via npx (recommended with -y in config):

bash
<code class="language-bash">npx -y @guardbee/mcp-ai-code-scanner</code>

npm: @guardbee/mcp-ai-code-scanner

CLI
<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:

claude_desktop_config.json
<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

  1. “Scan this project for AI security patterns: /Users/me/my-app/src”
  2. “Does this React component render LLM output unsafely?”
  3. “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

See your security posture in minutes

Add your domain, run a read-only scan and get a prioritised list of fixes. No installation required.

AI Code Scanner MCP server (@guardbee/mcp-ai-code-scanner) · GuardBee