cfdude/mcp-namecheap
If you are the rightful owner of mcp-namecheap and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Namecheap Server is a Model Context Protocol server designed to facilitate interaction with the Namecheap API, enabling AI assistants to manage domains and DNS records efficiently.
namecheap_domains_list
Lists all domains in your Namecheap account.
namecheap_domains_check
Checks if domains are available for registration.
namecheap_domains_getinfo
Gets detailed information about a specific domain.
namecheap_dns_getlist
Retrieves DNS host records for a domain.
namecheap_dns_setcustom
Sets custom nameservers for a domain.
namecheap_dns_sethosts
Sets DNS host records for a domain.
MCP Namecheap Server
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.
Features
- 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
Prerequisites
- 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)
Installation
From Source
- Clone the repository:
git clone https://github.com/yourusername/mcp-namecheap.git
cd mcp-namecheap
- Install dependencies:
npm install
- Create a
.env
file from the example:
cp .env.example .env
- Edit
.env
and 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=true
Important: You must whitelist your IP address in the Namecheap API settings.
- Build the project:
npm run build
Using Docker
- 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-namecheap
Configuration
MCP Client Configuration
Add the server to your MCP client configuration:
For Claude Desktop
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"
}
}
}
}
For Smithery
The server is configured to work with Smithery installation. Simply use:
smithery install mcp-namecheap
Available Tools
Domain Management Tools
namecheap_domains_list
Lists 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"
namecheap_domains_check
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)
namecheap_domains_getinfo
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
namecheap_domains_getcontacts
Gets contact information for a domain.
Parameters:
domainName
(required): Domain name to get contacts for
namecheap_domains_create
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")
namecheap_domains_gettldlist
Gets a list of all supported TLDs (Top Level Domains).
No parameters required.
namecheap_domains_setcontacts
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
namecheap_domains_reactivate
Reactivates an expired domain.
Parameters:
domainName
(required): Domain name to reactivateisPremiumDomain
(optional): Whether this is a premium domain (default: false)
namecheap_domains_renew
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)
namecheap_domains_getregistrarlock
Gets the registrar lock status of a domain.
Parameters:
domainName
(required): Domain name to check lock status
namecheap_domains_setregistrarlock
Sets the registrar lock status for a domain.
Parameters:
domainName
(required): Domain name to lock/unlocklockAction
(required): "LOCK" or "UNLOCK"
DNS Management Tools
namecheap_dns_getlist
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")
namecheap_dns_setcustom
Sets custom nameservers for a domain.
Parameters:
sld
(required): Second level domaintld
(required): Top level domainnameservers
(required): Array of nameserver addresses
namecheap_dns_sethosts
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)
Development
Running in Development Mode
npm run dev
Building
npm run build
Testing with MCP Inspector
You can test the server using the MCP Inspector:
npx @modelcontextprotocol/inspector dist/index.js
Security Notes
- Never commit your
.env
file 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
Troubleshooting
"Error 10: Unknown command"
Make sure your API access is enabled in Namecheap and you're using the correct API endpoint.
"Error 11: Authentication failed"
Check that:
- Your API key is correct
- Your username matches the API user
- Your IP is whitelisted in Namecheap
Connection Issues
Ensure the server is running and your MCP client is properly configured with the correct path.
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.