Skip to main content
Glama
badchars

osint-mcp-server

by badchars

hackertarget_hostsearch

Discover subdomains and their IP addresses for any domain using HackerTarget's API to map attack surfaces and identify potential security risks.

Instructions

Find subdomains and their IPs for a domain via HackerTarget. Free tier: 50 queries/day.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to search hosts for

Implementation Reference

  • The core implementation of the host search logic, which fetches data from the HackerTarget API and parses the resulting CSV output.
    export async function hackertargetHostsearch(domain: string): Promise<HostEntry[]> {
      const text = await htFetch("hostsearch", domain);
      if (!text) return [];
    
      return text.split("\n").filter(Boolean).map((line) => {
        const [hostname, ip] = line.split(",");
        return { hostname: hostname?.trim() ?? "", ip: ip?.trim() ?? "" };
      });
    }
  • Registration of the tool, defining its name, schema, and linking the execution to the implementation function.
    const hackertargetHostsearchTool: ToolDef = {
      name: "hackertarget_hostsearch",
      description: "Find subdomains and their IPs for a domain via HackerTarget. Free tier: 50 queries/day.",
      schema: {
        domain: z.string().describe("Domain to search hosts for"),
      },
      execute: async (args) => json(await hackertargetHostsearch(args.domain as string)),
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/osint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server