Cloudflare

Cloudflare MCP Server
  • python

2

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ry-ops-cloudflare-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/cloudflare-mcp-server",
        "run",
        "cloudflare-mcp-server"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your_api_token_here",
        "CLOUDFLARE_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}

You can run a dedicated MCP server that integrates with the Cloudflare API to manage zones, DNS records, Workers KV, and cache analytics. This server is designed to be controlled by MCP clients via either a local runtime (stdio) or a remote HTTP connection, and it supports rapid development and deployment through a streamlined setup.

How to use

You will connect to the Cloudflare MCP Server from your MCP client to perform operations such as listing zones, managing DNS records, reading and writing KV values, and purging caches. Use the HTTP path when you have a remote MCP endpoint configured, or run a local instance and interact via stdio. Ensure you provide the required credentials and account context so operations like KV storage and analytics work correctly.

How to install

Prerequisites you need before starting are Python 3.10 or higher, the uv tool for dependency management, and a Cloudflare account with an API token.

Step by step, install and run a local instance using uv:

# Create a workspace for the MCP server
mkdir cloudflare-mcp-server
cd cloudflare-mcp-server
# Install the MCP server in editable mode
uv pip install -e .
# Start the server (example with uv, adjust path as needed)
uv run cloudflare-mcp-server

Additional sections

Configuration and credentials are required to operate Cloudflare-related features. Set the following environment variables to enable your MCP client to authenticate and access your Cloudflare account for KV, DNS, and analytics operations.

export CLOUDFLARE_API_TOKEN="your_api_token_here"
export CLOUDFLARE_ACCOUNT_ID="your_account_id_here"  # Optional, needed for KV operations

Configuration guidance

Two runtime configurations are shown for running the MCP server locally via stdio using uv or directly with Python. You can place these in your Claude Desktop config under the mcpServers section to connect to this server.

{
  "mcpServers": {
    "cloudflare": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/cloudflare-mcp-server",
        "run",
        "cloudflare-mcp-server"
      ],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your_api_token_here",
        "CLOUDFLARE_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}
{
  "mcpServers": {
    "cloudflare_py": {
      "command": "python",
      "args": ["-m", "cloudflare_mcp_server"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your_api_token_here",
        "CLOUDFLARE_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}

Available tools

list_zones

List all Cloudflare zones with optional filters such as name or status.

get_zone

Retrieve detailed information about a specific zone.

list_dns_records

List DNS records with filtering options like type, name, or content.

create_dns_record

Create new DNS records (A, AAAA, CNAME, TXT, MX, etc.) with optional proxied status.

update_dns_record

Update existing DNS records.

delete_dns_record

Delete DNS records.

purge_cache

Purge cached content for a zone or specific files/tags/hosts.

get_zone_analytics

Get analytics data for a zone including requests and bandwidth.

list_kv_namespaces

List all KV namespaces.

read_kv_value

Read a value from KV storage by key.

write_kv_value

Write a key-value pair to KV storage with optional TTL and metadata.

delete_kv_value

Delete a key from KV storage.

list_kv_keys

List keys with optional prefix filtering in a namespace.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational