Namefi

Buy a Domain with Claude: Namefi MCP Step-by-Step Guide

Connect Claude to the Namefi MCP server and register a real domain from one conversation. Exact config, an annotated transcript, and troubleshooting.

Published on July 10, 2026By Namefi Team
  • ai-agents
  • domains
  • guide

By the end of this guide you will have a real domain registered with ICANN, with its DNS pointed at whatever you're building, registered entirely from a conversation with Claude — no browser checkout, no cart, no CAPTCHA. This is the Namefi team's own setup guide for the Namefi MCP server — the human-readable walkthrough of the same API we publish for agents at namefi.io/llms.txt and docs.namefi.io. Where a detail isn't finalized or published yet, this guide says so explicitly rather than guessing.

Third-party walkthroughs of "register a domain with your AI agent" exist — one popular example demonstrates the pattern using a different MCP server built as a reseller on top of Cloudflare's Registrar API. The mechanics of MCP itself are the same idea across providers; this guide is specific to Namefi's own MCP server, its own authentication model, and its own tokenized-domain option, verified against Namefi's documentation rather than a third party's description of it.

What is MCP, briefly

The Model Context Protocol (MCP) is an open standard for connecting an AI application — Claude, in this case — to external tools and data sources: a USB-C port for AI applications is how the protocol's own documentation describes it — one standardized connector instead of a custom integration per tool. Connected to Namefi's MCP server, Claude gains a defined set of callable operations — checking availability, registering a domain, reading and writing DNS records — instead of reverse-engineering a REST API from documentation pasted into the chat.

Prerequisites

  • An MCP-capable Claude client. This guide covers Claude Code (command-line) with concrete, tested commands, and Claude Desktop / claude.ai (via Custom Connectors) with the documented general flow. Other MCP clients, like Cursor or Windsurf, connect to the same server; see the per-agent sections in How to Register a Domain with Your AI Agent on Namefi for those, or the condensed Namefi MCP Quickstart: Claude Code, Cursor & Windsurf if you just need the connection commands.
  • A Namefi API key, generated at namefi.io/api-key, or a crypto wallet if you'd rather pay per-transaction without an API key at all (see the wallet section near the end).
  • A funded NFSC balance if you're registering on Namefi's production environment. NFSC (Namefi Service Credits) is the balance domain registration draws against; Namefi's docs describe topping it up through the Namefi dashboard in production, and requesting free test credits from a faucet endpoint in development environments.

Step 1: Get a Namefi API key

The API key is the simplest authentication path, and it's the one this guide uses throughout: a single header covers every operation — registration, DNS record creation, updates, and deletes. One detail worth internalizing before you generate a key: the key inherits the permissions of the wallet that generated it. If you want to manage DNS for a domain you already own, generate the key from the wallet that owns that domain's NFT — a key generated from a different wallet won't have write access to a domain whose registrant is someone else.

Once generated, the key is a nfk_-prefixed string. You'll pass it as the x-api-key header on every write operation; read-only operations, like an availability check, don't require it at all.

Step 2: Connect Claude to the Namefi MCP server

Namefi, an ICANN-accredited registrar, runs a single MCP server for its entire API surface, at https://api.namefi.io/mcp, reachable over the Streamable HTTP transport. The server exposes every /v-next operation as a typed tool — search, registration, DNS, domain config, outbound — and its existence and connection details are themselves published as a discovery descriptor at namefi.io/.well-known/mcp/servers.json, machine-readable so an agent can find the server without a human first pasting in the URL.

Claude Code

Adding the server to Claude Code is one command:

claude mcp add --transport http namefi https://api.namefi.io/mcp --header "x-api-key: YOUR_KEY"

This matches Claude Code's documented syntax for adding a remote HTTP MCP server with a custom auth header — the general pattern is claude mcp add --transport http <name> <url> --header "<Header-Name>: <value>". Run it once from your terminal (swap YOUR_KEY for the key from Step 1), and Claude Code writes the server into your project's or user's MCP configuration. By default the command registers the server for your current project only; add --scope user if you want it available across every project, or omit the key entirely and add it later if you only need read-only tools like availability search to start.

Confirm the connection with claude mcp list, which should show namefi as connected, and /mcp inside a Claude Code session to see the tool count Namefi's server exposes.

Claude Desktop and claude.ai

Claude Desktop and claude.ai connect to remote MCP servers through Custom Connectors, documented at modelcontextprotocol.io: open Settings, go to Connectors, choose "Add custom connector," and enter the server URL — https://api.namefi.io/mcp. After you click Add, the flow prompts you to complete authentication; per Anthropic's documentation, this step "commonly involves OAuth, API keys, or username/password combinations" depending on what the specific server requires, with Claude presenting whatever prompt the server asks for.

Step 3: Fund your NFSC balance

Domain registration is a paid operation: it requires NFSC (Namefi Service Credits) on the paying wallet. In a development or test environment, a faucet (POST /v-next/user/faucet, or client.user.requestNfscFaucet() in the SDK) hands out free test credits, rate-limited per wallet. In production, NFSC is topped up through the Namefi dashboard. You can check your current balance at any time — either by asking Claude ("what's my Namefi balance?") once connected, or directly against GET /v-next/balance.

Step 4: The purchase conversation

With the MCP server connected and a funded balance, the rest of the flow happens in plain language. Here's an annotated version of what that conversation looks like, mapped to the underlying operation Namefi's API documentation names for each step.

1. You ask Claude to check a name.

"Is example.com available to register?"

Claude calls the availability check (the checkAvailability operation, reachable directly at GET /v-next/search/availability?domain=example.com, no authentication needed). It reports back whether the name is free, and can screen a batch of candidates at once through the bulk-availability variant if you give it several names to compare.

2. You confirm and register.

"Register it for one year and set up DNS to point @ at 203.0.113.10."

Claude submits a registration order (registerDomain, POST /v-next/orders/register-domain) — or, if you asked for DNS records too, the combined register-domain/records variant, applying your requested A record as soon as the order finishes. The request body takes a normalizedDomainName (lowercase, no trailing dot, any TLD search/availability reported as registerable) and a durationInYears (0–10, default 1). An optional nftReceivingWallet controls tokenization — leave it out and the domain registers as an NFT on Base to the wallet tied to your API key. A domainSetupOptions object documents further per-domain overrides, including autoRenew, dnssec, and keepExistingNameservers — the last lets Claude register the domain without repointing its nameserver delegation away from wherever it's currently set.

3. Claude polls until the order finishes.

Registration is asynchronous. Claude (or you, watching status) polls getOrder (GET /v-next/orders/{orderId}) until the order reaches a terminal status: SUCCEEDED, FAILED, CANCELLED, or PARTIALLY_COMPLETED. A typical registration completes in a handful of poll cycles; Claude reports back once it does, rather than leaving you watching a spinner.

4. You ask for more DNS records, if you didn't set them all up-front.

"Also add a CNAME for www pointing at cname.vercel-dns.com., and a TXT record under _verify with this token."

Claude calls createDnsRecord (POST /v-next/dns/records) for each. Two formatting rules are worth knowing before you ask: rdata for CNAME and similar record types must end in a trailing dot (cname.vercel-dns.com.), while zoneName — the domain itself — must not. Getting this backward is the single most common cause of a validation error in this flow.

5. Optional: turn on auto-renewal.

"Turn on auto-renew for this domain."

Claude toggles auto-renewal via PUT /v-next/domain-config/auto-renew. When this is enabled, the domain renews automatically before expiration using the payment methods available on the owner wallet — worth knowing before you turn it on, since it's a standing authorization, not a one-time confirmation.

Step 5: Verify it resolves

DNS propagation isn't instant, so give records a few minutes before checking. DNS reads require no authentication, so you (or Claude) can confirm what's live with GET /v-next/dns/records?zoneName=example.com, or a public DNS lookup tool. If you pointed the domain at a deployment platform, its own domain-verification step (checking for the TXT record it asked for) is a separate confirmation worth doing too.

Paying with a wallet instead of an API key

Everything above uses the API-key path. Namefi also supports registering a domain with a crypto wallet and no Namefi account at all, via the x402 protocol: the buyer's wallet signs an EIP-3009 authorization, the API responds 402 Payment Required with the price if none is attached, and settles registration once a valid payment arrives. That flow deserves its own guide rather than a footnote — see Pay for Domains with a Crypto Wallet: No Account Needed, or the payment section of How to Register a Domain with Your AI Agent on Namefi, for the full detail.

Troubleshooting

SymptomLikely causeFix
401 UNAUTHORIZED on any write callAPI key invalid, expired, or generated from a wallet that doesn't own the domainGenerate a fresh key at namefi.io/api-key using the wallet that owns (or will own) the domain
403 FORBIDDENKey is valid, but the wallet it's tied to doesn't own this specific domainCheck ownership against your Namefi account before retrying
Registration order stuck in a non-terminal statusNormal — registration is asynchronousKeep polling getOrder; Namefi's own examples poll every 5 seconds. Only treat it as stuck if it never reaches SUCCEEDED, FAILED, CANCELLED, or PARTIALLY_COMPLETED
DNS record create/update rejected with a validation errorzoneName has a trailing dot, or a CNAME/MX/NS rdata value is missing its trailing dotzoneName = no trailing dot; FQDN-type rdata values = trailing dot required
Registration fails outrightInsufficient NFSC balance on the paying walletCheck balance (GET /v-next/balance), top up via the faucet (test) or the Namefi dashboard (production)
Claude says it has no domain tools availableMCP server not connected, or connected without the header needed for write operationsRe-run claude mcp add with the --header flag, or check /mcp / claude mcp list for connection status

Frequently Asked Questions

Do I need to know Namefi's REST API to use this, or can I just talk to Claude in plain language?

Plain language is enough for the whole flow above — "is this domain available," "register it," "point it at this IP" all work as direct requests. The endpoints and request fields in this guide are documented so you can verify what Claude is doing under the hood, or call them directly yourself if you're scripting instead of chatting.

Does registering through Claude cost more than registering through Namefi's website?

This guide doesn't claim a price comparison one way or the other. Either way, registration draws against the same NFSC balance whether the request came from a browser, a script, or an MCP tool call.

Is my domain automatically tokenized as an NFT when I register it this way?

Yes, by default. If you don't specify an nftReceivingWallet in the registration request, the domain registers as an NFT to the wallet tied to your API key, on Base. You can redirect it to a different wallet or chain at registration time.

What happens if Claude's DNS record request has a typo — can it break my domain silently?

DNS writes go through Namefi's validation before they're applied, and malformed rdata (a missing trailing dot on a CNAME target, for instance) is rejected with an error rather than silently accepted — see the troubleshooting table above. Still, treat DNS changes to a live domain the way you'd treat any infrastructure change: review what Claude is about to submit before confirming.

Can I use this same MCP server with Cursor or Windsurf instead of Claude?

Yes — Namefi's server speaks the same open MCP protocol regardless of which client connects, so the server side doesn't change. The client-side connection commands differ per editor; see the per-client config sections in How to Register a Domain with Your AI Agent on Namefi, or the shorter Namefi MCP Quickstart: Claude Code, Cursor & Windsurf.

Buy your next domain from a conversation

This is the exact setup Namefi supports today, not a hypothetical. Once the MCP server is connected, everything from searching a name to registering it, setting DNS, and (optionally) turning it into a wallet-held token happens without leaving the chat. The MCP server exposes more than registration — outbound lead-finding, batch DNS operations, domain configuration — all discoverable from the same connection once you're set up — see Namefi MCP Server: Domain Tools for AI Agents for the full tool catalog.

Generate a Namefi API key and connect Claude.

Sources and further reading

About the author(s)

Namefi Team
Namefi Team • Namefi

Namefi is a collective of engineers, designers, and operators who obsess over building tools that make managing your onchain domain names effortless.

Related guides