cloudflare-dns-mcp
Allows managing Cloudflare DNS records: check subdomain availability, claim subdomains by creating A records, release subdomains, and list registered subdomains under a root domain.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cloudflare-dns-mcpcheck if blog.example.com is available"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cloudflare-dns-mcp
An MCP server that lets an LLM check, claim, release, and list subdomains under a root domain, backed by the Cloudflare DNS API. Runs over stdio (local, default) or streamable HTTP (remote, behind a bearer token).
Tools
check_subdomain_availability — check whether
<subdomain>.<root_domain>already has a DNS record.request_domain — claim
<subdomain>.<root_domain>by creating an A record pointing at an IPv4 address. Fails if the subdomain is already taken.release_subdomain — delete the DNS record for
<subdomain>.<root_domain>, freeing it up again.list_subdomains — list every record under
<root_domain>currently registered.
Related MCP server: Cloudflare MCP Server
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCopy .env.example to .env and fill in your Cloudflare credentials:
cp .env.example .envVariable | Required | Description |
| yes | Cloudflare API token with |
| yes | Zone ID of the domain in Cloudflare. |
| yes | Root domain that subdomains are created under, e.g. |
| no | Overrides the Cloudflare API base URL. Defaults to |
Running
By default the server runs over stdio, meant to be launched by an MCP client rather than run standalone:
python main.pyTo run it as a standalone remote server over streamable HTTP instead, set MCP_TRANSPORT=http
plus a shared-secret MCP_HTTP_TOKEN (see .env.example):
MCP_TRANSPORT=http MCP_HTTP_HOST=0.0.0.0 MCP_HTTP_PORT=8000 MCP_HTTP_TOKEN=a-long-random-secret python main.pyMCP_HTTP_TOKEN is required in HTTP mode — the server refuses to start without it, since it
can create and delete DNS records and must not be exposed unauthenticated. Every request needs
Authorization: Bearer <token>; requests without it (or with the wrong token) get a 401. Put a
reverse proxy with TLS in front of it if it's reachable from the public internet.
Claude Code
claude mcp add cloudflare-dns /path/to/.venv/bin/python /path/to/main.py \
--env CLOUDFLARE_API_TOKEN_DNS=your-token \
--env CLOUDFLARE_ZONE_ID=your-zone-id \
--env CLOUDFLARE_ROOT_DOMAIN=example.comOr add it by hand to .mcp.json (project scope) or ~/.claude.json (user scope):
{
"mcpServers": {
"cloudflare-dns": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/main.py"],
"env": {
"CLOUDFLARE_API_TOKEN_DNS": "your-token",
"CLOUDFLARE_ZONE_ID": "your-zone-id",
"CLOUDFLARE_ROOT_DOMAIN": "example.com"
}
}
}
}If the server is running remotely over HTTP instead:
claude mcp add --transport http cloudflare-dns https://your-host/mcp \
--header "Authorization: Bearer your-mcp-http-token"or in .mcp.json:
{
"mcpServers": {
"cloudflare-dns": {
"type": "http",
"url": "https://your-host/mcp",
"headers": {
"Authorization": "Bearer your-mcp-http-token"
}
}
}
}opencode
Add to opencode.json (project) or ~/.config/opencode/opencode.json (global):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cloudflare-dns": {
"type": "local",
"command": ["/path/to/.venv/bin/python", "/path/to/main.py"],
"enabled": true,
"environment": {
"CLOUDFLARE_API_TOKEN_DNS": "your-token",
"CLOUDFLARE_ZONE_ID": "your-zone-id",
"CLOUDFLARE_ROOT_DOMAIN": "example.com"
}
}
}
}If the server is running remotely over HTTP instead, use type: "remote":
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cloudflare-dns": {
"type": "remote",
"url": "https://your-host/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer your-mcp-http-token"
}
}
}
}Other MCP clients
Generic stdio client config:
{
"mcpServers": {
"cloudflare-dns": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/main.py"],
"env": {
"CLOUDFLARE_API_TOKEN_DNS": "...",
"CLOUDFLARE_ZONE_ID": "...",
"CLOUDFLARE_ROOT_DOMAIN": "example.com"
}
}
}
}Generic streamable HTTP client config:
{
"mcpServers": {
"cloudflare-dns": {
"type": "http",
"url": "https://your-host/mcp",
"headers": {
"Authorization": "Bearer your-mcp-http-token"
}
}
}
}Security
Never commit your .env file — it contains a Cloudflare API token that can edit DNS records
for your zone. .gitignore already excludes it; only .env.example (with placeholder values)
is tracked.
If you run the HTTP transport, MCP_HTTP_TOKEN is the only thing standing between the
internet and DNS write access to your zone — treat it like the Cloudflare token itself
(long/random, not committed, rotated if it ever leaks), and put it behind TLS.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-quality-maintenanceA lightweight MCP server for managing DNS records, purging cache, and interacting with the Cloudflare API through natural language commands.24

Cloudflare MCP Serverofficial
Alicense-qualityAmaintenanceA token-efficient MCP server that provides access to the entire Cloudflare API (2500+ endpoints) using a code execution pattern, enabling natural language management of Cloudflare services.8713Apache 2.0- Alicense-qualityDmaintenanceMCP server for domainagent.dev, enabling AI agents to search, register, deploy, host, and manage domains with USDC payment on Base via x402. Supports static site deployment via Cloudflare Pages and DNS management.16MIT
- Alicense-qualityBmaintenanceCloudflare DNS MCP server. Manage zones, DNS records, cache, and page rules from Claude, Cursor, Codex, or any MCP-compatible AI assistant.MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hanzla-Double3/cloudflare-mcp-dns'
If you have feedback or need assistance with the MCP directory API, please join our Discord server