Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } }
  • 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: {} } },
  • Input schema definition for get_my_ip tool: empty object (no input parameters).
    inputSchema: { type: "object", properties: {} }

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/Cyreslab-AI/shodan-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server