# ai-code-scanner MCP server

> Scans codebases for security risks in LLM integrations, including prompt injection, data privacy leaks, and unsafe output handling.

- Repository: https://github.com/GuardBee/guardbee-mcp
- Page: https://hostedmcp.org/servers/guardbee/ai-code-scanner-d0dbd7
- Transport: stdio
- Stars: 2
- License: MIT
- Latest version: 0.5.1

## Install

### Claude Code

```sh
claude mcp add ai-code-scanner-d0dbd7 -- npx -y @guardbee/mcp-ai-code-scanner
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "ai-code-scanner-d0dbd7": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-ai-code-scanner"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "ai-code-scanner-d0dbd7": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-ai-code-scanner"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"ai-code-scanner-d0dbd7","type":"stdio","command":"npx","args":["-y","@guardbee/mcp-ai-code-scanner"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "ai-code-scanner-d0dbd7": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-ai-code-scanner"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add ai-code-scanner-d0dbd7 -- npx -y @guardbee/mcp-ai-code-scanner
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.ai-code-scanner-d0dbd7]
command = "npx"
args = ["-y", "@guardbee/mcp-ai-code-scanner"]
```

### Gemini CLI

```sh
gemini mcp add -s user ai-code-scanner-d0dbd7 npx -- -y @guardbee/mcp-ai-code-scanner
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "ai-code-scanner-d0dbd7": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-ai-code-scanner"
      ]
    }
  }
}
```

## Tools (4)

- `scan_text`: Scan a text string or code snippet for insecure AI/LLM integration patterns (client-exposed keys, unsafe output handling, excessive agent tool permissions, PII sent to a model, prompt injection surface).
- `scan_file`: Scan a single file for insecure AI/LLM integration patterns
- `scan_directory`: Recursively scan a directory for insecure AI/LLM integration patterns. Automatically skips node_modules, .git, dist, and binary files.
- `list_patterns`: List all AI/LLM security patterns that the scanner can detect, grouped by category (including any custom rules loaded from .guardbee/rules)

## FAQ

### What kind of security risks does it detect?

It identifies patterns like client-side API key exposure, unsafe execution of model output, excessive agent agency, PII in prompts, and prompt injection vulnerabilities.

### Can I add my own security rules?

Yes, you can extend detection with organization-specific patterns by adding JSON files to a configured rules directory.

### Does the scanner send my private code to a server?

Telemetry is turned off by default. If enabled, it only sends metadata like tool success and duration, replacing sensitive content with placeholders.

### Is this a full AST analysis?

No, the findings are heuristic-based static text-pattern scans designed for a low false-positive rate.
