C

Cloudflare MCP Server

Deploy and manage Cloudflare Workers, R2 storage, KV namespaces, and D1 databases from Claude Code. Streamline edge deployment workflows by managing your Cloudflare infrastructure directly within your AI coding environment.

MCPCommunitydeploymentv1.0.0MIT
0 views0 copies

MCP Server Configuration

{ "mcpServers": { "cloudflare": { "command": "npx", "args": ["-y", "@cloudflare/mcp-server-cloudflare"], "env": { "CLOUDFLARE_ACCOUNT_ID": "<your-account-id>", "CLOUDFLARE_API_TOKEN": "<your-api-token>" } } } }

Available Tools

CategoryTools
WorkersCreate, update, delete, list Workers scripts
KVCreate/list namespaces, get/put/delete KV pairs
R2Create/list buckets, upload/download objects
D1Create databases, execute SQL queries
DNSList/create/update DNS records
AnalyticsQuery Workers analytics and metrics

Setup

  1. Find your Account ID at https://dash.cloudflare.com (right sidebar on Overview page)
  2. Create an API token at https://dash.cloudflare.com/profile/api-tokens
  3. Use the "Edit Cloudflare Workers" template or create a custom token with:
    • Workers Scripts: Edit
    • Workers KV Storage: Edit
    • Workers R2 Storage: Edit
    • D1: Edit
    • Zone > DNS: Edit (if managing DNS)
  4. Replace both placeholders in the configuration

Usage Examples

  • "Deploy this API handler as a Cloudflare Worker"
  • "Create a KV namespace for session storage and add some test data"
  • "Upload these assets to an R2 bucket"
  • "Create a D1 database and run this schema migration"
  • "Show me analytics for my Workers over the last 24 hours"

Security Notes

  • API tokens grant infrastructure control - use minimal permissions
  • Create separate tokens for development and production
  • Store credentials in .claude/settings.local.json (gitignored)
  • Workers deployments are instant and global - review code before deploying
  • D1 queries execute with full access - use read-only tokens when possible
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates