Skip to content
← Back to the app

How to use Cloudflare Domains Toolkit

Cloudflare Domains Toolkit

Set up the Registrar MCP server and DNS CLI, check a domain and manage records in your own zones.

Free to read. You can explore the guide before buying the app.

On this page

Cloudflare Domains Toolkit contains two local programs. The MCP server helps an AI client search and register domains. The cf-domains command manages DNS records for zones already in your Cloudflare account.

Get the source

After purchase, connect GitHub in Polar and accept the invitation. Clone the customer repository. You need Node.js 20 or later.

The repository has an mcp directory and a cli directory, each with its own dependencies and focused README. Keep separate Cloudflare tokens for Registrar and DNS work.

Set up the Registrar server

From the repository’s mcp directory, install and build:

npm install
npm run build
npm run smoke

The smoke test checks that an MCP client can start the server and discover its tools. It does not buy a domain.

Create a Cloudflare user API token with Registrar write permission, scoped to the account you intend to use. On macOS, save it through the supplied prompt:

npm run keychain:store

The default login Keychain service is cloudflare.domain-registrar-mcp, with your macOS username as the account. Keep the token outside the source directory.

Your Cloudflare account also needs its Registrar setup completed, including a payment method and registrant contact, before a registration can succeed.

Connect your MCP client

Find the absolute paths to Node and the built server:

which node
pwd

Configure a stdio MCP server in your client. Use the Node executable as its command and the absolute path to mcp/dist/server.js as its argument. Set these environment values in that server entry:

SettingValue
CLOUDFLARE_ACCOUNT_IDYour Cloudflare account ID
CLOUDFLARE_KEYCHAIN_SERVICEcloudflare.domain-registrar-mcp
CLOUDFLARE_KEYCHAIN_ACCOUNTYour macOS username

The source includes ready-to-edit Cursor and Codex configuration examples in mcp/examples/. Merge the server entry into your existing client configuration, replace the paths and identifiers, then restart the client.

On other systems, supply CLOUDFLARE_API_TOKEN through your client’s secret provider. Do not commit the token to a configuration file.

Check a domain before buying

Ask your client to check an exact domain you are considering. For example: “Check whether northstarstudio.dev is available. Do not buy it.” This is an example name, not a recommendation or a claim of availability.

The tools have distinct effects:

ToolWhat it does
search_domainsSuggests possible names
check_domain_availabilityChecks one name and its current pricing
quote_domain_purchaseCreates a short-lived quote
purchase_domainRechecks the quote and asks for approval before registering

Request an authoritative availability check and quote for the name you choose from the suggestions.

The included purchase policy rejects premium domains, non-USD charges and complete initial charges above $20. Quotes expire after five minutes and are single-use. The client must support MCP form elicitation to display the purchase approval.

Read the exact domain, term and charge in that approval. Domain registration is a separate, billable, non-refundable purchase from Cloudflare. The toolkit’s price does not include a domain. The registration request disables auto-renewal, so review the resulting renewal settings in your Cloudflare account.

Install the DNS CLI

From the repository’s cli directory:

npm install
npm link
cf-domains --help

Create a separate token with Zone Read and DNS Edit permissions, limited to the zones you want to manage. Save and verify it through the CLI:

cf-domains auth login
cf-domains auth status
cf-domains zones

The default Keychain service for this token is cloudflare.domains-cli.

Inspect and change DNS

Replace northstar.example below with a zone you own. List its records before changing anything:

cf-domains records northstar.example

For a first test, add a harmless TXT record under a new name:

cf-domains add northstar.example --type TXT --name toolkit-check --content 'first test'

List the records again and copy that record’s ID. Update just its content:

cf-domains update northstar.example RECORD_ID --content 'second test'

Replace RECORD_ID with the returned ID. Delete the test record when finished:

cf-domains delete northstar.example RECORD_ID

Deletion asks for confirmation. Save the original record values before modifying production DNS, since changes can interrupt websites or email.

Troubleshooting

A missing zone usually means the token cannot access it, or the domain is not a zone in that account. Registrar authentication and DNS authentication are separate.

If the MCP server closes immediately, check the absolute paths and build it again. If a quote expires, request another. Read-only MCP tools can work without elicitation support, but purchases cannot.