create_targets
Add one or more host addresses to create targets for security assessment.
Instructions
Create one or more targets.
Args:
addresses: List of target addresses to create
Example: ['example.com'] for a single target
Example: ['example.com', 'test.com'] for multiple targets
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addresses | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- intruder_mcp/server.py:210-222 (handler)The MCP tool handler for 'create_targets'. Decorated with @mcp.tool(), it converts a list of addresses to a list of dicts and delegates to the API client.
@mcp.tool() async def create_targets(addresses: List[str]) -> str: """ Create one or more targets. Args: addresses: List of target addresses to create Example: ['example.com'] for a single target Example: ['example.com', 'test.com'] for multiple targets """ targets = [{'address': addr} for addr in addresses] result = api.bulk_create_targets(targets) return f"Created {len(addresses)} targets" - intruder_mcp/api_client.py:200-215 (helper)The API client method 'bulk_create_targets' that filters out already-existing targets and POSTs new ones to /targets/bulk/
def bulk_create_targets(self, targets: List[Dict[str, str]]) -> List[Target]: # Get list of existing target addresses existing_targets = list(self.list_targets_all()) existing_addresses = {target.address for target in existing_targets} # Filter out targets that already exist new_targets = [target for target in targets if target['address'] not in existing_addresses] if not new_targets: return [target for target in existing_targets if target.address in {t['address'] for t in targets}] response = self.client.post(f"{self.base_url}/targets/bulk/", json=new_targets) created_targets = [Target(**target) for target in response.json()] # Combine newly created targets with existing ones return created_targets + [target for target in existing_targets if target.address in {t['address'] for t in targets}] - intruder_mcp/enums.py:117-124 (schema)The Target Pydantic model used as the return type for bulk_create_targets.
class Target(BaseModel): id: int address: str has_api_schemas: bool has_authentications: bool license_type: Optional[LicenseTypeEnum] = None tags: Optional[List[Optional[str]]] = None target_status: TargetStatusEnum - intruder_mcp/enums.py:126-129 (schema)The TargetCreateRequest Pydantic model used for creating targets (though bulk_create_targets uses flat dicts instead).
class TargetCreateRequest(BaseModel): address: str tags: Optional[List[str]] = Field(None, min_items=1, max_length=40) target_authentication: Optional[TargetAuthenticationsRequest] = None - intruder_mcp/server.py:210-211 (registration)The tool is registered as an MCP tool via the @mcp.tool() decorator within the main() function of server.py.
@mcp.tool() async def create_targets(addresses: List[str]) -> str: