MCP缺陷Dojo
🔗 将AI代理连接到DefectDojo漏洞管理
 ](https://golang.org/)  
A. 模型上下文协议 服务器,使AI代理能够通过自然语言与DefectDojo漏洞管理平台进行交互。
兼容:Claude Desktop、VS Code Copilot、自定义AI代理和任何与MCP兼容的工具
� 快速开始
AI代理(推荐)
- 下载二进制文件:
# Linux/macOS
curl -L https://github.com/brduru/mcp-defect-dojo/releases/latest/download/mcp-defect-dojo-linux-amd64 -o mcp-defect-dojo
chmod +x mcp-defect-dojo- 配置您的AI客户端:
克劳德桌面 (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"defectdojo": {
"command": "/path/to/mcp-defect-dojo",
"env": {
"DEFECTDOJO_URL": "https://your-defectdojo.com",
"DEFECTDOJO_API_KEY": "your-api-key"
}
}
}
}- 开始聊天:
You: "Check if DefectDojo is working"
Claude: ✅ DefectDojo Health Check: HEALTHY
You: "Show me all critical vulnerabilities"
Claude: Found 5 critical findings...适用于Go应用程序
go get github.com/brduru/mcp-defect-dojo/pkg/mcpserverpackage main
import "github.com/brduru/mcp-defect-dojo/pkg/mcpserver"
func main() {
// Quick setup with API key
server, err := mcpserver.NewServerWithAPIKey("your-api-key")
if err != nil {
panic(err)
}
// Run the server
if err := server.Run(context.Background()); err != nil {
panic(err)
}
}🛠️ 可用工具
| 工具 | 说明 | 示例 |
|---|---|---|
defectdojo_health_check | 验证连接 | *“DefectDojo在线吗?”* |
get_defectdojo_findings | 搜索漏洞 | *“向我展示所有关键发现”* |
get_finding_detail | 获取查找详细信息 | *“获取查找#123的详细信息”* |
mark_finding_false_positive | 标记误报 | *“将发现#456标记为假阳性”* |
对话示例
🧑: "Check if DefectDojo is working"
🤖: ✅ DefectDojo Health Check: HEALTHY
Connection successful to https://your-defectdojo.com
API v2 is responsive and accessible.
🧑: "Show me the most critical vulnerabilities"
🤖: Found 3 critical findings:
1. [Critical] SQL Injection in Authentication (ID: 456)
Status: Active, Verified: true
2. [Critical] Remote Code Execution via Upload (ID: 789)
Status: Active, Verified: false⚙️ 配置
环境变量
| 变量 | 描述 | 默认值 | 必填 |
|---|---|---|---|
DEFECTDOJO_URL | 破坏Dojo基础URL | http://localhost:8080 | ✅ |
DEFECTDOJO_API_KEY | API身份验证密钥 | - | ✅ |
DEFECTDOJO_API_VERSION | API版本 | v2 | ❌ |
配置方法
// Method 1: Environment variables (recommended for AI agents)
server, err := mcpserver.NewServer()
// Method 2: Direct API key
server, err := mcpserver.NewServerWithAPIKey("your-api-key")
// Method 3: Full configuration
server, err := mcpserver.NewServerWithSettings(mcpserver.DefectDojoSettings{
BaseURL: "https://defectdojo.company.com",
APIKey: "your-api-key",
APIVersion: "v2",
})📦 安装
预构建二进制文件
| 平台 | 下载 |
|---|---|
| Linux(x64) | mcp-defect-dojo-linux-amd64 |
| Linux(ARM64) | mcp-defect-dojo-linux-arm64 |
| macOS(英特尔) | mcp-defect-dojo-darwin-amd64 |
| macOS(苹果硅) | mcp-defect-dojo-darwin-arm64 |
| Windows(x64) | mcp-defect-dojo-windows-amd64.exe |
来源
git clone https://github.com/brduru/mcp-defect-dojo.git
cd mcp-defect-dojo
make buildGo模块
go get github.com/brduru/mcp-defect-dojo/pkg/mcpserver@latest🔧 发展
测试
# Run all tests
make test
# Run with coverage
make test-coverage
# Run specific package
go test ./pkg/mcpserver -v当前测试覆盖范围:
pkg/mcpserver: 32.9%pkg/types: 100%internal/config: 80%internal/defectdojo: 86.9%
建筑
# Build for current platform
make build
# Build for all platforms
make build-all
# Run locally
make run📚 文档
- GoDoc API参考 -完整的API文件
- 例子 -使用示例和集成模式
- 模型上下文协议 -了解MCP
- DefectDojo API -DefectDojo API文档
🤝 贡献
我们欢迎捐款!请查看我们的 贡献指南 了解详情。
- 分叉存储库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 运行测试(
make test) - 提交您的更改(
git commit -m 'Add some amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
📝 许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
______________________________________________________________________
将您的AI代理连接到DefectDojo并自动化漏洞管理 🚀
