get_my_ip
Retrieve your current public IP address to identify how your device is seen online. Useful for cybersecurity research, network diagnostics, and internet-connected device monitoring.
Instructions
Get your current IP address as seen from the Internet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:471-487 (handler)Core handler function in ShodanClient that fetches the current IP address from Shodan API endpoint /tools/myip and returns it in { ip: response.data } format./** * Get current IP address */ async getMyIp(): Promise<any> { try { const response = await this.axiosInstance.get("/tools/myip"); return { ip: response.data }; } catch (error: unknown) { if (axios.isAxiosError(error)) { throw new McpError( ErrorCode.InternalError, `Shodan API error: ${error.response?.data?.error || error.message}` ); } throw error; } }
- src/index.ts:1674-1692 (handler)MCP server tool handler for 'get_my_ip' in CallToolRequestSchema switch statement that invokes shodanClient.getMyIp() and returns JSON-formatted response.case "get_my_ip": { try { const myIp = await shodanClient.getMyIp(); return { content: [{ type: "text", text: JSON.stringify(myIp, null, 2) }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Error getting IP address: ${(error as Error).message}` ); } }
- src/index.ts:1080-1086 (registration)Tool registration entry in ListToolsRequestSchema response, including name, description, and empty input schema (no parameters required).name: "get_my_ip", description: "Get your current IP address as seen from the Internet", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1082-1085 (schema)Input schema definition for get_my_ip tool: empty object (no input parameters).inputSchema: { type: "object", properties: {} }