Namecheap网页界面管理服务

一个用于通过Namecheap网页界面进行域名和DNS管理的服务器,无需API密钥和IP白名单,支持多种操作如域名列表查询、DNS记录管理等。

  • by Microck
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Microck/namecheap-webui-mcp

使用说明

namecheap webui mcp

MCP服务器,用于通过正常的web仪表板管理Namecheap(没有Namecheap API密钥,没有IP允许列表)。

此服务器使用新的Playwright会话和保存的身份验证状态(storage-state.json)因此,读/写在调用之间生存,而不依赖于脆弱的持久浏览器配置文件。

快速开始

npm install
npx playwright install chromium
npm run build
npm start

工具

工具 目的
namecheap_webui_status 检查是否已登录保存的身份验证状态
namecheap_webui_login 用户名/密码登录+选项2 FA提交
namecheap_webui_import_cookies 导入完整的登录cookie集
namecheap_webui_query 打开仪表板视图并返回文本快照
namecheap_dashboard_list_options 列出当前可见的仪表板链接
namecheap_domains_list 从域列表中列出域
namecheap_domain_get_overview 阅读域管理概述
namecheap_domain_get_nameservers 读取名称服务器模式和自定义名称服务器
namecheap_domain_set_nameservers 设置基本/免费/高级/自定义名称服务器
namecheap_domain_get_features 读取自动续订/域锁定/whois隐私状态
namecheap_domain_set_feature 设置其中一个功能切换
namecheap_dns_get_records 读取高级DNS主机记录
namecheap_dns_set_records 附加/替换高级DNS主机记录

支持的仪表板视图(namecheap_webui_query)

  • account
  • domains
  • expiring
  • hosting
  • private-email
  • ssl-certificates
  • apps
  • my-offers
  • profile
  • growth-tools
  • advanced-dns (要求 domainName)
  • domain-manage (要求 domainName)

环境

复制 .env.example 必要时进行调整:

cp .env.example .env
  • NAMECHEAP_BASE_URL (默认值 https://www.namecheap.com)
  • NAMECHEAP_LOGIN_URL (默认值 https://www.namecheap.com/myaccount/login/)
  • NAMECHEAP_ACCOUNT_URL (默认值 https://ap.www.namecheap.com/)
  • NAMECHEAP_USER_DATA_DIR (默认值 .namecheap-profile)
  • NAMECHEAP_BROWSER_EXECUTABLE_PATH (可选,例如。 /usr/bin/chromium-browser)
  • NAMECHEAP_HEADLESS (默认值 true)
  • NAMECHEAP_SLOW_MO (默认值 0)
  • NAMECHEAP_NAVIGATION_TIMEOUT_MS (默认值 30000)

登录流程

  1. 呼叫 namecheap_webui_login 随着 username + password
  2. 如果结果是 two-factor-required,再次致电 twoFactorCode
  3. 证实 namecheap_webui_status

如果您的主机上的反机器人摩擦阻止了直接登录,请导入一个完整登录的cookie集 namecheap_webui_import_cookies.

推荐的安全工作流程

  1. namecheap_webui_status
  2. namecheap_domain_get_overview / namecheap_domain_get_nameservers
  3. namecheap_dns_get_records
  4. namecheap_dns_set_records (更喜欢 append)

对于域级别更改:

  1. namecheap_domain_get_features
  2. namecheap_domain_set_feature

mcp配置示例

{
  "mcp": {
    "namecheap-webui": {
      "type": "local",
      "enabled": true,
      "command": ["node", "/absolute/path/namecheap-webui-mcp/dist/index.js"],
      "environment": {
        "NAMECHEAP_USER_DATA_DIR": "/absolute/path/namecheap-webui-mcp/.namecheap-profile",
        "NAMECHEAP_HEADLESS": "true",
        "NAMECHEAP_NAVIGATION_TIMEOUT_MS": "30000"
      }
    }
  }
}

限制

  • 依赖于实时Namecheap标记和标签;UI更改时,选择器可能需要更新
  • 批量操作仍然被建模为单域操作
  • 在允许编辑之前,某些帐户/域可能需要额外的验证对话框