Skip to main content
Glama
globodai-group

Cloudflare DNS MCP Server

Cloudflare DNS MCP Server

npm version License: MIT MCP Compatible

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 MCP Server

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

  1. Go to Cloudflare Dashboard > My Profile > API Tokens

  2. Click "Create Token"

  3. 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 records

  • proxied (boolean, optional): Enable Cloudflare proxy

  • comment (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 update

  • type (string, optional): New record type

  • name (string, optional): New record name

  • content (string, optional): New record content

  • zoneId (string, optional): Zone ID (uses default if not provided)

  • ttl (number, optional): New TTL in seconds

  • priority (number, optional): New priority for MX records

  • proxied (boolean, optional): Enable/disable Cloudflare proxy

  • comment (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 delete

  • zoneId (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.

Available Tools

6 tools
cloudflare_create_dns_recordC

Create a new DNS record in a zone

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneIdNoZone ID to create record in (optional if set in config)
typeYesRecord type (e.g., A, AAAA, CNAME, MX, TXT)
nameYesRecord name (e.g., www.example.com or @)
contentYesRecord content (IP address, hostname, text content, etc.)
ttlNoTime to live in seconds (1 = auto, 120-7200)
priorityNoPriority for MX records
proxiedNoWhether the record should be proxied through Cloudflare
commentNoComment for the record

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must disclose behavior. It only states 'create', which implies mutation, but lacks details on side effects, permissions, rate limits, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but lacks structure. It could benefit from a more detailed breakdown without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema is provided, and the description does not explain return values or error conditions. Given the tool has 8 parameters and no annotations, the description is insufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds no extra meaning beyond the schema, but the schema is self-sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (create) and resource (DNS record in a zone). It distinguishes itself from siblings by being the only 'create' tool, but does not explicitly mention alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus other tools like update or delete. No context about prerequisites or conditions is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cloudflare_delete_dns_recordB

Delete a DNS record

ParametersJSON Schema
NameRequiredDescriptionDefault
recordIdYesDNS record ID to delete
zoneIdNoZone ID (optional if set in config)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as irreversibility, required permissions, or error states for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words. Appropriately size for a simple deletion tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema and minimal description. Lacks details on success/failure behavior, side effects, or error handling, which are important for a destructive action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for both parameters (recordId and zoneId). The tool description adds no additional meaning beyond what the schema already provides, so baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Delete a DNS record' uses a clear verb ('Delete') and specific resource ('DNS record'), distinguishing it from siblings like create, update, or list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., update), nor prerequisites like needing the record ID or zone context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cloudflare_get_zoneB

Get details for a specific DNS zone

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneIdYesZone ID to get details for

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only says 'Get details' without specifying read-only nature, authentication requirements, rate limits, or what 'details' entails. This is insufficient for full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single short sentence, no wasted words. Perfectly concise for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description should hint at the return structure or typical fields. It does not. The tool is simple, but the description leaves the agent guessing what 'details' includes. More context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (one parameter with description). The description adds no additional meaning beyond the schema. Baseline 3 is appropriate as the schema already documents the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Get details for a specific DNS zone', which is a specific verb-resource combination. It distinguishes from sibling tools like list_zones (different verb) and DNS record tools (different resource).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. For example, it doesn't mention using list_zones first to get zone IDs, or contrast with other read operations. The usage context is purely implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cloudflare_list_dns_recordsB

List DNS records for a zone

ParametersJSON Schema
NameRequiredDescriptionDefault
zoneIdNoZone ID to list records for (optional if set in config)
typeNoFilter by record type (e.g., A, AAAA, CNAME, MX, TXT)
nameNoFilter by record name (e.g., www.example.com)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full responsibility for behavioral disclosure. It merely states 'List DNS records' without mentioning pagination, ordering, rate limits, or any side effects. This is minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. However, it could be slightly more informative without losing conciseness, hence not a perfect score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, so the description should explain what is returned. It lacks any mention of the response format, pagination, or potential errors, leaving the agent underinformed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters and their meanings. The description adds no additional context beyond what is in the schema, adhering to the baseline expectation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and the resource ('DNS records for a zone'), which is specific and unambiguous. It effectively distinguishes from sibling tools like cloudflare_create_dns_record or cloudflare_get_zone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as when to list records versus creating or deleting them. No context about prerequisites or limiting factors is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cloudflare_list_zonesA

List all DNS zones accessible to the API token

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only states the basic purpose, omitting details like pagination, response format, or any limitations, which is insufficient for a complete behavioral profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with key information, no extraneous words. Highly concise and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite simple tool, no output schema or annotations means description should provide more context about return values, pagination, or access details. Current description is too minimal.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has zero parameters, so schema coverage is 100%. Description adds no parameter info, but none is needed. Baseline of 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'list all DNS zones accessible to the API token', with a specific verb and resource, and distinguishes from sibling tools that operate on records or single zones.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicitly communicates when to use (to list zones), but lacks explicit guidance on when not to use or alternatives. However, the purpose is straightforward and context makes usage clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cloudflare_update_dns_recordC

Update an existing DNS record

ParametersJSON Schema
NameRequiredDescriptionDefault
recordIdYesDNS record ID to update
zoneIdNoZone ID (optional if set in config)
typeNoRecord type (e.g., A, AAAA, CNAME, MX, TXT)
nameNoRecord name (e.g., www.example.com or @)
contentNoRecord content (IP address, hostname, text content, etc.)
ttlNoTime to live in seconds (1 = auto, 120-7200)
priorityNoPriority for MX records
proxiedNoWhether the record should be proxied through Cloudflare
commentNoComment for the record

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral disclosure burden, yet it fails to mention key traits such as idempotency, error handling, or what happens if the record does not exist. The lack of output schema further limits transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, which is efficient and front-loaded. However, it could be expanded slightly to include crucial usage hints without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 9 parameters, no annotations, and no output schema, the description is incomplete. It does not clarify parameter roles (e.g., proxied, recordId uniqueness) or response expectations, leaving significant gaps for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all 9 parameters, so the baseline is 3. The description adds no extra meaning beyond the schema, but does not detract either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (update) and resource (existing DNS record), effectively distinguishing it from sibling tools like create, delete, and list. However, it lacks specificity on what aspects can be updated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (e.g., cloudflare_create_dns_record) or any prerequisites. The agent is left without context for appropriate selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.6/5.0
Disambiguation5/5

Each tool targets a distinct action (create, delete, get, list, update) on specific resources (DNS records or zones), with no overlap in functionality.

Naming Consistency5/5

All tools follow a consistent 'cloudflare_verb_noun' pattern using snake_case, making them predictable and easy to differentiate.

Tool Count5/5

Six tools is well-scoped for a DNS management server, covering essential CRUD operations without unnecessary bloat or gaps.

Completeness5/5

The set provides full CRUD for DNS records plus zone listing and details, covering the core lifecycle needs for DNS management.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Exposes Cloudflare DNS, security, redirects and zone-settings functionality as structured tools that AI assistants like Claude Desktop can invoke directly.
    18
    48
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    13
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.

Latest Blog Posts

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/globodai-group/mcp-cloudflare-dns'

If you have feedback or need assistance with the MCP directory API, please join our Discord server