UNPKG

@aashari/boilerplate-mcp-server

Version:

TypeScript Model Context Protocol (MCP) server boilerplate providing IP lookup tools/resources. Includes CLI support and extensible structure for connecting AI systems (LLMs) to external data sources like ip-api.com. Ideal template for creating new MCP in

29 lines (28 loc) 1.5 kB
import { ControllerResponse } from '../types/common.types.js'; /** * @namespace IpAddressController * @description Controller responsible for handling IP address lookup logic. * It orchestrates calls to the ip-api.com service, applies defaults, * maps options, and formats the response using the formatter. */ /** * @function get * @description Fetches details for a specific IP address or the current device's IP. * Handles mapping controller options (like includeExtendedData) to service parameters (fields). * @memberof IpAddressController * @param {Object} args - Arguments containing ipAddress and options * @param {string} [args.ipAddress] - Optional IP address to look up. If omitted, the service will fetch the current device's public IP. * @param {boolean} [args.includeExtendedData=false] - Whether to include extended data fields requiring an API token * @param {boolean} [args.useHttps=true] - Whether to use HTTPS for the API request * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the formatted IP details in Markdown. * @throws {McpError} Throws an McpError (handled by `handleControllerError`) if the service call fails or returns an error. */ declare function get(args?: { ipAddress?: string; includeExtendedData?: boolean; useHttps?: boolean; }): Promise<ControllerResponse>; declare const _default: { get: typeof get; }; export default _default;