Skip to main content
Glama

get_my_ip

Retrieve your current public IP address to identify your network's external presence for cybersecurity analysis and Shodan API integration.

Instructions

Get your current IP address as seen from the Internet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_my_ip' that invokes shodanClient.getMyIp() and formats the response as JSON text.
    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:1079-1086 (registration)
    Tool registration in ListToolsRequestSchema handler, including name, description, and empty input schema.
    { name: "get_my_ip", description: "Get your current IP address as seen from the Internet", inputSchema: { type: "object", properties: {} } },
  • ShodanClient helper method that queries the Shodan API endpoint '/tools/myip' to retrieve the 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; } }

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