本项目提供了一个轻量级MCP服务器,用于Garak LLM漏洞扫描器。它可以列出可用的模型类型和模型,列出Garak攻击/探测器,获取运行报告以及运行攻击,帮助用户检测LLM的漏洞。
在使用该工具前,请确保满足以下先决条件:
Python 3.11或更高版本:该项目需要Python 3.11或更新版本。
# 检查你的Python版本
python --version
安装uv:一个快速的Python包安装程序和解析器。
pip install uv
或使用Homebrew:
brew install uv
可选:Ollama:如果你希望在ollama模型上运行攻击,请确保Ollama服务器正在运行。
ollama serve
属性 | 详情 |
---|---|
功能 | 可列出可用模型类型、模型、Garak攻击/探测器,获取运行报告,运行攻击 |
支持模型类型 | ollama、openai、huggingface、ggml |
git clone https://github.com/BIGdeadLock/Garak-MCP.git
{
"mcpServers": {
"garak-mcp": {
"command": "uv",
"args": ["--directory", "Garak-MCP所在路径", "run", "garak-server"],
"env": {}
}
}
}
名称 | 描述 |
---|---|
list_model_types | 列出所有可用的模型类型(ollama、openai、huggingface、ggml) |
list_models | 列出指定模型类型的可用模型 |
list_garak_probes | 列出所有可用的Garak攻击/探测器 |
get_report | 获取最后一次运行的报告 |
run_attack | 使用给定的模型和探测器运行攻击 |
list_model_types:
list_models:
model_type
(字符串,必需):要列出的模型类型(ollama、openai、huggingface、ggml)。list_garak_probes:
get_report:
run_attack:
model_type
(字符串,必需):要使用的模型类型model_name
(字符串,必需):要使用的模型名称probe_name
(字符串,必需):要使用的攻击/探测器名称