Guardbee.ai
@guardbee/mcp-model-scanner

Model Scanner

MCP server that scans ML model files (PyTorch, pickle, joblib, dill, NumPy, safetensors, Keras, ONNX, GGUF, TensorFlow) and Hugging Face repos for supply-chain risks — malicious pickle gadgets, disguised or malformed headers, Keras Lambda-layer RCE, GGUF chat-template injection, and graph ops that touch files

v0.4.0MIT · 开源Node.js · stdio
安装
$ npx -y @guardbee/mcp-model-scanner
Claude Desktop / Cursor 配置
{
  "mcpServers": {
    "model-scanner": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-model-scanner"
      ]
    }
  }
}
@guardbee/mcp-model-scanner

@guardbee/mcp-model-scanner scans the model artifact itself — not the code that loads it. A .pt/.pkl checkpoint is a pickle stream; torch.load() can run arbitrary Python the moment it opens the file.

What does it do?

It walks a real pickle opcode disassembler (protocols 0–5), extracts only data.pkl from PyTorch zip containers, and applies safetensors structural checks plus Keras Lambda RCE and ONNX external_data path-traversal heuristics.

Who is it for?

  • ML teams pulling checkpoints from Hugging Face or registries
  • DevSecOps scanning model artifacts in CI
  • Developers who want this check inside Claude or Cursor

What it is not

  • Dynamic runtime analysis by executing the model
  • A full HDF5/protobuf structural parser
  • A formal safety proof (findings are heuristic)

Features

FeatureDescription
31 dangerous-global rulescode-execution, process, network, filesystem, reflection, deserialization
PyTorch zip + Zip64Scan data.pkl without loading the full checkpoint
safetensors / Keras / ONNXDisguised extensions, Lambda RCE, path traversal
SARIF 2.1.0GitHub Code Scanning / CI gates
guardbee.ymlfail-on, max-files, exclude

MCP tools

ToolDescription
scan_fileScan a single model file
scan_directoryRecursively scan a models directory
list_patternsList the dangerous-global catalog

Install with npm

Global install (handy for Claude Desktop / Cursor):

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

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

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

npm: @guardbee/mcp-model-scanner

CLI
<code class="language-bash">npx @guardbee/mcp-model-scanner scan ./models --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-model-scanner": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-model-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 models folder for supply-chain risks: ./models”
  2. “Does this .pt file contain dangerous pickle globals?”
  3. “Which dangerous-global patterns do you support?”

常见问题

Vs picklescan?+

MCP + Claude/Cursor integration, safetensors/Keras/ONNX checks, and SARIF in one package.

Will huge files OOM?+

No — bounded reads (pickle prefix, zip entry, header caps) by design.

API key?+

No — fully local filesystem scanning.

几分钟内了解您的安全状况

添加您的域名,运行只读扫描,获取按优先级排序的修复清单。无需安装。

Model Scanner MCP server (@guardbee/mcp-model-scanner) · GuardBee