How to Buy a Domain From Claude (Cloudflare MCP, Step by Step)
Claude can search domain availability, register a name, and configure DNS — but only if you install the right MCP and scope its API token correctly. This is the six-step path: scoped token, install the Cloudflare MCP, prompt Claude to search, confirm the purchase, add DNS records, verify after propagation. Works in Claude Desktop and Claude Code.
Goal
Register a domain end-to-end from Claude
Time
~10 min (excl. propagation)
Prereq
Cloudflare account, Claude Desktop or Code, Node.js
Steps
Create a Cloudflare API token scoped to Registrar + DNS
Cloudflare account-level tokens are too broad for an agent. Go to dash.cloudflare.com → My Profile → API Tokens → Create Token → Custom token. Grant exactly: Account → Account Settings → Read, Account → Cloudflare Registrar → Edit, Zone → DNS → Edit (for the zone you will configure). Skip "Account: Edit" — the agent does not need it. Save the token to your password manager; you cannot view it again.
Install the Cloudflare MCP in Claude Desktop
Open Claude Desktop → Settings → Developer → Edit Config. Add the Cloudflare MCP under mcpServers, with the token in an env block (not in args — that leaks into process listings). Fully quit Claude (Cmd+Q on macOS) and reopen. The hammer icon at the bottom of the chat should show the Cloudflare server connected with a green dot.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@cloudflare/mcp-server-cloudflare"],
"env": {
"CLOUDFLARE_API_TOKEN": "your_scoped_token_here"
}
}
}
}Ask Claude to search availability
Start the conversation by asking Claude to check whether your target domain is available. Be specific about the TLD — Cloudflare Registrar supports a curated set (.com, .org, .dev, .ai, etc.) but not every TLD on the internet. If the name is taken, Claude can search for variations and report cost per option.
Use the Cloudflare MCP to check if myapp.dev is available to register. If it is, return the cost. If not, suggest five similar available names with their costs.
Confirm before Claude calls register
Registration moves money. Never let the agent register a domain without an explicit confirmation step in your prompt. Spell out the exact name in the confirmation — do not let the agent infer it. The pattern below makes the agent restate the domain and wait for a "yes" before committing.
Register myapp.dev on Cloudflare. Before calling the register tool, restate the exact domain you are about to register and the cost, and wait for me to reply "yes" before proceeding.
Set name-servers and add an A record
Once registered, the domain needs DNS records to point at your deployment. Cloudflare's default name-servers run on the same account, so this usually means adding records inside the zone rather than changing name-servers. Ask Claude to add an A record (for an IP) or a CNAME (for a Vercel / Netlify deployment hostname).
Add an A record on myapp.dev pointing to 76.76.21.21. Set proxy status to "DNS only" — not proxied.
Verify the records are live
Name-server propagation takes minutes to hours, so do not ask Claude to verify in the same turn. Instead, run dig manually after a few minutes (`dig myapp.dev A +short`) or come back after coffee. If the record is wrong, ask Claude to delete and re-add it — never let an agent "fix" propagation it has no way to influence.
dig myapp.dev A +short
Transfers are irreversible for 60 days
Sample prompt to copy
Paste this into Claude after the MCP is installed. It folds search, confirmation, registration, and DNS into a single multi-turn flow.
Use the Cloudflare MCP. I want to register a domain for a new side project called "myapp". 1. Check whether myapp.dev is available. If yes, report the first-year cost. 2. If unavailable, suggest five available alternatives (.dev, .io, .app, .build, .so) with their costs. 3. Before calling the register tool, restate the exact domain and cost, and wait for me to reply "yes". 4. After registration, add an A record pointing at 76.76.21.21 (Vercel) with proxy status "DNS only". 5. Confirm the registrar lock is enabled. Do not disable it.
When it does not work
Claude says the MCP is not connected
Open Settings → Developer → MCP Logs. The most common cause is a wrong package name or a missing CLOUDFLARE_API_TOKEN env var. Fix the line in claude_desktop_config.json, fully quit Claude, reopen.
The token works in the dashboard but not in Claude
The token is probably scoped to the wrong account or zone. Re-create it with Account → Cloudflare Registrar → Edit, plus Zone → DNS → Edit on the specific zone you are configuring. Account-level read is also required for availability lookups.
Claude refuses to call the register tool
Some prompts trigger a safety refusal because "register" sounds destructive. Re-prompt with explicit context: "I have authorized this purchase. The Cloudflare MCP is installed with my scoped token. Register myapp.dev." Claude proceeds once the intent is unambiguous.
DNS verification fails immediately
Name-server changes propagate over minutes to hours. Do not ask Claude to verify in the same turn — it will see stale data and try to fix what is not broken. Run dig manually after waiting.
FAQ
Does this work in Claude Code as well as Claude Desktop?
Yes. The same Cloudflare MCP server runs in Claude Code via `claude mcp add cloudflare -- npx -y @cloudflare/mcp-server-cloudflare` (with CLOUDFLARE_API_TOKEN exported in your shell). The conversation pattern — search → confirm → register → DNS — is identical.
Can I let the agent skip the confirmation step?
Technically yes; practically no. Registration spends money and a transfer started by an agent is irreversible for 60 days under ICANN rules. The confirmation step costs you one extra message per registration; that is cheap insurance against an autonomous loop that registers fifty domains by mistake.
Why scope the token so narrowly?
An account-level token gives the agent the keys to every zone, every Worker, every R2 bucket, and every Pages deployment in the account. Scoping to "Registrar + the one zone you are working on" caps the blast radius. If the token leaks or the agent goes off the rails, the damage stops at one domain.
What if Cloudflare Registrar does not carry my TLD?
Cloudflare Registrar covers most common TLDs but not all (no .io, no most country TLDs). For uncovered TLDs, use the Name.com MCP (broader inventory, official MCP server) or the Porkbun MCP (at-cost, community-maintained). The conversation pattern is the same — only the install changes.
How do I rotate the API token without losing the MCP connection?
Create a new token with the same scope, update the env block in claude_desktop_config.json (or your shell for Claude Code), fully restart Claude. Then delete the old token in the Cloudflare dashboard. The MCP picks up the new token at launch — there is no live rotation, the restart is mandatory.
More for domains
See the full guide for picking between Cloudflare, Name.com, Porkbun, GoDaddy, and Namecheap.
More guides
Fundamentals
What Is MCP? A Plain-English Guide to Model Context Protocol
6 min read
Setup Guide
Best MCPs for Cursor in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Claude Desktop in 2026 (Ranked + Setup)
9 min read
Setup Guide
Best MCPs for Claude Code in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Windsurf in 2026 (Cascade-Ready Setup)
8 min read
Setup Guide
Best MCPs for VS Code in 2026 (Agent Mode + .vscode/mcp.json)
8 min read
Strategy
MCP Registry vs Curated Directory: Which Should You Use?
5 min read
Setup Guide
Best MCPs for ChatGPT: The Apps and Connectors Worth Installing
9 min read
Tutorial
How to Add an MCP Server to ChatGPT (Developer Mode + Apps Directory)
7 min read
Security
MCP Security: What to Know Before You Install
9 min read
Role Guide
Best MCPs for Marketers in 2026 (SEO, Email, Analytics)
8 min read
Strategy
Remote vs Local MCP Servers: When to Use Each
7 min read
Fundamentals
MCP vs Function Calling: What’s the Difference?
6 min read
Comparison
MCP Directories Compared: Top MCPs vs mcp.so vs PulseMCP vs mcp.directory
8 min read
Security
MCP Prompt Injection: How Tool-Calling Agents Get Hijacked
8 min read
Security
OAuth 2.1 for MCP: What the Spec Standardised and What You Need to Know
8 min read
Security
Sandboxing MCP Servers: Containers, Least Privilege, and Process Isolation
9 min read
Security
Rotating MCP Credentials: A Practical Guide for Leaks, Expiry, and Routine Hygiene
7 min read
Security
Least-Privilege Scoping for MCPs: How to Grant the Smallest Useful Permission
7 min read
Setup Guide
Best MCP Servers for Databases in 2026 (Ranked + Setup)
10 min read
Setup Guide
Best MCP Servers for Research in 2026 (Search, Scrape, Synthesize)
9 min read
Setup Guide
Best MCP Servers for Design-to-Code in 2026 (Figma → React)
9 min read
Setup Guide
Best MCP Servers for Domains in 2026 (Registrars + DNS)
9 min read
Tutorial
How to Search for Domains With an AI Agent (Cross-Registrar Workflow)
7 min read