A Model Context Protocol (MCP) server that provides tools for interacting with the Namecheap API. This server allows AI assistants to manage domains, check availability, and configure DNS records through Namecheap.
- Domain Management: List domains, check availability, get domain information
- DNS Management: Get and set DNS records, configure custom nameservers
- Secure: API keys stored in environment variables
- Flexible: Supports both production and sandbox Namecheap APIs
- MCP Compatible: Works with any MCP-compatible client
- Node.js 18 or higher
- Namecheap account with API access enabled
- Production API key from Namecheap (get it from https://ap.www.namecheap.com/settings/tools/apiaccess/)
- Sandbox API key for testing (register at https://www.sandbox.namecheap.com and enable API access)
- Clone the repository:
git clone https://github.com/yourusername/mcp-namecheap.git
cd mcp-namecheap- Install dependencies:
npm install- Create a
.envfile from the example:
cp .env.example .env- Edit
.envand add your Namecheap API credentials:
# Production API Key (from Namecheap account settings)
NAMECHEAP_API_KEY=your_production_api_key_here
# Sandbox API Key (from https://www.sandbox.namecheap.com)
NAMECHEAP_SANDBOX_API_KEY=your_sandbox_api_key_here
NAMECHEAP_API_USER=your_api_username_here
NAMECHEAP_CLIENT_IP=your_whitelisted_ip_here
# Set to 'true' to use sandbox API, 'false' for production
NAMECHEAP_USE_SANDBOX=trueImportant: You must whitelist your IP address in the Namecheap API settings.
- Build the project:
npm run build- Build the Docker image:
docker build -t mcp-namecheap .- Run with environment variables:
docker run -i \
-e NAMECHEAP_API_KEY=your_production_api_key \
-e NAMECHEAP_SANDBOX_API_KEY=your_sandbox_api_key \
-e NAMECHEAP_API_USER=your_username \
-e NAMECHEAP_CLIENT_IP=your_ip \
-e NAMECHEAP_USE_SANDBOX=true \
mcp-namecheapAdd the server to your MCP client configuration:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"namecheap": {
"command": "node",
"args": ["/path/to/mcp-namecheap/dist/index.js"],
"env": {
"NAMECHEAP_API_KEY": "your_production_api_key",
"NAMECHEAP_SANDBOX_API_KEY": "your_sandbox_api_key",
"NAMECHEAP_API_USER": "your_username",
"NAMECHEAP_CLIENT_IP": "your_ip",
"NAMECHEAP_USE_SANDBOX": "true"
}
}
}
}The server is configured to work with Smithery installation. Simply use:
smithery install mcp-namecheapLists all domains in your Namecheap account.
Parameters:
listType(optional): "ALL", "EXPIRING", or "EXPIRED"searchTerm(optional): Filter domains by search termpage(optional): Page number for paginationpageSize(optional): Number of results per pagesortBy(optional): Sort order - "NAME", "NAME_DESC", "EXPIREDATE", "EXPIREDATE_DESC", "CREATEDATE", "CREATEDATE_DESC"
Checks if domains are available for registration. Supports bulk checking!
Parameters:
domainList(required): Array of domain names to check (can check multiple domains at once)
Gets detailed information about a specific domain.
Parameters:
domainName(required): Domain name to get information forhostName(optional): Hosted domain name for which domain information needs to be requested
Gets contact information for a domain.
Parameters:
domainName(required): Domain name to get contacts for
Registers a new domain name.
Parameters:
domainName(required): Domain name to registeryears(required): Number of years to register (1-10)registrantFirstName(required): Registrant first nameregistrantLastName(required): Registrant last nameregistrantAddress1(required): Registrant addressregistrantCity(required): Registrant cityregistrantStateProvince(required): Registrant state/provinceregistrantPostalCode(required): Registrant postal coderegistrantCountry(required): Registrant country code (e.g., "US")registrantPhone(required): Registrant phone numberregistrantEmailAddress(required): Registrant email address- Additional optional contact fields for admin, tech, and billing contacts
nameservers(optional): Comma-separated list of nameserversaddFreeWhoisguard(optional): "yes" or "no" (default: "yes")wgEnabled(optional): Enable WhoisGuard privacy protection "yes" or "no" (default: "yes")
Gets a list of all supported TLDs (Top Level Domains).
No parameters required.
Updates contact information for a domain.
Parameters:
domainName(required): Domain name to update- Various contact fields (all optional) for registrant, admin, tech, and billing contacts
Reactivates an expired domain.
Parameters:
domainName(required): Domain name to reactivateisPremiumDomain(optional): Whether this is a premium domain (default: false)
Renews an expiring domain.
Parameters:
domainName(required): Domain name to renewyears(required): Number of years to renew (1-10)isPremiumDomain(optional): Whether this is a premium domain (default: false)
Gets the registrar lock status of a domain.
Parameters:
domainName(required): Domain name to check lock status
Sets the registrar lock status for a domain.
Parameters:
domainName(required): Domain name to lock/unlocklockAction(required): "LOCK" or "UNLOCK"
Retrieves DNS host records for a domain.
Parameters:
sld(required): Second level domain (e.g., "example" from "example.com")tld(required): Top level domain (e.g., "com" from "example.com")
Sets custom nameservers for a domain.
Parameters:
sld(required): Second level domaintld(required): Top level domainnameservers(required): Array of nameserver addresses
Sets DNS host records for a domain.
Parameters:
sld(required): Second level domaintld(required): Top level domainhosts(required): Array of DNS records with:hostname: Subdomain or "@" for rootrecordType: "A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV", or "CAA"address: Value for the DNS recordmxPriority(optional): Priority for MX recordsttl(optional): Time to live in seconds (default: 1800)
npm run devnpm run buildYou can test the server using the MCP Inspector:
npx @modelcontextprotocol/inspector dist/index.js- Never commit your
.envfile or expose your API keys - Always use environment variables for sensitive data
- Whitelist only necessary IP addresses in Namecheap
- Use the sandbox API for testing
Make sure your API access is enabled in Namecheap and you're using the correct API endpoint.
Check that:
- Your API key is correct
- Your username matches the API user
- Your IP is whitelisted in Namecheap
Ensure the server is running and your MCP client is properly configured with the correct path.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.