Skip to main content
Glama

Cloudflare MCP Pro ☁️

MCP server for the Cloudflare REST API v4 — 69 tools across DNS, Zones, Workers, KV, R2, D1, Pages, Queues, Tunnels, SSL, WAF, Email Routing, Logpush and Workers AI in a single local stdio server authenticated by API token.

npm version License: MIT GitHub Stars GitHub Forks GitHub Issues Glama Quality

TypeScript Node.js MCP Claude Code Cursor Claude Desktop

Instagram YouTube LinkedIn Buy Me A Coffee Strat Academy

Unlike the official Cloudflare MCP offering (13 separate remote, OAuth-based servers), cloudflare-mcp-pro runs locally over stdio, authenticates with a single API token, and consolidates the most-used Cloudflare operations into one server with consistent verb_object tool names — ideal for Claude Code, CI, and scripted automation.

Features

  • DNS — list/create/update/delete records, DNSSEC, BIND zone-file export

  • Zones — list/get/create/delete, settings (SSL mode, HTTPS, min TLS…), cache purge, GraphQL analytics

  • Workers — deploy (ES module), routes, secrets, cron triggers, list/get/delete

  • KV / R2 / D1 — namespaces + key CRUD, bucket management, databases + SQL queries

  • Pages / Queues / Tunnels — list/get projects, queue management, tunnel inspection

  • Security — WAF rulesets, IP/ASN/country access rules, page rules, SSL certificate packs, custom hostnames (SaaS), Turnstile widgets

  • Email Routing — rules + destination addresses

  • Logpush — list/create jobs (zone or account scoped)

  • Workers AI — model catalog + inference (text generation, embeddings, classification)

  • Human-approval gate — every mutating tool requires confirm: true; without it the tool returns a non-executing preview (with secrets redacted) instead of acting (see below)

  • MCP annotations — every tool carries readOnly/destructive/idempotent hints so clients can gate dangerous actions

  • Auto-pagination — fetch_all: true on list tools follows every page

  • Single API-token auth, automatic retry + rate-limit (429/5xx) handling, and actionable error messages

Related MCP server: mcp-server-cloudflare

Installation

npm install
npm run build

Or run directly once published:

npx -y cloudflare-mcp-pro

Configuration

Copy .env.example to .env and fill in:

Variable

Required

Description

CLOUDFLARE_API_TOKEN

✅

API token from https://dash.cloudflare.com/profile/api-tokens

CLOUDFLARE_ACCOUNT_ID

optional

Default account ID used when a tool doesn't receive account_id

CLOUDFLARE_API_BASE

optional

Override the API base URL

Token scopes depend on what you use, e.g.: Zone:Read, DNS:Edit, Workers Scripts:Edit, Workers KV Storage:Edit, Workers R2 Storage:Edit, D1:Edit, Pages:Edit, Account Analytics:Read. Run the verify_token tool to confirm your token works.

Testing

Run the automated test suite (no network — fetch is mocked):

npm test

It covers the human-approval gate, secret redaction, the security validations (hex IDs, path-segment encoding, model-id allowlist, purge mutual-exclusion, analytics hour-alignment), the API client (query serialization, 429 retry, error mapping, pagination + clamp, GraphQL non-JSON guard) and the Zod→JSON-Schema converter.

Interactive testing with the MCP inspector:

npx @modelcontextprotocol/inspector dist/index.js

Add to Claude Code

In .claude/settings.json → mcpServers:

{
  "mcpServers": {
    "cloudflare-mcp-pro": {
      "command": "node",
      "args": ["projects/cloudflare-mcp-pro/dist/index.js"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your-token",
        "CLOUDFLARE_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Add to Claude Desktop

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cloudflare-mcp-pro": {
      "command": "node",
      "args": ["/absolute/path/projects/cloudflare-mcp-pro/dist/index.js"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your-token",
        "CLOUDFLARE_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Human-approval gate

Every mutating tool (any create_*, update_*, delete_*, deploy_*, put_*, edit_*, purge_cache, query_d1, run_ai, …) is gated server-side. Read-only tools (list_*, get_*, verify_token, export_dns_records, analytics) are never gated.

  • Calling a mutating tool without confirm: true returns a confirmation_required preview describing the tool, the risk level, and the (secret-redacted) arguments — and does not execute.

  • Re-call the same tool with "confirm": true to actually perform it, after a human has approved.

This gate is enforced in the server regardless of the MCP client, and works alongside the MCP annotations (destructiveHint) that prompt the human in compatible clients like Claude Code. Secret values (e.g. Worker secret text) are redacted from previews and never appear in error messages.

// 1) preview (no confirm) → nothing happens
delete_zone { "zone_id": "..." }
// → { "status": "confirmation_required", "risk": "DESTRUCTIVE — ...", ... }

// 2) after human approval
delete_zone { "zone_id": "...", "confirm": true }   // actually deletes

Tools (69)

List tools accept fetch_all: true to follow pagination. Mutating tools accept confirm: true (see the gate above). Every tool advertises MCP annotations (readOnlyHint / destructiveHint / idempotentHint).

Account — verify_token, list_accounts

Zones & settings — list_zones, get_zone, create_zone, delete_zone, purge_cache, get_zone_analytics, get_zone_setting, update_zone_setting

DNS — list_dns_records, create_dns_record, update_dns_record, delete_dns_record, get_dnssec, edit_dnssec, export_dns_records

Workers — list_workers, get_worker, deploy_worker, delete_worker, list_worker_routes, create_worker_route, delete_worker_route, put_worker_secret, delete_worker_secret, update_worker_cron

KV — list_kv_namespaces, create_kv_namespace, kv_list_keys, kv_get, kv_put, kv_delete

R2 — list_r2_buckets, create_r2_bucket, delete_r2_bucket

D1 — list_d1_databases, create_d1_database, query_d1

Pages — list_pages_projects, get_pages_project

WAF & firewall — list_firewall_rulesets, get_ruleset, list_access_rules, create_access_rule, delete_access_rule

Page rules — list_page_rules, create_page_rule, delete_page_rule

SSL/TLS — list_certificate_packs, get_ssl_verification, order_certificate_pack

Custom hostnames (SaaS) — list_custom_hostnames, create_custom_hostname, delete_custom_hostname

Email Routing — list_email_rules, create_email_rule, list_email_destinations

Queues — list_queues, create_queue, delete_queue

Tunnels — list_tunnels, get_tunnel

Turnstile — list_turnstile_widgets, create_turnstile_widget

Workers AI — list_ai_models, run_ai

Logpush — list_logpush_jobs, create_logpush_job

Author

Helbert Paranhos / Strat Academy — stratacademy.com.br

License

MIT — see LICENSE.

Available Tools

69 tools
create_access_ruleA

Create an IP/ASN/country access rule (block, challenge, or whitelist). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), mode (required), target (required), value (required), +2 more.

create_custom_hostnameA

Add a custom hostname (SSL for SaaS) to a zone. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), hostname (required), ssl_method, ssl_type, +1 more.

create_d1_databaseA

Create a new D1 database. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), account_id, primary_location_hint, confirm.

create_dns_recordA

Create a DNS record (A, AAAA, CNAME, TXT, MX, etc). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), type (required), name (required), content (required), +5 more.

create_email_ruleA

Create an Email Routing rule (forward an address to a destination). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), match_to (required), forward_to (required), name, +2 more.

create_kv_namespaceA

Create a new Workers KV namespace. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: title (required), account_id, confirm.

create_logpush_jobA

Create a Logpush job streaming a dataset to a destination. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), dataset (required), destination_conf (required), zone_id, +4 more.

create_page_ruleA

Create a page rule (URL pattern + actions like cache_level, forwarding_url). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), url_pattern (required), actions (required), status, +2 more.

create_queueA

Create a new Cloudflare Queue. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: queue_name (required), account_id, confirm.

create_r2_bucketA

Create a new R2 bucket. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), account_id, location_hint, confirm.

create_turnstile_widgetA

Create a Turnstile widget (CAPTCHA alternative) for given domains. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), domains (required), account_id, mode, +1 more.

create_worker_routeA

Create a Worker route mapping a URL pattern to a Worker script. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), pattern (required), script, confirm.

create_zoneA

Add a new domain (zone) to an account. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), account_id, type, confirm.

delete_access_ruleA
DestructiveIdempotent

Delete an access rule by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), rule_id (required), confirm.

delete_custom_hostnameA
DestructiveIdempotent

Delete a custom hostname by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), custom_hostname_id (required), confirm.

delete_dns_recordA
DestructiveIdempotent

Delete a DNS record by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), record_id (required), confirm.

delete_page_ruleA
DestructiveIdempotent

Delete a page rule by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), rule_id (required), confirm.

delete_queueA
DestructiveIdempotent

Delete a Queue by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: queue_id (required), account_id, confirm.

delete_r2_bucketA
DestructiveIdempotent

Delete an (empty) R2 bucket. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: name (required), account_id, confirm.

delete_workerA
DestructiveIdempotent

Delete a Worker script by name. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: script_name (required), account_id, confirm.

delete_worker_routeA
DestructiveIdempotent

Delete a Worker route by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), route_id (required), confirm.

delete_worker_secretA
DestructiveIdempotent

Delete a secret binding from a Worker script. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: script_name (required), name (required), account_id, confirm.

delete_zoneA
DestructiveIdempotent

Delete a zone by ID. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), confirm.

deploy_workerA
Idempotent

Create or update (deploy) a Worker script from ES module source. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: script_name (required), script (required), account_id, main_module, +2 more.

edit_dnssecA
Idempotent

Enable or disable DNSSEC for a zone. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), status (required), confirm.

export_dns_recordsA
Read-only

Export all DNS records of a zone as a BIND zone file.

Inputs: zone_id (required).

get_dnssecA
Read-only

Get the DNSSEC status and DS record details for a zone.

Inputs: zone_id (required).

get_pages_projectA
Read-only

Get details of a Cloudflare Pages project.

Inputs: project_name (required), account_id.

get_rulesetA
Read-only

Get a single ruleset (with its rules) by ID.

Inputs: zone_id (required), ruleset_id (required).

get_ssl_verificationA
Read-only

Get SSL/TLS certificate verification status for a zone.

Inputs: zone_id (required).

get_tunnelA
Read-only

Get details of a Cloudflare Tunnel by ID.

Inputs: tunnel_id (required), account_id.

get_workerA
Read-only

Get a Worker script's settings/metadata.

Inputs: script_name (required), account_id.

get_zoneA
Read-only

Get details of a single zone by ID.

Inputs: zone_id (required).

get_zone_analyticsA
Read-only

Get HTTP traffic analytics for a zone over a time range (via GraphQL).

Inputs: zone_id (required), since (required), until (required).

get_zone_settingB
Read-only

Get a single zone setting (e.g. ssl, always_use_https, min_tls_version).

Inputs: zone_id (required), setting (required).

kv_deleteA
DestructiveIdempotent

Delete a key from a KV namespace. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: namespace_id (required), key (required), account_id, confirm.

kv_getA
Read-only

Read the value of a key in a KV namespace.

Inputs: namespace_id (required), key (required), account_id.

kv_list_keysB
Read-only

List keys in a KV namespace, optionally filtered by prefix.

Inputs: namespace_id (required), account_id, prefix, limit.

kv_putA
Idempotent

Write a value to a key in a KV namespace, with optional TTL. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: namespace_id (required), key (required), value (required), account_id, +2 more.

list_access_rulesB
Read-only

List IP/ASN/country access rules (block/challenge/allow) on a zone.

Inputs: zone_id (required), mode, page, per_page, +1 more.

list_accountsB
Read-only

List Cloudflare accounts accessible by the token.

Inputs: page, per_page, fetch_all.

list_ai_modelsA
Read-only

Search the catalog of Workers AI models available to the account.

Inputs: account_id, search, task.

list_certificate_packsB
Read-only

List SSL/TLS certificate packs on a zone.

Inputs: zone_id (required), status.

list_custom_hostnamesC
Read-only

List custom hostnames (SSL for SaaS) on a zone.

Inputs: zone_id (required), hostname, page, per_page, +1 more.

list_d1_databasesC
Read-only

List D1 databases in an account.

Inputs: account_id, name, page, per_page, +1 more.

list_dns_recordsA
Read-only

List DNS records of a zone, optionally filtered by type/name.

Inputs: zone_id (required), type, name, page, +2 more.

list_email_destinationsA
Read-only

List verified Email Routing destination addresses in an account.

Inputs: account_id.

list_email_rulesC
Read-only

List Email Routing rules on a zone.

Inputs: zone_id (required).

list_firewall_rulesetsA
Read-only

List WAF rulesets configured on a zone.

Inputs: zone_id (required).

list_kv_namespacesB
Read-only

List Workers KV namespaces in an account.

Inputs: account_id, page, per_page, fetch_all.

list_logpush_jobsB
Read-only

List Logpush jobs for a zone or account.

Inputs: zone_id, account_id.

list_page_rulesA
Read-only

List page rules on a zone.

Inputs: zone_id (required), status.

list_pages_projectsA
Read-only

List Cloudflare Pages projects in an account.

Inputs: account_id.

list_queuesA
Read-only

List Cloudflare Queues in an account.

Inputs: account_id.

list_r2_bucketsA
Read-only

List R2 buckets in an account.

Inputs: account_id, name_contains.

list_tunnelsA
Read-only

List Cloudflare Tunnels (cloudflared) in an account.

Inputs: account_id, is_deleted.

list_turnstile_widgetsA
Read-only

List Turnstile widgets in an account.

Inputs: account_id.

list_worker_routesA
Read-only

List Worker routes (URL patterns mapped to Workers) on a zone.

Inputs: zone_id (required).

list_workersA
Read-only

List Worker scripts in an account.

Inputs: account_id.

list_zonesA
Read-only

List zones (domains), optionally filtered by name or status.

Inputs: name, status, page, per_page, +1 more.

order_certificate_packA

Order an advanced certificate pack for one or more hostnames. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), hosts (required), certificate_authority, validation_method, +2 more.

purge_cacheA

Purge a zone's cache — everything, or by files/tags/hosts/prefixes. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), purge_everything, files, tags, +3 more.

put_worker_secretA
Idempotent

Create or update a secret binding on a Worker script. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: script_name (required), name (required), text (required), account_id, +1 more.

query_d1A

Execute a SQL statement against a D1 database (with optional bound params). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: database_id (required), sql (required), account_id, params, +1 more.

run_aiA

Run inference on a Workers AI model (text generation, embeddings, classification). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: model (required), input (required), account_id, confirm.

update_dns_recordA
Idempotent

Update an existing DNS record (partial update). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), record_id (required), type, name, +6 more.

update_worker_cronA
Idempotent

Set the cron triggers (schedules) for a Worker script. Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: script_name (required), crons (required), account_id, confirm.

update_zone_settingA
Idempotent

Update a single zone setting (e.g. set ssl=full, always_use_https=on). Requires confirm:true (human-approval gate); without it returns a preview only.

Inputs: zone_id (required), setting (required), value (required), confirm.

verify_tokenA
Read-only

Validate the configured Cloudflare API token and show its status/permissions.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 69 tools

    Disambiguation4/5

    Most tools target distinct Cloudflare resources (DNS, Workers, KV, D1, etc.), and descriptions clearly differentiate them. A few pairs like 'get_zone' and 'get_zone_setting' could cause minor confusion, but overall boundaries are clear.

    Naming Consistency3/5

    The majority follow a verb_noun pattern (e.g., create_dns_record), but there are deviations like 'kv_get', 'deploy_worker', 'edit_dnssec', and 'verify_token'. The mixture of conventions reduces predictability.

    Tool Count2/5

    69 tools is excessively high for a single MCP server, leading to context overload. The broad scope would be better served by splitting into multiple specialized servers (e.g., DNS, Workers, Storage).

    Completeness3/5

    The tool surface covers core CRUD for many services (DNS, Workers KV, Zones) but lacks update operations for custom hostnames, D1 databases, R2 buckets, and queues. Additionally, firewall rules and SSL certificate management are incomplete.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers