Name.com Domain Registrar & DNS Manager
MCP server providing nine tools for domain registration and DNS management against the Name.com CORE API (v1).
Environment Variables
Set credentials before starting the server:
| Variable | Required | Description |
|---|
| INLINECODE0 | Yes | Name.com account username |
| INLINECODE1 |
Yes | Name.com API token |
|
NAMECOM_USERNAME_TEST | Optional | Sandbox username (no real charges) |
|
NAMECOM_TOKEN_TEST | Optional | Sandbox API token |
Generate tokens at Account > Security > API Access. For sandbox testing, create sandbox credentials there and set only NAMECOM_USERNAME_TEST and NAMECOM_TOKEN_TEST (leave production vars unset); the server then targets the sandbox API.
Security & trust
- - Token scope: Authenticates via standard Name.com API token. Name.com does not currently offer per-operation token scopes; the recommended hardening is IP whitelisting (Account > Security > API Access) to restrict the token to your deployment environment. Use sandbox credentials during initial setup.
- Purchases:
register_domain enforces a code-level human-in-the-loop gate — it is not possible to complete a purchase without first calling dryRun: true. The dry-run response includes a one-time purchaseToken (6-digit code, valid 10 minutes, single-use, bound to the specific domain). The actual purchase call requires passing that token back; without it the tool returns an error. This is not just a documented guideline — the token gate is enforced in code. For production, fund the account with Name.com account credit instead of attaching a credit card when possible — that limits exposure if credentials are ever compromised. Otherwise use a payment method with spending limits or alerts. - Install & supply chain: This skill installs the npm package
namecom-clawbot. The package is published with signed npm provenance (GitHub Actions), so you can verify on the npm package page that the build matches the GitHub repo. Review the repo and package before installing. To limit risk, run the MCP server in an isolated environment (e.g. container or VM) and use sandbox credentials first.
Running the Server
CODEBLOCK0
Or add to your MCP host config:
CODEBLOCK1
Tools
check_domain
Check availability and pricing for up to 50 specific domain names at once. Returns purchase price (USD), renewal price, and premium status.
Always call this before register_domain to confirm availability and get pricing for premium domains.
search_domain
Keyword-based domain search. Provide a keyword and optionally filter by TLDs to get suggested available domain names with pricing. Use this when the user wants to brainstorm names rather than check a specific one.
register_domain
Provisions and registers a domain via the account’s payment settings. Automatically enables WHOIS privacy and registrar lock.
Required confirmation flow (enforced in code):
- 1. Call with
dryRun: true — returns a quote (domain, years, estimated cost) plus a purchaseToken. No charge made. - Show the user the quote and get explicit confirmation.
- Call again with
dryRun: false and pass the purchaseToken from step 1.
The purchaseToken is a one-time 6-digit numeric code (e.g. 847291) valid for 10 minutes and bound to the specific domain name — easy to relay via Telegram, WhatsApp, or read aloud. Passing an incorrect, expired, or already-used token returns an error. You cannot skip to step 3 — there is no way to complete a purchase without a valid token from a prior dry-run.
For premium domains, pass the purchasePrice and purchaseType values from check_domain. For safety, prefer funding the Name.com account with account credit rather than a credit card when possible.
list_domains
List all domains in the account with expiration dates, autorenew/lock/privacy status. Use to see what the user already owns.
get_domain
Get detailed info for a single domain — contacts, nameservers, expiration, renewal pricing.
set_nameservers
Replace a domain's nameservers. Use when pointing a domain to Cloudflare, Route 53, Fly.io DNS, etc.
manage_dns
Create, delete, or list DNS records. Supported types: A, AAAA, CNAME, MX, TXT, ANAME, NS, SRV.
- - Use
action="list" to see all records and get record IDs for deletion - Use
host="" or host="@" for apex records, host="*" for wildcard - MX and SRV records require INLINECODE31
solve_dns01_challenge
End-to-end ACME DNS-01 challenge workflow:
- 1. Creates
_acme-challenge TXT record with the challenge digest - Polls Google DNS and Cloudflare DNS every 5s until global propagation (up to 2 min)
- Cleans up the TXT record on timeout or error
Returns the recordId so the caller can delete the record after certificate validation completes.
update_ddns
Dynamic DNS updater for residential/home-lab IPs:
- 1. Detects the machine's current public IPv4 via ipify
- Finds the existing A record for the given host
- Updates it if the IP changed, creates it if none exists, or skips if already correct
Example Workflows
Find and buy a cheap .dev domain, set up a wildcard A record:
- 1.
search_domain with keyword="coolproject", INLINECODE38 - Pick the cheapest purchasable result
- INLINECODE39 with the chosen name
- INLINECODE40 →
action="create", host="*", type="A", INLINECODE44
See what domains you already own and check one's details:
- 1.
list_domains to get the full inventory - INLINECODE46 with a specific domain to see contacts, nameservers, expiration
Update DDNS after IP change:
- 1.
update_ddns with domainName="example.com", INLINECODE49 - Tool auto-detects the new public IP and patches the A record
Solve an ACME DNS-01 challenge for Let's Encrypt:
- 1.
solve_dns01_challenge with domainName="example.com", INLINECODE52 - Wait for the tool to confirm propagation
- Complete ACME validation with the CA
- INLINECODE53 →
action="delete", recordId=<id from step 1> to clean up
Name.com 域名注册商与 DNS 管理器
MCP 服务器,提供九个用于域名注册和 DNS 管理的工具,基于 Name.com CORE API (v1)。
环境变量
启动服务器前设置凭据:
| 变量 | 必填 | 描述 |
|---|
| NAMECOMUSERNAME | 是 | Name.com 账户用户名 |
| NAMECOMTOKEN |
是 | Name.com API 令牌 |
| NAMECOM
USERNAMETEST | 否 | 沙箱用户名(不产生实际费用) |
| NAMECOM
TOKENTEST | 否 | 沙箱 API 令牌 |
在 账户 > 安全 > API 访问 生成令牌。进行沙箱测试时,在此处创建沙箱凭据并仅设置 NAMECOMUSERNAMETEST 和 NAMECOMTOKENTEST(不设置生产环境变量);服务器将指向沙箱 API。
安全与信任
- - 令牌范围: 通过标准 Name.com API 令牌进行身份验证。Name.com 目前不提供按操作划分的令牌范围;推荐的加固措施是 IP 白名单(账户 > 安全 > API 访问),将令牌限制在您的部署环境。初始设置时使用沙箱凭据。
- 购买: registerdomain 强制执行代码级人工审核机制——必须先调用 dryRun: true 才能完成购买。试运行响应包含一次性 purchaseToken(6 位代码,有效期 10 分钟,一次性使用,绑定到特定域名)。实际购买调用需要传回该令牌;没有令牌工具将返回错误。这不仅是文档中的指南——令牌机制在代码中强制执行。对于生产环境,使用 Name.com 账户余额充值,而非绑定信用卡——这样即使凭据泄露也能限制风险。否则请使用设有消费限额或提醒的支付方式。
- 安装与供应链: 本技能安装 npm 包 namecom-clawbot。该包使用签名 npm 来源证明(GitHub Actions)发布,因此您可以在 npm 包页面 验证构建是否与 GitHub 仓库 匹配。安装前请审查仓库和包。为限制风险,请在隔离环境(如容器或虚拟机)中运行 MCP 服务器,并首先使用沙箱凭据。
运行服务器
bash
安装与构建
npm install && npm run build
运行(stdio 传输——供 Cursor 等 MCP 主机使用)
node dist/src/index.js
或添加到您的 MCP 主机配置:
json
{
mcpServers: {
namecom-registrar: {
command: node,
args: [dist/src/index.js],
env: {
NAMECOM_USERNAME: <您的用户名>,
NAMECOM_TOKEN: <您的 API 令牌>
}
}
}
}
工具
check_domain
一次性检查最多 50 个特定域名的可用性和定价。返回购买价格(美元)、续费价格和溢价状态。
在 register_domain 之前务必调用此工具,以确认可用性并获取溢价域名的定价。
search_domain
基于关键词的域名搜索。提供关键词,并可选择按顶级域筛选,获取建议的可用域名及定价。当用户希望头脑风暴域名而非检查特定域名时使用。
register_domain
通过账户的支付设置配置并注册域名。自动启用 WHOIS 隐私和注册商锁定。
必需的确认流程(代码强制执行):
- 1. 使用 dryRun: true 调用——返回报价(域名、年限、预估费用)及 purchaseToken。不产生费用。
- 向用户展示报价并获取明确确认。
- 使用 dryRun: false 再次调用,并传入步骤 1 中的 purchaseToken。
purchaseToken 是一次性 6 位数字代码(例如 847291),有效期 10 分钟,绑定到特定域名——便于通过 Telegram、WhatsApp 转发或口头传达。传入错误、过期或已使用的令牌将返回错误。无法跳过步骤 3——没有来自先前试运行的有效令牌就无法完成购买。
对于溢价域名,传入 check_domain 中的 purchasePrice 和 purchaseType 值。为安全起见,建议使用账户余额为 Name.com 账户充值,而非信用卡。
list_domains
列出账户中所有域名及其过期日期、自动续费/锁定/隐私状态。用于查看用户已拥有的域名。
get_domain
获取单个域名的详细信息——联系人、名称服务器、过期时间、续费定价。
set_nameservers
替换域名的名称服务器。当将域名指向 Cloudflare、Route 53、Fly.io DNS 等服务时使用。
manage_dns
创建、删除或列出 DNS 记录。支持的类型:A、AAAA、CNAME、MX、TXT、ANAME、NS、SRV。
- - 使用 action=list 查看所有记录并获取记录 ID 以便删除
- 对根域记录使用 host= 或 host=@,对通配符使用 host=*
- MX 和 SRV 记录需要 priority
solvedns01challenge
端到端 ACME DNS-01 挑战工作流:
- 1. 创建包含挑战摘要的 _acme-challenge TXT 记录
- 每 5 秒轮询 Google DNS 和 Cloudflare DNS,直到全球传播完成(最长 2 分钟)
- 超时或出错时清理 TXT 记录
返回 recordId,以便调用方在证书验证完成后删除记录。
update_ddns
面向家庭/实验室 IP 的动态 DNS 更新器:
- 1. 通过 ipify 检测机器的当前公网 IPv4
- 查找指定主机的现有 A 记录
- 如果 IP 变更则更新,不存在则创建,已正确则跳过
示例工作流
查找并购买便宜的 .dev 域名,设置通配符 A 记录:
- 1. 使用 keyword=coolproject、tldFilter=[dev, app] 调用 searchdomain
- 选择最便宜的可购买结果
- 使用所选名称调用 registerdomain
- 调用 manage_dns → action=create、host=*、type=A、answer=
查看已拥有的域名并检查详细信息:
- 1. 调用 listdomains 获取完整列表
- 使用特定域名调用 getdomain 查看联系人、名称服务器、过期时间
IP 变更后更新 DDNS:
- 1. 使用 domainName=example.com、host=home 调用 update_ddns
- 工具自动检测新公网 IP 并更新 A 记录
为 Lets Encrypt 解决 ACME DNS-01 挑战:
- 1. 使用 domainName=example.com、challengeValue=<摘要> 调用 solvedns01challenge
- 等待工具确认传播完成
- 向证书颁发机构完成 ACME 验证
- 调用 manage_dns → action=delete、recordId=<步骤 1 中的 ID> 进行清理