domain_email_search
Search for email addresses associated with a specific domain to support security research and data gathering activities.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain to search for associated emails |
Implementation Reference
- src/index.ts:539-548 (registration)Tool registration for domain_email_search in src/index.ts.
server.tool( "domain_email_search", { domain: z.string().describe("Domain to search for associated emails") }, async ({ domain }) => { const result = await emailSearchClient.searchDomain(domain); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } ); - src/tools/email-search.ts:12-28 (handler)Implementation of the email search logic in the EmailSearchClient class.
async searchDomain(domain: string): Promise<string[]> { try { // Using a known endpoint that often contains email leaks or associations // This is a placeholder for a real scraper or API const url = `https://api.hackertarget.com/hostsearch/?q=${domain}`; const response = await fetch(url); const text = await response.text(); // Heuristic: Search for anything that looks like an email in the response const emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g; const emails = text.match(emailRegex) || []; return Array.from(new Set(emails)); } catch (error) { throw new McpError(ErrorCode.InternalError, `Email Search error: ${(error as Error).message}`); } }