Skip to main content
Glama
badchars

osint-mcp-server

by badchars

geoip_lookup

Geolocate IP addresses to identify country, city, ISP, ASN, and detect proxy/hosting/mobile connections for reconnaissance and analysis.

Instructions

Geolocate an IP address: country, city, ISP, ASN, proxy/hosting/mobile detection. Uses ip-api.com (free, no API key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYesIP address to geolocate

Implementation Reference

  • The actual implementation of the geoip_lookup tool which fetches data from ip-api.com.
    export async function geoipLookup(ip: string): Promise<GeoIpResult> {
      await limiter.acquire();
      // ip-api.com free tier requires HTTP (not HTTPS)
      const res = await fetch(`http://ip-api.com/json/${encodeURIComponent(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 returned ${res.status}`);
      const data = await res.json();
      if (data.status === "fail") throw new Error(`ip-api.com: ${data.message}`);
      return data;
    }
  • Tool definition and registration for geoip_lookup.
    const geoipLookupTool: ToolDef = {
      name: "geoip_lookup",
      description: "Geolocate an IP address: country, city, ISP, ASN, proxy/hosting/mobile detection. Uses ip-api.com (free, no API key).",
      schema: {
        ip: z.string().describe("IP address to geolocate"),
      },
      execute: async (args) => json(await geoipLookup(args.ip as string)),
    };
  • Type definition for the GeoIP lookup result.
    interface GeoIpResult {
      query: string;
      status: string;
      country?: string;
      countryCode?: string;
      region?: string;
      regionName?: string;
      city?: string;
      zip?: string;
      lat?: number;
      lon?: number;
      timezone?: string;
      isp?: string;
      org?: string;
      as?: string;
      asname?: string;
      mobile?: boolean;
      proxy?: boolean;
      hosting?: boolean;
    }

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