UNPKG

@ironclads/namecheap-mcp

Version:

MCP server for Namecheap API integration - domain management, DNS, and domain suggestions

506 lines 17.1 kB
// Domain check tool export const checkDomainTool = { name: 'check_domain', description: 'Check if a domain is available for registration', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to check (e.g., example.com)', }, }, required: ['domain'], }, }; // Bulk domain check tool export const checkDomainsBulkTool = { name: 'check_domains_bulk', description: 'Check availability of multiple domains at once', inputSchema: { type: 'object', properties: { domains: { type: 'array', description: 'Array of domain names to check', items: { type: 'string', }, minItems: 1, maxItems: 50, }, }, required: ['domains'], }, }; // Get domain info tool export const getDomainInfoTool = { name: 'get_domain_info', description: 'Get detailed information about a registered domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to get info for (e.g., example.com)', }, }, required: ['domain'], }, }; // Register domain tool export const registerDomainTool = { name: 'register_domain', description: 'Register a new domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to register (e.g., example.com)', }, years: { type: 'number', description: 'Number of years to register for (default: 1)', minimum: 1, maximum: 10, }, }, required: ['domain'], }, }; // Renew domain tool export const renewDomainTool = { name: 'renew_domain', description: 'Renew an existing domain registration', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to renew (e.g., example.com)', }, years: { type: 'number', description: 'Number of years to renew for (default: 1)', minimum: 1, maximum: 10, }, }, required: ['domain'], }, }; // Get nameservers tool export const getNameserversTool = { name: 'get_nameservers', description: 'Get nameservers for a domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to get nameservers for (e.g., example.com)', }, }, required: ['domain'], }, }; // Set nameservers tool export const setNameserversTool = { name: 'set_nameservers', description: 'Set custom nameservers for a domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to set nameservers for (e.g., example.com)', }, nameservers: { type: 'array', description: 'Array of nameserver hostnames', items: { type: 'string', }, minItems: 2, maxItems: 5, }, }, required: ['domain', 'nameservers'], }, }; // List domains tool export const listDomainsTool = { name: 'list_domains', description: 'Get a list of all domains in your Namecheap account', inputSchema: { type: 'object', properties: { listType: { type: 'string', description: 'Type of domains to list (default: ALL)', default: 'ALL', }, page: { type: 'number', description: 'Page number to return (default: 1)', minimum: 1, default: 1, }, pageSize: { type: 'number', description: 'Number of domains per page (default: 20)', minimum: 10, maximum: 100, default: 20, }, sortBy: { type: 'string', description: 'Sort field', enum: ['NAME', 'NAME_DESC', 'EXPIREDATE', 'EXPIREDATE_DESC', 'CREATEDATE', 'CREATEDATE_DESC'], }, searchTerm: { type: 'string', description: 'Search term to filter domains', }, }, }, }; // Suggest domains tool export const suggestDomainsTool = { name: 'suggest_domains', description: 'Find and suggest available domain names based on keywords', inputSchema: { type: 'object', properties: { keyword: { type: 'string', description: 'Primary keyword for domain suggestions (e.g., "tech", "shop", "blog")', }, tlds: { type: 'array', description: 'Top-level domains to check (default: common TLDs)', items: { type: 'string', }, default: ['com', 'net', 'org', 'io', 'co'], }, maxSuggestions: { type: 'number', description: 'Maximum number of suggestions to return (default: 10)', minimum: 1, maximum: 50, default: 10, }, includeHyphens: { type: 'boolean', description: 'Include domain suggestions with hyphens (default: false)', default: false, }, includeNumbers: { type: 'boolean', description: 'Include domain suggestions with numbers (default: false)', default: false, }, minLength: { type: 'number', description: 'Minimum domain name length (default: 3)', minimum: 1, maximum: 20, default: 3, }, maxLength: { type: 'number', description: 'Maximum domain name length (default: 15)', minimum: 5, maximum: 63, default: 15, }, }, required: ['keyword'], }, }; // Get domain contacts tool export const getContactsTool = { name: 'get_contacts', description: 'Get contact information for a domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to get contacts for (e.g., example.com)', }, }, required: ['domain'], }, }; // Set domain contacts tool export const setContactsTool = { name: 'set_contacts', description: 'Set contact information for a domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to set contacts for (e.g., example.com)', }, contacts: { type: 'object', description: 'Contact information for all contact types', properties: { registrant: { type: 'object', properties: { FirstName: { type: 'string' }, LastName: { type: 'string' }, Address1: { type: 'string' }, City: { type: 'string' }, StateProvince: { type: 'string' }, PostalCode: { type: 'string' }, Country: { type: 'string' }, Phone: { type: 'string' }, EmailAddress: { type: 'string' }, OrganizationName: { type: 'string' }, Address2: { type: 'string' }, }, required: ['FirstName', 'LastName', 'Address1', 'City', 'StateProvince', 'PostalCode', 'Country', 'Phone', 'EmailAddress'], }, tech: { type: 'object', properties: { FirstName: { type: 'string' }, LastName: { type: 'string' }, Address1: { type: 'string' }, City: { type: 'string' }, StateProvince: { type: 'string' }, PostalCode: { type: 'string' }, Country: { type: 'string' }, Phone: { type: 'string' }, EmailAddress: { type: 'string' }, OrganizationName: { type: 'string' }, Address2: { type: 'string' }, }, required: ['FirstName', 'LastName', 'Address1', 'City', 'StateProvince', 'PostalCode', 'Country', 'Phone', 'EmailAddress'], }, admin: { type: 'object', properties: { FirstName: { type: 'string' }, LastName: { type: 'string' }, Address1: { type: 'string' }, City: { type: 'string' }, StateProvince: { type: 'string' }, PostalCode: { type: 'string' }, Country: { type: 'string' }, Phone: { type: 'string' }, EmailAddress: { type: 'string' }, OrganizationName: { type: 'string' }, Address2: { type: 'string' }, }, required: ['FirstName', 'LastName', 'Address1', 'City', 'StateProvince', 'PostalCode', 'Country', 'Phone', 'EmailAddress'], }, auxBilling: { type: 'object', properties: { FirstName: { type: 'string' }, LastName: { type: 'string' }, Address1: { type: 'string' }, City: { type: 'string' }, StateProvince: { type: 'string' }, PostalCode: { type: 'string' }, Country: { type: 'string' }, Phone: { type: 'string' }, EmailAddress: { type: 'string' }, OrganizationName: { type: 'string' }, Address2: { type: 'string' }, }, required: ['FirstName', 'LastName', 'Address1', 'City', 'StateProvince', 'PostalCode', 'Country', 'Phone', 'EmailAddress'], }, }, required: ['registrant', 'tech', 'admin', 'auxBilling'], }, }, required: ['domain', 'contacts'], }, }; // Get TLD list tool export const getTldListTool = { name: 'get_tld_list', description: 'Get list of available top-level domains (TLDs) and their properties', inputSchema: { type: 'object', properties: {}, }, }; // Reactivate domain tool export const reactivateDomainTool = { name: 'reactivate_domain', description: 'Reactivate an expired domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to reactivate (e.g., example.com)', }, }, required: ['domain'], }, }; // Get registrar lock status tool export const getRegistrarLockTool = { name: 'get_registrar_lock', description: 'Get the registrar lock status of a domain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to check lock status for (e.g., example.com)', }, }, required: ['domain'], }, }; // Set registrar lock status tool export const setRegistrarLockTool = { name: 'set_registrar_lock', description: 'Set the registrar lock status for a domain (lock or unlock)', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain name to set lock status for (e.g., example.com)', }, lock: { type: 'boolean', description: 'True to lock the domain, false to unlock it', }, }, required: ['domain', 'lock'], }, }; const originalTools = [ checkDomainTool, checkDomainsBulkTool, getDomainInfoTool, registerDomainTool, renewDomainTool, getNameserversTool, setNameserversTool, listDomainsTool, suggestDomainsTool, getContactsTool, setContactsTool, getTldListTool, reactivateDomainTool, getRegistrarLockTool, setRegistrarLockTool, ]; // Users API tools export const getBalancesTool = { name: 'get_balances', description: 'Get account balance information including available balance, funds required for auto-renewal, etc.', inputSchema: { type: 'object', properties: {}, }, }; export const getPricingTool = { name: 'get_pricing', description: 'Get pricing information for domains, SSL certificates, hosting, and other products', inputSchema: { type: 'object', properties: { productType: { type: 'string', description: 'Product type to get pricing for', enum: ['DOMAIN', 'SSL', 'HOSTING', 'WHOISGUARD'], }, productCategory: { type: 'string', description: 'Optional product category filter', }, actionType: { type: 'string', description: 'Action type for pricing', enum: ['REGISTER', 'RENEW', 'REACTIVATE', 'TRANSFER'], }, productName: { type: 'string', description: 'Optional specific product name (e.g., TLD for domains)', }, promotionCode: { type: 'string', description: 'Optional promotion code to apply', }, }, required: ['productType'], }, }; export const getDomainPricingTool = { name: 'get_domain_pricing', description: 'Get real-time pricing for specific TLDs with cheapest options highlighted', inputSchema: { type: 'object', properties: { tlds: { type: 'array', description: 'Array of TLD names to get pricing for (e.g., ["com", "net", "org"])', items: { type: 'string', }, maxItems: 20, }, actionType: { type: 'string', description: 'Pricing action type', enum: ['REGISTER', 'RENEW'], default: 'REGISTER', }, }, required: ['tlds'], }, }; // Add new tool for bulk TLD pricing export const getAllTldPricingTool = { name: 'get_all_tld_pricing', description: 'Get pricing for all available TLDs (may take several minutes due to API rate limits)', inputSchema: { type: 'object', properties: { actionType: { type: 'string', description: 'Pricing action type', enum: ['REGISTER', 'RENEW'], default: 'REGISTER', }, batchSize: { type: 'number', description: 'Number of TLDs to query per batch (default: 20)', default: 20, minimum: 1, maximum: 50, }, maxBatches: { type: 'number', description: 'Maximum number of batches to process (default: 10 for 200 TLDs)', default: 10, minimum: 1, maximum: 100, }, }, }, }; // Export all tools including new users API tools export const allTools = [ ...originalTools, getBalancesTool, getPricingTool, getDomainPricingTool, getAllTldPricingTool, ]; //# sourceMappingURL=tools.js.map