Cloudflare DNS MCP Server
Allows management of Cloudflare DNS zones and records, enabling operations such as listing zones, creating, reading, updating, and deleting DNS records, with support for Cloudflare proxy and filtering by type, name, or zone.
Click on "Deploy 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 MCP Server list all my DNS zones"
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 Server
A powerful Model Context Protocol (MCP) server for managing Cloudflare DNS zones and records via API. This server enables AI assistants like Claude to manage DNS records directly through Cloudflare's API.
Features
🌐 Zone Management: List and inspect DNS zones
📝 DNS Records: Create, read, update, and delete DNS records
🔍 Smart Filtering: Filter records by type, name, or zone
☁️ Cloudflare Proxy: Support for Cloudflare's proxy features
🛡️ Secure: Environment-based authentication
⚡ Fast: Direct API integration with minimal overhead
Related MCP server: Cloudflare Control
Quick Start
Run the server directly with npx (requires Node.js 18+):
npx @artik0din/mcp-cloudflare-dnsOr install locally:
npm install -g @artik0din/mcp-cloudflare-dns
mcp-cloudflare-dnsEnvironment Variables
Create a .env file in your working directory:
Variable | Required | Description |
| ✅ | Your Cloudflare API token with Zone:Read and DNS:Edit permissions |
| ❌ | Default zone ID (can be provided per request) |
Getting Your Cloudflare API Token
Click "Create Token"
Use "Custom Token" with these permissions:
Zone Resources: Include All zones (or specific zones)
Permissions: Zone:Read, DNS:Edit
MCP Client Configuration
Claude Desktop
Add this to your Claude Desktop configuration:
{
"mcpServers": {
"cloudflare-dns": {
"command": "npx",
"args": ["@artik0din/mcp-cloudflare-dns"],
"env": {
"CLOUDFLARE_API_TOKEN": "your_api_token_here",
"CLOUDFLARE_ZONE_ID": "your_zone_id_here"
}
}
}
}Other MCP Clients
Use the command npx @artik0din/mcp-cloudflare-dns with the appropriate environment variables set.
Available Tools
cloudflare_list_zones
List all DNS zones accessible to your API token.
Parameters: None
Example:
List all my Cloudflare zonescloudflare_get_zone
Get detailed information about a specific DNS zone.
Parameters:
zoneId(string, required): Zone ID to get details for
Example:
Get details for zone abc123def456cloudflare_list_dns_records
List DNS records for a specific zone with optional filtering.
Parameters:
zoneId(string, optional): Zone ID (uses default if not provided)type(string, optional): Filter by record type (A, AAAA, CNAME, MX, TXT, etc.)name(string, optional): Filter by record name
Example:
List all A records for my zone
List DNS records of type MX for zone abc123def456
Show all records for www.example.comcloudflare_create_dns_record
Create a new DNS record in a zone.
Parameters:
type(string, required): Record type (A, AAAA, CNAME, MX, TXT, etc.)name(string, required): Record name (e.g., www.example.com or @)content(string, required): Record content (IP, hostname, text, etc.)zoneId(string, optional): Zone ID (uses default if not provided)ttl(number, optional): TTL in seconds (1 = auto, 120-7200)priority(number, optional): Priority for MX recordsproxied(boolean, optional): Enable Cloudflare proxycomment(string, optional): Comment for the record
Example:
Create an A record for www pointing to 1.2.3.4
Create a CNAME record for blog pointing to www.example.com with TTL 3600
Add an MX record for @ pointing to mail.example.com with priority 10cloudflare_update_dns_record
Update an existing DNS record.
Parameters:
recordId(string, required): DNS record ID to updatetype(string, optional): New record typename(string, optional): New record namecontent(string, optional): New record contentzoneId(string, optional): Zone ID (uses default if not provided)ttl(number, optional): New TTL in secondspriority(number, optional): New priority for MX recordsproxied(boolean, optional): Enable/disable Cloudflare proxycomment(string, optional): New comment
Example:
Update record abc123 to point to IP 5.6.7.8
Change the TTL of record def456 to 3600 seconds
Enable proxy for record ghi789cloudflare_delete_dns_record
Delete a DNS record.
Parameters:
recordId(string, required): DNS record ID to deletezoneId(string, optional): Zone ID (uses default if not provided)
Example:
Delete DNS record abc123
Remove record def456 from zone ghi789Security Considerations
API Token Security: Never commit your API token to version control
Minimal Permissions: Use API tokens with minimal required permissions
Zone Restrictions: Consider restricting API tokens to specific zones
Regular Rotation: Rotate API tokens regularly
Environment Variables: Always use environment variables for credentials
Development
# Clone the repository
git clone https://github.com/artik0din/mcp-cloudflare-dns.git
cd mcp-cloudflare-dns
# Install dependencies
npm install
# Build the project
npm run build
# Run locally
npm startLicense
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Credits
Built with the Model Context Protocol SDK and Cloudflare API.
Available Tools
6 toolscloudflare_create_dns_recordC
Create a new DNS record in a zone
Inputs: type (required), name (required), content (required), zoneId, +4 more.
cloudflare_delete_dns_recordB
Delete a DNS record
Inputs: recordId (required), zoneId.
cloudflare_get_zoneB
Get details for a specific DNS zone
Inputs: zoneId (required).
cloudflare_list_dns_recordsB
List DNS records for a zone
Inputs: zoneId, type, name.
cloudflare_list_zonesA
List all DNS zones accessible to the API token
Inputs: no named parameters.
cloudflare_update_dns_recordC
Update an existing DNS record
Inputs: recordId (required), zoneId, type, name, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action (create, delete, get, list, update) on specific resources (DNS records or zones), with no overlap in functionality.
All tools follow a consistent 'cloudflare_verb_noun' pattern using snake_case, making them predictable and easy to differentiate.
Six tools is well-scoped for a DNS management server, covering essential CRUD operations without unnecessary bloat or gaps.
The set provides full CRUD for DNS records plus zone listing and details, covering the core lifecycle needs for DNS management.
Maintenance
Related MCP Connectors
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Register, transfer and manage domain names and DNS from your AI agent.
Connect custom domains via AI agents: DNS pre-flight checks, hand-off connect sessions and checks.
Buy & manage domains from any AI chat: availability, register, DNS, email forwarding, AI bot stats.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Cloudflare resources through natural language, including DNS records, zone management, Workers KV storage, cache purging, and analytics. Supports comprehensive Cloudflare operations with secure API token authentication.132MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Cloudflare infrastructure including DNS records, cache purging, SSL settings, Workers, and analytics through the Cloudflare API. Eliminates dashboard context-switching by allowing natural language control of domain management and infrastructure operations.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with the Cloudflare REST API for managing DNS records, zones, and other Cloudflare resources.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Cloudflare DNS records, including listing zones and records, and creating, updating, or deleting DNS records.681 npmMIT