一个轻量级的 MCP(模型上下文协议)服务器用于 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
list_models
model_type(字符串,必需):要列出的模型类型(ollama, openai, huggingface, ggml)list_garak_probes
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
{
"mcpServers": {
"garak-mcp": {
"command": "uv",
"args": ["--directory", "path-to/Garak-MCP", "run", "garak-server"],
"env": {}
}
}
}
已测试于: