Cloudflare MCP Server

Cloud Platforms

Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems.

official implementationTypeScript codebaseCloud Service

Installation

Claude Desktop

Installation Command

npx @cloudflare/mcp-server-cloudflare init

Instructions

Restart Claude Desktop, you should see a small 🔨 icon that shows the following tools available for use.

README

Cloudflare MCP Server

Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems. In this repository, we provide an installer as well as an MCP Server for Cloudflare's API.

This lets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Cloudflare account, e.g.:

  • Please deploy me a new Worker with an example durable object.
  • Can you tell me about the data in my D1 database named '...'?
  • `Can you copy all the entries from my KV namespace '...' into my R2 bucket '...'?

Demo

Demonstrating the newly-released MCP server to explore Cloudflare properties, like Workers, KV, and D1.

Setup

  1. Run npx @cloudflare/mcp-server-cloudflare init

Note: The MCP server will automatically run npx wrangler login if you're not already authenticated with Cloudflare. You'll be prompted to complete the authentication process in your browser if needed.

  1. Restart Claude Desktop, you should see a small 🔨 icon that shows the following tools available for use:

Paid Features

Some features in this MCP server require a paid Cloudflare Workers plan:

  • Observability and Analytics: The analytics_get tool and related analytics features require a paid Workers plan to access these metrics
  • Other premium Cloudflare features like advanced D1 database capabilities and higher usage limits also require appropriate paid plans

Ensure your Cloudflare account has the necessary subscription level for the features you intend to use.

Features

KV Store Management

  • get_kvs: List all KV namespaces in your account
  • kv_get: Get a value from a KV namespace
  • kv_put: Store a value in a KV namespace
  • kv_list: List keys in a KV namespace
  • kv_delete: Delete a key from a KV namespace

R2 Storage Management

  • r2_list_buckets: List all R2 buckets in your account
  • r2_create_bucket: Create a new R2 bucket
  • r2_delete_bucket: Delete an R2 bucket
  • r2_list_objects: List objects in an R2 bucket
  • r2_get_object: Get an object from an R2 bucket
  • r2_put_object: Put an object into an R2 bucket
  • r2_delete_object: Delete an object from an R2 bucket

D1 Database Management

  • d1_list_databases: List all D1 databases in your account
  • d1_create_database: Create a new D1 database
  • d1_delete_database: Delete a D1 database
  • d1_query: Execute a SQL query against a D1 database

Workers Management

  • worker_list: List all Workers in your account
  • worker_get: Get a Worker's script content
  • worker_put: Create or update a Worker script
  • worker_delete: Delete a Worker script

Durable Objects

  • durable_objects_list: List all Durable Objects namespaces
  • durable_objects_create: Create a new Durable Objects namespace
  • durable_objects_delete: Delete a Durable Objects namespace
  • durable_objects_list_instances: List all instances for a specific Durable Objects namespace
  • durable_objects_get_instance: Get details about a specific Durable Objects instance
  • durable_objects_delete_instance: Delete a specific Durable Objects instance

Queues

  • queues_list: List all Queues in your account
  • queues_create: Create a new Queue
  • queues_delete: Delete a Queue
  • queues_get: Get details about a specific Queue
  • queues_send_message: Send a message to a Queue
  • queues_get_messages: Get messages from a Queue
  • queues_update_consumer: Update a Queue consumer

Workers AI

  • workers_ai_list_models: List available AI models
  • workers_ai_get_model: Get details about a specific AI model
  • workers_ai_run_inference: Run inference using Workers AI
  • workers_ai_list_tasks: List AI tasks

Workflows

  • workflows_list: List all Workflows in your account
  • workflows_create: Create a new Workflow
  • workflows_delete: Delete a Workflow
  • workflows_get: Get details about a specific Workflow
  • workflows_update: Update a Workflow
  • workflows_execute: Execute a Workflow

Templates

  • templates_list: List available Worker templates
  • templates_get: Get details about a specific template
  • templates_create_from_template: Create a new Worker from a template

Workers for Platforms

  • w4p_list_dispatchers: List all Workers for Platforms dispatchers
  • w4p_create_dispatcher: Create a new dispatcher
  • w4p_delete_dispatcher: Delete a dispatcher
  • w4p_get_dispatcher: Get details about a specific dispatcher
  • w4p_update_dispatcher: Update a dispatcher configuration

Service Bindings

  • bindings_list: List all service bindings for a Worker
  • bindings_create: Create a new service binding
  • bindings_update: Update a service binding
  • bindings_delete: Delete a service binding

URL Routing

  • routing_list_routes: List all routes for a Worker
  • routing_create_route: Create a new route
  • routing_update_route: Update a route
  • routing_delete_route: Delete a route

Cron Triggers

  • cron_list: List all cron triggers for a Worker
  • cron_create: Create a new cron trigger
  • cron_update: Update a cron trigger
  • cron_delete: Delete a cron trigger

Zones & Domains

  • zones_list: List all zones in your account
  • zones_create: Create a new zone
  • zones_delete: Delete a zone
  • zones_get: Get details about a specific zone
  • zones_check_activation: Check zone activation status

Secrets

  • secrets_list: List all secrets for a Worker
  • secrets_put: Create or update a secret
  • secrets_delete: Delete a secret

Version Management

  • versions_list: List all versions of a Worker
  • versions_get: Get details about a specific version
  • versions_rollback: Rollback to a previous version

Wrangler Config

  • wrangler_get_config: Get the current Wrangler configuration
  • wrangler_update_config: Update Wrangler configuration

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.