home / mcp / mcp cloudflare dns server

MCP Cloudflare DNS Server

Provides Cloudflare DNS management via MCP with list, create, update, and delete capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "gilberth-mcp-cloudflare": {
      "command": "npx",
      "args": [
        "-y",
        "@thelord/mcp-cloudflare"
      ],
      "env": {
        "CLOUDFLARE_EMAIL": "[email protected]",
        "CLOUDFLARE_ZONE_ID": "YOUR_ZONE_ID",
        "CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
      }
    }
  }
}

You can run this MCP server to manage Cloudflare DNS records using AI-powered agents. It lets you list, create, update, and delete DNS records across your zones, with full Cloudflare API support and optional scoped tokens for enhanced security.

How to use

You interact with the Cloudflare DNS MCP server using an MCP client or your automation setup. Start the server locally with a simple command, provide your Cloudflare credentials, and then issue actions to list, create, update, or delete DNS records. The server exposes tools for common DNS record operations and supports standard record types such as A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, and PTR.

How to install

Prerequisites: ensure you have Node.js installed on your system. You can verify by running node -v and npm -v.

Install and run the MCP server locally using the provided package via npx.

npx -y @thelord/mcp-cloudflare

Create a configuration file or environment variables to authenticate with Cloudflare and identify your zone.

env
CLOUDFLARE_API_TOKEN=your-api-token-here
CLOUDFLARE_ZONE_ID=your-zone-id-here
[email protected]  # Optional

If you prefer a JSON configuration snippet for client tooling, you can use the following example to wire up a local stdio MCP server with npx.

{
  "mcpServers": {
    "cloudflare": {
      "command": "npx",
      "args": ["-y", "@thelord/mcp-cloudflare"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your-api-token",
        "CLOUDFLARE_ZONE_ID": "your-zone-id"
      }
    }
  }
}

Additional configuration and usage notes

Environment variables you define are used to authenticate with Cloudflare and to identify the zone you manage. You can also set an optional email if your workflow requires it.

You can run the server in a hosted environment as well. Provide your API token and zone ID in your deployment configuration or environment. The server will perform DNS operations against Cloudflare using the provided credentials.

Available tools include listing DNS records, retrieving details for a specific record, creating new records, updating existing records by ID, and deleting records by ID.

Security considerations: API tokens are never logged or exposed by the server. The server uses the official Cloudflare API with secure authentication and supports scoped API tokens to limit permissions.

Cloudflare DNS record types supported

The MCP server supports common DNS record types such as A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, and PTR. It allows you to configure proxying, TTL, and priority settings where applicable.

Claude Desktop Configuration

To configure Claude Desktop to run the Cloudflare MCP server, provide the following block in your Claude configuration.

{
  "mcpServers": {
    "cloudflare": {
      "command": "npx",
      "args": ["-y", "@thelord/mcp-cloudflare"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your-api-token",
        "CLOUDFLARE_ZONE_ID": "your-zone-id"
      }
    }
  }
}

Available tools

list_dns_records

List all DNS records or filter by name/type.

get_dns_record

Get detailed information about a specific DNS record.

create_dns_record

Create a new DNS record with specified type, name, and content.

update_dns_record

Update an existing DNS record by ID.

delete_dns_record

Delete a DNS record by ID.