这是一个为 Cursor AI 接口提供 Cursor MCP(模型上下文协议)集成的 Namecheap 域名 API。借助该 API,您能够检查域名可用性、获取定价信息,还能直接通过 Cursor 注册域名。
此工具默认使用 Namecheap 的实时 API,进行实际的域名购买。在运行脚本之前,请务必仔细阅读文档,并理解所有可能的安全注意事项。
npm install namecheap-api cursor-mcp
.env 文件
在项目根目录下创建一个 .env 文件,并添加以下内容:NAMECHEAP_API_KEY=your_api_key_here
NAMECHEAP_USERNAME=your_username_here
REGISTRANT_PROFILE=registrant-profile.json
registrant-profile.json 文件,确保包含以下字段:{
"name": "John Doe",
"address1": "123 Main St",
"city": "Anytown",
"state": "CA",
"postalcode": "12345",
"country": "US",
"phonenumber": "+1.5555555555",
"email": "email@example.com"
}
node check-availability.js example.com anotherexample.net
node get-pricing.js example.com
注册过程分为两步,以确保安全:
node register-domain.js --step=1 example.com
confirm。为了测试目的,在 .env 文件中设置:
NODE_ENV=sandbox
这将使用 Namecheap 的沙盒 API 环境,不会进行实际购买。请确保您拥有独立的沙盒 API 凭证。
登录您的 Namecheap 账户,进入“用户中心” > “API”部分,生成新的 API 密钥。
确保您的 API 密钥具有以下权限:
registrant-profile.json 文件是否存在。本项目遵循 MIT 许可证 - 请查看 LICENSE 文件以获取详细信息。
欢迎任何贡献!请参阅 CONTRIBUTING.md 了解如何为该项目做出贡献。
⚠️ 重要提示
此工具默认使用 Namecheap 的实时 API,进行实际的域名购买。确保在运行脚本之前,您已经仔细阅读了文档,并且理解所有可能的安全注意事项。