Wrangler
3.9k stars
official open-source Has MCP Cross-platform macOS Actively maintained
The official Cloudflare CLI. Deploy Workers, manage KV stores, query D1 databases, and control R2 storage from the command line.
Wrangler has both a CLI and an MCP server. See when to use each
Part of the Cloudflare CLI tools for AI agents
What your agent can do
You need to deploy an edge function. You open the Cloudflare dashboard, navigate to Workers, find your Worker, open the editor, paste code, click deploy. Your agent runs `wrangler deploy` and the Worker is live on Cloudflare's global network in seconds. One command, 300+ edge locations.D1 is Cloudflare's SQLite-at-the-edge database, and Wrangler gives your agent direct SQL access. `wrangler d1 execute my-db --command="SELECT * FROM products WHERE price < 50" --json` queries the database and returns structured JSON results. No ORM, no connection pooling, no database client setup. SQL in, JSON out.KV and R2 are Cloudflare's key-value store and object storage. Your agent manages both from the CLI: `wrangler kv key list --binding=CACHE --json` lists cached keys, `wrangler r2 object list my-bucket --json` lists stored files. Put, get, delete operations work the same way. Your agent manages the entire Cloudflare storage stack without the dashboard.The official MCP server (cloudflare/mcp-server-cloudflare, 3,600+ stars) gives AI agents direct access to Cloudflare's platform. Workers, KV, R2, and D1 operations through the Model Context Protocol. Your agent manages Cloudflare resources through structured MCP calls instead of shelling out to Wrangler.`wrangler tail --format=json` streams live Worker logs as JSON. Your agent monitors production traffic in real time, filtering by status code, HTTP method, or response time. Combined with `wrangler deployments list --json` for deployment history, your agent has full observability into what's running and how it's performing.
Limitations
JSON output is not universal across all subcommands — deploy output is primarily human-readable log lines. Cloudflare-specific with no support for other edge platforms. Workers have execution limits (CPU time, memory) that differ from traditional serverless. Some KV operations have eventual consistency. D1 is SQLite-based, so no PostgreSQL or MySQL compatibility.
Key Commands
wrangler deploy Deploy a Worker to Cloudflare's edge network
wrangler d1 execute Run SQL against a D1 database
wrangler kv key list List keys in a KV namespace
wrangler r2 object list List objects in an R2 storage bucket
wrangler deployments list List recent deployments with status
wrangler dev Start a local development server with hot reload
wrangler tail Stream live logs from a deployed Worker
GitHub Stats
repo cloudflare/workers-sdk
stars 3.9k
language TypeScript
license Apache-2.0
last commit Mar 25, 2026
FAQ
- Is Wrangler free?
- Yes. Wrangler is free and open-source under Apache 2.0. Install with `npm install -g wrangler`. You pay for Cloudflare Workers usage (generous free tier: 100K requests/day), KV, R2, and D1 based on usage. The CLI itself has no cost.
- Can AI agents use Wrangler?
- Yes. Wrangler runs non-interactive with `CLOUDFLARE_API_TOKEN` for authentication. D1, KV, and R2 commands support `--json` for structured output. `wrangler tail --format=json` streams live logs as JSON. The official MCP server (3,600+ stars) provides direct agent access to Cloudflare resources. Deploy, query, and manage the entire Cloudflare stack headlessly.
- What is the Cloudflare MCP server?
- cloudflare/mcp-server-cloudflare (3,600+ stars) is the official MCP server. It provides AI agents with access to Workers, KV, R2, and D1 through the Model Context Protocol. Your agent manages Cloudflare resources through structured MCP operations instead of parsing CLI output. One of the most-adopted official MCP servers in the ecosystem.
- What is the difference between Wrangler and Vercel CLI?
- Different platforms, similar deployment workflows. Wrangler deploys to Cloudflare Workers (V8 isolates, edge-first, SQLite via D1). Vercel CLI deploys to Vercel Functions (Node.js/Edge, framework-aware, managed infrastructure). Wrangler is lower-level with direct access to KV, R2, and D1. Vercel is more opinionated with automatic framework detection. Your agent uses whichever matches your deployment target.
- Does Wrangler support local development?
- Yes. `wrangler dev` starts a local development server that emulates the Workers runtime with hot reload. It simulates KV, R2, and D1 locally using Miniflare. Your agent develops and tests edge functions without deploying to Cloudflare. Changes reflect instantly.
Related tools in Cloud & Infra
Terraform CLI official
brew install terraform
category Cloud & Infra
The infrastructure-as-code CLI. Plan, apply, and manage cloud resources across AWS, GCP, Azure, and 3,000+ providers with structured JSON output.
48.0k
AWS CLI official
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && sudo installer -pkg AWSCLIV2.pkg -target /
category Cloud & Infra
Amazon's official command-line tool for managing AWS services. Control EC2, S3, Lambda, IAM, and 200+ services from the terminal.
16.8k
Vercel CLI official
npm i -g vercel
category Cloud & Infra
Vercel's official command-line interface. Deploy, preview, and manage web applications, serverless functions, and edge infrastructure from your terminal.
15.0k
Docker CLI official
brew install --cask docker
category Cloud & Infra
Docker's official command-line tool for building, running, and managing containers. Pull images, start services, inspect logs, and orchestrate multi-container apps from the terminal.
5.7k
Last verified: Mar 25, 2026