cloudflare-mcp

cloudflare-mcp

Provides a unified MCP interface to manage Cloudflare services including DNS, compute (Workers, KV, D1), storage (R2), AI, security, Radar, and a universal API gateway for any Cloudflare v4 endpoint.

Category
Visit Server

README

cloudflare-mcp v1.0.0

Universal Model Context Protocol (MCP) server for the complete Cloudflare ecosystem. Replaces 16 fragmented remote MCP endpoints with a single, high-performance local server.

Features (7 Unified Tools)

  • cf_dns: Zones, DNS records (A, CNAME, TXT, MX, etc.), CDN cache purging
  • cf_compute: Cloudflare Workers, KV Key-Value storage, serverless D1 SQL database execution
  • cf_storage: R2 Object Storage buckets, Vectorize vector database queries
  • cf_ai: Workers AI inference (Llama, DeepSeek, Embeddings), AI Gateway logs and telemetry
  • cf_security: Zero Trust Tunnels (cloudflared), WAF firewall rules, Audit logs
  • cf_radar: Radar URL scanner, global traffic/attack analytics, GraphQL queries
  • cf_api: Universal REST API gateway (access any of the 2,500+ Cloudflare endpoints directly)

Configuration

Set your Cloudflare API Token in your environment or store it in ~/.secrets/cloudflare-token.txt:

export CLOUDFLARE_API_TOKEN="your-cloudflare-api-token"
export CLOUDFLARE_ACCOUNT_ID="your-account-id"  # Optional, automatically discovered if omitted

Installation in MCP Clients (Claude Desktop, OpenCode, Cursor, Windsurf)

Option 1: Instant via uvx (Recommended)

{
  "mcpServers": {
    "cloudflare": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Steph-ux/cloudflare-mcp.git", "cloudflare-mcp"]
    }
  }
}

Option 2: Via pip install

pip install git+https://github.com/Steph-ux/cloudflare-mcp.git

Then in your MCP config:

{
  "mcpServers": {
    "cloudflare": {
      "command": "cloudflare-mcp"
    }
  }
}

Option 3: Local Clone (Development)

{
  "mcpServers": {
    "cloudflare": {
      "command": "python",
      "args": ["D:\\Steph\\script\\cloudflare-mcp\\server.py"]
    }
  }
}

Usage Examples

1. DNS Management

# List zones:
cf_dns(action='list_zones')

# Create DNS record:
cf_dns(
    action='create_record',
    zone_id='example.com',
    type='A',
    name='api',
    content='192.168.10.1',
    proxied=True
)

# Purge CDN cache:
cf_dns(action='purge_cache', zone_id='example.com', purge_everything=True)

2. D1 SQL Database & Workers

# Query D1 SQL database:
cf_compute(
    action='d1_query',
    database_id='YOUR_D1_DATABASE_ID',
    sql='SELECT * FROM users WHERE active = 1 LIMIT 10;'
)

# Store key-value in KV:
cf_compute(
    action='kv_put',
    namespace_id='YOUR_KV_NAMESPACE_ID',
    key_name='session_token',
    value='xyz123'
)

3. R2 Object Storage

# List buckets:
cf_storage(action='list_r2')

# Create bucket:
cf_storage(action='create_r2', bucket_name='my-app-assets', location_hint='weur')

4. Workers AI Inference

# Run Llama 3 on Cloudflare edge:
cf_ai(
    action='run_model',
    model='@cf/meta/llama-3.1-8b-instruct',
    prompt='Write a python snippet for async retry logic.'
)

5. Radar URL Scan & Security

# Scan URL for malware & phishing via Cloudflare Radar:
cf_radar(action='scan_url', url='https://target-to-scan.com')

# List active Zero Trust Tunnels:
cf_security(action='list_tunnels')

6. Universal REST Gateway (cf_api)

# Call any specific Cloudflare v4 REST endpoint:
cf_api(method='GET', path='/user')

Testing

pytest tests

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured