MCP server for interacting with Namecheap API
概览
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. - : List domains, check availability, get domain information - : Get and set DNS records, configure custom nameservers - : API keys stored in environment variables - : Supports both production and sandbox Namecheap APIs - : 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) 4. Edit .env and add your Namecheap API credentials: : You must whitelist your IP address in the Namecheap API settings. Add the server to your MCP client configuration: Edit ~/Library/Application Support/Claude/claude_desktop_config.
README
以下为原文 README 节选,完整内容请查看原文。
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
.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=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.
安装
docker run -i \配置
{
"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"
}
}
}
}