get_my_ip
Retrieve your public IP address to identify your network location and enable geolocation services for AI assistants.
Instructions
Return the public IP address of the machine running this MCP server via /v3/getip. No API key or credits required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/client.ts:146-158 (handler)The handler function that performs the network request to fetch the IP address.
export async function getMyIp(): Promise<string> { const response = await fetchWithTimeout(`${API_BASE}/v3/getip`); if (!response.ok) { throw new ApiError(response.status, "Failed to retrieve IP address"); } let data: { ip: string }; try { data = (await response.json()) as { ip: string }; } catch { throw new ApiError(502, "502: Upstream API returned invalid JSON"); } return data.ip; } - src/tools/geolocation.ts:383-400 (registration)The registration and implementation wrapper for the 'get_my_ip' tool.
server.registerTool( "get_my_ip", { title: "Get My IP Address", annotations: { readOnlyHint: true, }, description: "Return the public IP address of the machine running this MCP server via /v3/getip. No API key or credits required.", inputSchema: {}, }, async () => { try { const ip = await getMyIp(); return { content: [{ type: "text" as const, text: ip }], }; } catch (error) {