create_targets
Generate and manage target lists by inputting domain addresses for Intruder.IO, enabling efficient scanning and security assessments.
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 |
Input Schema (JSON Schema)
{
"properties": {
"addresses": {
"items": {
"type": "string"
},
"title": "Addresses",
"type": "array"
}
},
"required": [
"addresses"
],
"title": "create_targetsArguments",
"type": "object"
}
Implementation Reference
- intruder_mcp/server.py:204-216 (handler)The main handler function for the 'create_targets' MCP tool. It is decorated with @mcp.tool(), which registers it and defines the input schema via the function signature and docstring. The function creates target dictionaries from addresses and calls the API client's bulk_create_targets method.@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:198-213 (helper)Helper method in the API client that performs bulk creation of targets via the Intruder API. It avoids duplicates by checking existing targets and handles both creation and retrieval of existing ones.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/server.py:204-216 (registration)The @mcp.tool() decorator registers the create_targets function as an MCP tool.@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"