Skip to main content
Glama
badchars

osint-mcp-server

by badchars

geoip_batch

Geolocate multiple IP addresses simultaneously to identify geographic locations of network endpoints for reconnaissance and analysis.

Instructions

Batch geolocate up to 100 IP addresses at once. Uses ip-api.com (free, no API key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYesIP addresses to geolocate (max 100)

Implementation Reference

  • The core logic for the 'geoip_batch' tool, which sends a POST request to ip-api.com/batch.
    export async function geoipBatch(ips: string[]): Promise<GeoIpResult[]> {
      if (ips.length === 0) return [];
      const batch = ips.slice(0, 100);
    
      await limiter.acquire();
      const res = await fetch("http://ip-api.com/batch", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(
          batch.map((ip) => ({
            query: ip,
            fields: "status,message,query,country,countryCode,region,regionName,city,zip,lat,lon,timezone,isp,org,as,asname,mobile,proxy,hosting",
          })),
        ),
      });
      if (!res.ok) throw new Error(`ip-api.com batch returned ${res.status}`);
      return res.json();
    }
  • The tool definition and registration for 'geoip_batch' within the protocol tools collection.
    const geoipBatchTool: ToolDef = {
      name: "geoip_batch",
      description: "Batch geolocate up to 100 IP addresses at once. Uses ip-api.com (free, no API key).",
      schema: {
        ips: z.array(z.string()).describe("IP addresses to geolocate (max 100)"),
      },
      execute: async (args) => json(await geoipBatch(args.ips as string[])),
    };
  • The input schema for 'geoip_batch' defining the expected list of IP addresses.
    schema: {
      ips: z.array(z.string()).describe("IP addresses to geolocate (max 100)"),
    },

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