create_targets
Add target addresses to Intruder.IO for security testing by specifying one or multiple addresses to create targets.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addresses | Yes |
Implementation Reference
- intruder_mcp/server.py:204-217 (handler)The main handler function for the 'create_targets' MCP tool. It accepts a list of addresses, converts them to target dicts, calls the API client's bulk_create_targets method, and returns a confirmation message.@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/server.py:204-204 (registration)The @mcp.tool() decorator registers the create_targets function as an MCP tool.@mcp.tool()
- intruder_mcp/api_client.py:198-214 (helper)Helper method in IntruderAPI class that handles bulk creation of targets, avoiding duplicates by checking existing targets and making API call only for new 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}]