Skip to main content
Glama
DefectDojo MCP Server

DefectDojo MCP Server

by jamiesonio

DefectDojo MCP 服务器

PyPI 版本

该项目为流行的开源漏洞管理工具DefectDojo提供了一个模型上下文协议 (MCP)服务器实现。它允许 AI 代理和其他 MCP 客户端以编程方式与 DefectDojo API 进行交互。

特征

该 MCP 服务器公开了用于管理关键 DefectDojo 实体的工具:

  • **发现:**获取、搜索、创建、更新状态和添加注释。

  • **产品:**列出可用的产品。

  • **约定:**列出、检索详细信息、创建、更新和结束约定。

Related MCP server: Agent Construct

安装与运行

有几种方法可以运行此服务器:

使用uvx (推荐)

uvx在临时虚拟环境中执行 Python 应用程序,自动安装依赖项。

uvx defectdojo-mcp

使用pip

您可以使用pip将包安装到您的 Python 环境中。

# Install directly from the cloned source code directory
pip install .

# Or, if the package is published on PyPI
pip install defectdojo-mcp

通过 pip 安装后,使用以下命令运行服务器:

defectdojo-mcp

配置

服务器需要以下环境变量来连接到您的 DefectDojo 实例:

  • DEFECTDOJO_API_TOKEN (必需):用于身份验证的 DefectDojo API 令牌。

  • DEFECTDOJO_API_BASE (必需):您的 DefectDojo 实例的基本 URL(例如, https://your-defectdojo-instance.com )。

您可以在 MCP 客户端的设置文件中配置这些。以下是使用uvx命令的示例:

{
  "mcpServers": {
    "defectdojo": {
      "command": "uvx",
      "args": ["defectdojo-mcp"],
      "env": {
        "DEFECTDOJO_API_TOKEN": "YOUR_API_TOKEN_HERE",
        "DEFECTDOJO_API_BASE": "https://your-defectdojo-instance.com"
      }
    }
  }
}

如果您使用pip安装该软件包,则配置将如下所示:

{
  "mcpServers": {
    "defectdojo": {
      "command": "defectdojo-mcp",
      "args": [],
      "env": {
        "DEFECTDOJO_API_TOKEN": "YOUR_API_TOKEN_HERE",
        "DEFECTDOJO_API_BASE": "https://your-defectdojo-instance.com"
      }
    }
  }
}

可用工具

可通过 MCP 界面使用以下工具:

  • get_findings :通过过滤(产品名称、状态、严重性)和分页(限制、偏移)检索结果。

  • search_findings :使用文本查询搜索结果,并进行过滤和分页。

  • update_finding_status :更改特定发现的状态(例如,活动、已验证、误报)。

  • add_finding_note :为发现添加文本注释。

  • create_finding :创建与测试相关的新发现。

  • list_products :列出具有过滤(名称、产品类型)和分页功能的产品。

  • list_engagements :列出带有过滤(product_id、status、name)和分页的参与度。

  • get_engagement :通过 ID 获取特定参与的详细信息。

  • create_engagement :为产品创建新的约定。

  • update_engagement :修改现有约定的详细信息。

  • close_engagement :将约定标记为已完成。

(每个工具的详细使用示例请见下方README原文内容)

使用示例

(注意:这些示例假设 MCP 客户端环境能够调用use_mcp_tool )

获取调查结果

# Get active, high-severity findings (limit 10)
result = await use_mcp_tool("defectdojo", "get_findings", {
    "status": "Active",
    "severity": "High",
    "limit": 10
})

搜索结果

# Search for findings containing 'SQL Injection'
result = await use_mcp_tool("defectdojo", "search_findings", {
    "query": "SQL Injection"
})

更新结果状态

# Mark finding 123 as Verified
result = await use_mcp_tool("defectdojo", "update_finding_status", {
    "finding_id": 123,
    "status": "Verified"
})

为发现添加注释

result = await use_mcp_tool("defectdojo", "add_finding_note", {
    "finding_id": 123,
    "note": "Confirmed vulnerability on staging server."
})

创建发现

result = await use_mcp_tool("defectdojo", "create_finding", {
    "title": "Reflected XSS in Search Results",
    "test_id": 55, # ID of the associated test
    "severity": "Medium",
    "description": "User input in search is not properly sanitized, leading to XSS.",
    "cwe": 79
})

列出产品

# List products containing 'Web App' in their name
result = await use_mcp_tool("defectdojo", "list_products", {
    "name": "Web App",
    "limit": 10
})

列出参与活动

# List 'In Progress' engagements for product ID 42
result = await use_mcp_tool("defectdojo", "list_engagements", {
    "product_id": 42,
    "status": "In Progress"
})

获得参与

result = await use_mcp_tool("defectdojo", "get_engagement", {
    "engagement_id": 101
})

创造参与度

result = await use_mcp_tool("defectdojo", "create_engagement", {
    "product_id": 42,
    "name": "Q2 Security Scan",
    "target_start": "2025-04-01",
    "target_end": "2025-04-15",
    "status": "Not Started"
})

更新参与度

result = await use_mcp_tool("defectdojo", "update_engagement", {
    "engagement_id": 101,
    "status": "In Progress",
    "description": "Scan initiated."
})

密切接触

result = await use_mcp_tool("defectdojo", "close_engagement", {
    "engagement_id": 101
})

发展

设置

  1. 克隆存储库。

  2. 建议使用虚拟环境:

    python -m venv .venv
    source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
  3. 安装依赖项,包括开发依赖项:

    pip install -e ".[dev]"

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

贡献

欢迎贡献!欢迎随时提交问题,包括错误报告、功能请求或疑问。如果您想贡献代码,请先提交问题,讨论建议的更改。

Available Tools

11 tools
add_finding_noteC

Add a note to a finding

Inputs: finding_id (required), note (required). Returns: result

close_engagementC

Close an engagement

Inputs: engagement_id (required). Returns: result

create_engagementD

Create a new engagement

Inputs: name (required), product_id (required), status (required), target_end (required), +10 more.

create_findingD

Create a new finding

Inputs: description (required), severity (required), test_id (required), title (required), +5 more. Returns: result

get_engagementB

Get a specific engagement by ID

Inputs: engagement_id (required). Returns: result

get_findingsC

Get findings with filtering options and pagination support

Inputs: limit, offset, product_name, severity, +1 more. Returns: result

list_engagementsC

List engagements with optional filtering and pagination support

Inputs: limit, name, offset, product_id, +1 more. Returns: result

list_productsC

List all products with optional filtering and pagination support

Inputs: limit, name, offset, prod_type. Returns: result

search_findingsC

Search for findings using a text query with pagination support

Inputs: query (required), limit, offset, product_name, +2 more. Returns: result

update_engagementC

Update an existing engagement

Inputs: engagement_id (required), branch_tag, build_id, commit_hash, +10 more. Returns: result

update_finding_statusB

Update the status of a finding (Active, Verified, False Positive, Mitigated, Inactive)

Inputs: finding_id (required), status (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific resources and actions, such as create_engagement vs. update_engagement, and get_findings vs. search_findings, with no overlapping or ambiguous functions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as create_engagement, list_products, and update_finding_status, with no deviations in style or convention.

    Tool Count5/5

    With 11 tools, the server is well-scoped for defect management, covering key operations like engagements, findings, and products without being overly sparse or bloated.

    Completeness4/5

    The tool set provides strong CRUD/lifecycle coverage for engagements and findings, including create, get, update, and list operations, though minor gaps like product creation or deletion might require workarounds.

    Related MCP Connectors

    Related MCP Servers