LLMやAI統合におけるプロンプトインジェクション、データプライバシーの漏洩、不適切な出力処理などのセキュリティ脆弱性をコードベースからスキャンします。
別名 GuardBee/guardbee-mcp, @guardbee/mcp-ai-code-scanner
- スター
- 2
- ツール
- 4
- ダウンロード数(30日間)
- 1,842
- 最新バージョン
- 0.3.2
- 最終コミット
- 2026年11月12日
- ライセンス
- MIT
ai-code-scanner MCPとは
ai-code-scannerはMCPサーバーです。 LLMやAI統合におけるプロンプトインジェクション、データプライバシーの漏洩、不適切な出力処理などのセキュリティ脆弱性をコードベースからスキャンします。. 4個のツールを提供しており、scan_text, scan_file, scan_directoryなどがあります。
プロジェクトのREADMEから生成された概要
ai-code-scanner MCP server について
このMCP serverの主な機能は、コードベースをスキャンして特定の脆弱性パターンを特定し、AI統合のセキュリティを確保することです。標準的なシークレットスキャナーが見逃しがちな、プロンプトインジェクション、データプライバシーの漏洩、不適切な出力処理などのリスクを開発者が特定するのに役立ちます。このツールは、モデルの出力がどの程度信頼されているか、およびエージェントが呼び出すことができるツールの権限レベルに焦点を当てています。
ユーザーは、Claude Desktopを通じてローカルで実行するか、CI/CD統合のためにCLI経由で実行できます。スニペット用の scan_text、個別のファイル用の scan_file、再帰的なコードベース分析用の scan_directory といった特定のツールを提供します。また、サポートされているすべての検出カテゴリを表示するための list_patterns ツールも含まれています。
このスキャナーは、guardbee.yml 設定ファイルや、JSONファイルを使用したカスタムルールパックの追加によって、高度なカスタマイズが可能です。これにより、チームは機密データや社内ツールに関する組織固有のパターンを定義できます。検出結果は具体的な推奨事項とともに報告され、GitHub Code Scanningで使用するためにSARIF 2.1.0形式でエクスポートすることも可能です。
できること
- 1プロンプトインジェクションのリスク検出ユーザー入力がシステムプロンプトに不適切に混入していないか、AIに確認させます。
- 2機密データの漏洩防止メールアドレスなどの個人識別情報がLLMに直接送信されていないか、コードベースをスキャンします。
- 3エージェントのツール権限の監査AIエージェントが利用可能なツールに、シェル実行のような過剰な制御権限が付与されていないかを確認します。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
ai-code-scanner MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude Codeにai-code-scanner MCPをインストール
$ claude mcp add ai-code-scanner -- npx -y @guardbee/mcp-ai-code-scannerCursorにai-code-scanner MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"ai-code-scanner": {
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}VS Codeにai-code-scanner MCPをインストール
.vscode/mcp.json
{
"servers": {
"ai-code-scanner": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}VS Code CLIにai-code-scanner MCPをインストール
$ code --add-mcp '{"name":"ai-code-scanner","type":"stdio","command":"npx","args":["-y","@guardbee/mcp-ai-code-scanner"]}'Claude Desktopにai-code-scanner MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"ai-code-scanner": {
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}Codexにai-code-scanner MCPをインストール
$ codex mcp add ai-code-scanner -- npx -y @guardbee/mcp-ai-code-scannerCodex config.tomlにai-code-scanner MCPをインストール
~/.codex/config.toml
[mcp_servers.ai-code-scanner] command = "npx" args = ["-y", "@guardbee/mcp-ai-code-scanner"]
Gemini CLIにai-code-scanner MCPをインストール
$ gemini mcp add -s user ai-code-scanner npx -- -y @guardbee/mcp-ai-code-scannerGemini settings.jsonにai-code-scanner MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"ai-code-scanner": {
"command": "npx",
"args": [
"-y",
"@guardbee/mcp-ai-code-scanner"
]
}
}
}ai-code-scanner MCPツール 4
READMEから検出scan_textscan_filescan_directorylist_patterns
| scan_text | — | |
| scan_file | — | |
| scan_directory | — | |
| list_patterns | — |
自動チェック
実行日 2026年11月13日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能合格
- オープンソースライセンス (OSI)合格
- 過去1年以内にコミットまたはリリースあり合格
- パッケージ名が有名なパッケージに酷似していない合格
- リモートエンドポイントがHTTPSを使用未チェック
- 破壊的なツールがラベル付けされている合格
- モデルへの隠れた指示がない合格
- パッケージおよびその依存関係に重大な勧告なし合格
README
GitHubで見る@guardbee/mcp-ai-code-scanner
🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch
An MCP (Model Context Protocol) server that scans your codebase for security patterns commonly found in LLM/AI integrations.
While secret-scanner looks for leaked secrets/API keys, this package looks for patterns: how much a model's output is trusted, how privileged the tools it can call are, what data is sent to a third-party LLM — risks that a static credential scan can't catch.
Telemetry is off by default. With
GUARDBEE_TELEMETRY=1it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields likecontent,tokenorpasswordare replaced with a placeholder. See@guardbee/mcp-telemetry.
Claude ──► ai-code-scanner ──► Your codebase
│
├─ Client-exposure (dangerouslyAllowBrowser: true)
├─ Output handling (eval(llmOutput), unvalidated JSON.parse)
├─ Excessive agency (an agent tool named execute_command)
├─ Data privacy (email/national ID interpolated directly into a prompt)
└─ Prompt injection (raw request data mixed into a system prompt)
Features
- 10 patterns, 5 categories — client-exposure, output-handling, excessive-agency, data-privacy, prompt-injection
- Every finding includes why it's risky and what to do about it (
recommendation) — not just "found it" - SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
- Config file support via
guardbee.yml - Custom rule packs — extend detection with org-specific patterns (KVKK/GDPR field names, internal tool names) via JSON files, no fork required
- 36 unit tests — a positive and a negative (false-positive) scenario for every built-in pattern, plus custom-rule loading/validation
Quick Start
Claude Desktop / MCP Client
{
"mcpServers": {
"guardbee-ai-code-scanner": {
"command": "npx",
"args": ["-y", "@guardbee/mcp-ai-code-scanner"]
}
}
}
CLI (CI/CD)
npx @guardbee/mcp-ai-code-scanner scan ./src --fail-on=high --format=sarif > results.sarif
MCP Tools
| Tool | Description |
|---|---|
scan_text |
Scans a given text/code snippet |
scan_file |
Scans a single file |
scan_directory |
Recursively scans a directory (node_modules, .git, dist skipped automatically) |
list_patterns |
Lists all supported patterns by category |
Detected Patterns
| Category | Pattern | Severity | What it means |
|---|---|---|---|
| client-exposure | openai_dangerously_allow_browser |
critical | OpenAI key leaked to the browser |
| client-exposure | client_bundled_ai_api_key |
critical | An AI key enters the client bundle via NEXT_PUBLIC_/VITE_/REACT_APP_ |
| output-handling | eval_llm_output |
critical | Model output executed as code via eval()/Function() |
| output-handling | exec_llm_output |
critical | Model output passed to a shell command (command injection) |
| output-handling | llm_output_dangerously_set_inner_html |
high | Model output rendered as raw HTML (XSS) |
| output-handling | llm_json_no_validation |
medium | Model output JSON.parse'd without schema validation |
| excessive-agency | excessive_agency_tool_name |
high | A tool that grants an agent shell/code execution |
| excessive-agency | unbounded_agent_loop |
medium | An agent loop with no iteration bound (cost/DoS) |
| data-privacy | pii_field_in_llm_prompt |
high | Data like email/national ID/card number goes directly into a prompt |
| prompt-injection | unsanitized_input_in_system_prompt |
medium | Raw request/user data mixed into a system prompt |
These are heuristic findings — a static text-pattern scan, not a full AST analysis. Designed for a low false-positive rate, but every finding should still be reviewed manually.
Configuration (guardbee.yml)
ai-code-scanner:
fail-on: high # any | critical | high | medium | low | none
max-files: 5000
rules-dir: .guardbee/rules # custom rule packs, see below
exclude:
- ".test.ts"
- "fixtures/"
Custom rules
Built-in patterns cover common AI/LLM integration mistakes, but field names and
internal conventions (e.g. which prop names carry KVKK-regulated data) are
project-specific. Drop one or more JSON files into .guardbee/rules/
(configurable via rules-dir) and they're merged with the built-ins at scan
time — for both the CLI and the MCP server (list_patterns marks them (custom)).
A file holds a single rule object or an array of them:
{
"id": "kvkk_musteri_tc_no",
"name": "musteriTcNo interpolated into a prompt",
"category": "data-privacy",
"pattern": "musteriTcNo",
"flags": "gi",
"severity": "high",
"recommendation": "Mask the national ID before it enters the prompt."
}
category is one of client-exposure | output-handling | excessive-agency | data-privacy | prompt-injection | cost-control; severity is one of
critical | high | medium | low. pattern is a JS regex source string
(flags defaults to "g"). A rule id that collides with a built-in or
another custom rule is rejected — the scanner keeps running but reports the
problem on stderr and skips that entry.
Development
npm run build
npm test # 36 unit tests
License
MIT — GuardBee
Feedback
Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.
ai-code-scanner MCPのよくある質問
ai-code-scanner MCPをClaude Codeに追加するには
ターミナルでclaude mcp add ai-code-scanner -- npx -y @guardbee/mcp-ai-code-scannerを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
ai-code-scanner MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
ai-code-scanner MCPが提供するツールは
4個のツールを提供しており、scan_text, scan_file, scan_directory, list_patternsなどがあります。
どのようなセキュリティリスクを検出できますか?
クライアント側でのAPIキーの露出、モデル出力の不適切な実行、エージェントへの過剰な権限付与、プロンプト内の個人情報(PII)、プロンプトインジェクションなどのパターンを特定します。
完全なAST解析を行いますか?
いいえ、完全なAST解析ではなく、ヒューリスティックな静的テキストパターンスキャンを使用します。
独自のセキュリティルールを追加できますか?
はい、カスタムのJSONルールパックを使用して、組織固有のパターンによる検出を拡張できます。
テレメトリはデフォルトで有効になっていますか?
いいえ、テレメトリはデフォルトで無効になっています。