geolocate_ip
Find geographic location details for any IP address, including country, city, coordinates, timezone, and EU membership status.
Instructions
Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888) |
Implementation Reference
- src/tools/ip.ts:6-16 (handler)The geolocate_ip tool handler implementation, which calls the apiGet helper function.
server.tool( 'geolocate_ip', 'Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.', { address: z.string().describe('IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888)'), }, async ({ address }) => { const data = await apiGet(`/v1/api/geo/ip/${address}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } ); - src/tools/ip.ts:5-17 (registration)Registration function for the geolocate_ip tool within the McpServer.
export function registerIpTools(server: McpServer) { server.tool( 'geolocate_ip', 'Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.', { address: z.string().describe('IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888)'), }, async ({ address }) => { const data = await apiGet(`/v1/api/geo/ip/${address}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } ); }