Garak-MCP漏洞扫描器
语言类型:英语 翻译结果:MCP服务器用于Garak LLM漏洞扫描器 https://github.com/EdenYavin/Garak-MCP/blob/main/README.md
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"garak-mcp": {
"args": [
"--directory",
"path-to/Garak-MCP",
"run",
"garak-server"
],
"command": "uv",
"env": {}
}
}
}
服务介绍
MCP Server For Garak LLM Vulnerability Scanner
一个轻量级的MCP(Model Context Protocol)服务器,用于Garak。
示例:
https://github.com/user-attachments/assets/f6095d26-2b79-4ef7-a889-fd6be27bbbda
提供的工具
概览
| 名称 | 描述 |
|---|---|
| list_model_types | 列出所有可用的模型类型 (ollama, openai, huggingface, ggml) |
| list_models | 列出给定模型类型的所有可用模型 |
| list_garak_probes | 列出所有可用的Garak攻击/探测器 |
| get_report | 获取上次运行的报告 |
| run_attack | 使用指定模型和探测器运行攻击 |
详细描述
-
list_model_types
- 列出可用于攻击的所有模型类型
- 返回支持的模型类型列表 (ollama, openai, huggingface, ggml)
-
list_models
- 列出给定模型类型的所有可用模型
- 输入参数:
model_type(字符串,必填): 要列出的模型类型 (ollama, openai, huggingface, ggml)
- 返回指定类型的可用模型列表
-
list_garak_probes
- 列出所有可用的Garak攻击/探测器
- 返回可运行的探测器/攻击列表
-
get_report
- 获取上次运行的报告
- 返回报告文件的路径
-
run_attack
- 使用指定的模型和探测器运行攻击
- 输入参数:
model_type(字符串,必填): 要使用的模型类型model_name(字符串,必填): 要使用的模型名称probe_name(字符串,必填): 要使用的攻击/探测器名称
- 返回发现的漏洞列表
前提条件
-
Python 3.11 或更高版本: 此项目需要 Python 3.11 或更新版本。
# 检查你的 Python 版本 python --version -
安装 uv: 一个快速的 Python 包安装器和解析器。
pip install uv或者使用 Homebrew:
brew install uv -
可选: Ollama: 如果你想在 ollama 模型上运行攻击,请确保 ollama 服务器正在运行。
ollama serve
安装
- 克隆此仓库:
git clone https://github.com/BIGdeadLock/Garak-MCP.git
- 配置您的 MCP 主机 (Claude Desktop, Cursor 等):
{
"mcpServers": {
"garak-mcp": {
"command": "uv",
"args": ["--directory", "path-to/Garak-MCP", "run", "garak-server"],
"env": {}
}
}
}
测试通过:
- Cursor
- Claude Desktop
未来步骤
- 添加对 Smithery AI 的支持: Docker 和配置
- 改进报告
- 测试并验证 OpenAI 模型 (GPT-3.5, GPT-4)
- 测试并验证 HuggingFace 模型
- 测试并验证本地 GGML 模型