Cloudflare DNS MCP Server
Enables AI assistants to manage Cloudflare DNS zones and records, including listing, creating, updating, and deleting DNS records through natural language.
README
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
Quick Start
Run the server directly with npx (requires Node.js 18+):
npx @artik0din/mcp-cloudflare-dns
Or install locally:
npm install -g @artik0din/mcp-cloudflare-dns
mcp-cloudflare-dns
Environment Variables
Create a .env file in your working directory:
| Variable | Required | Description |
|---|---|---|
CLOUDFLARE_API_TOKEN |
✅ | Your Cloudflare API token with Zone:Read and DNS:Edit permissions |
CLOUDFLARE_ZONE_ID |
❌ | Default zone ID (can be provided per request) |
Getting Your Cloudflare API Token
- Go to Cloudflare Dashboard > My Profile > API Tokens
- 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 zones
cloudflare_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 abc123def456
cloudflare_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.com
cloudflare_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 10
cloudflare_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 ghi789
cloudflare_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 ghi789
Security 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 start
License
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.