Cloudflare Workers MCP Server
Summary: This MCP server lets an MCP client manage Cloudflare Workers, including static-site deploy, code deploy, settings, versions/rollouts, routing/cron, and log queries.
List and inspect Workers, settings, deployments, versions, cron triggers, custom domains, and deployed source code.
Deploy a local directory as a static assets-only Worker, with dedupe, SPA/404 handling,
_headers/_redirects, and.assetsignore.Redeploy static assets or deploy ES-module Worker code with bindings such as plain text, secret text, KV, R2, D1, and assets.
Delete Workers and update settings, bindings, compatibility date/flags, logpush, and observability without uploading code.
Manage versions and traffic: create staged versions, deploy at 100% or gradual splits, and roll back to older versions.
Attach/detach custom domains, toggle workers.dev serving/preview URLs, and replace cron triggers.
Query Workers Logs and verify API token/Cloudflare connectivity with a health check.
Note: The provided schema does not include the README’s preview, dedicated secret-management, or live-tail tools.
Manages Cloudflare Workers scripts, including listing all workers, retrieving worker settings and bindings, and health checks. Planned capabilities include static site deployment, worker lifecycle management, staged uploads, gradual rollouts, custom domains, cron triggers, and querying worker logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cloudflare Workers MCP Server list all workers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cloudflare Workers MCP Server
⚠️ Security warning: this server was substantially AI-written. Before pointing it at an account you care about: (1) review the code — it is small and readable, an audit takes ~30 minutes; (2) for maximum caution, clone and build from source rather than trusting the npm artifact (or at least pin an exact version); (3) give the API token the minimum permission (Workers Scripts: Edit) and nothing else; (4) prefer a test account for the first runs; (5) tools that take a local path (
directory,modules[].path) upload whatever they point at to your Cloudflare account, where it can become publicly reachable, so keep your MCP client's approval prompts on for the deploy tools and check those paths before approving.
A Model Context Protocol (MCP) server for managing Cloudflare Workers from Claude Desktop or Claude Code — the successor to cloudflare-pages-mcp, following Cloudflare's own shift from Pages to Workers with static assets.
Why
As of mid-2026, no other MCP server — including Cloudflare's official ones — can deploy a Worker. Cloudflare's remote MCP servers are read-only for Workers management, and their Code Mode server has no filesystem so it can't upload real asset trees. A local stdio server can: the Workers static-asset upload protocol is publicly documented, so this server's headline feature is:
"Deploy this directory as a static site on Cloudflare Workers" — in one natural-language request, with free unlimited static-asset serving.
Related MCP server: Cloudflare MCP Server
Tools
Static sites (the differentiator)
deploy_static_site - Deploy a local directory as a static site: manifest hashing, server-side dedupe (unchanged files never re-upload),
_headers/_redirectssupport, SPA/404 handling,base_pathURL prefix (where Cloudflare has enabled it for the account), live workers.dev URL in the result. Deploying over a Worker that has code replaces it with assets only, which removes its bindings and secrets (the result lists them insecrets_dropped)redeploy_assets - Redeploy reusing the live version's files and asset config, e.g. to bump the compatibility date. To change
html_handling/not_found_handling/base_path, re-rundeploy_static_site: unchanged files dedupe, so nothing re-uploads
Previews (beta)
deploy_preview - Deploy a preview of a site directory or Worker code without touching production, at a stable
https://<preview>-<worker>.<account>.workers.devURL plus a per-deployment URL. Redeploying the samepreview_nameupdates itlist_previews / delete_preview - List a Worker's previews with their URLs, or delete one by name
Workers
list_workers - List all Workers in your account with created/modified/last-deployed times and workers.dev/observability status
get_worker - Settings (bindings, compat date/flags, placement, observability) plus cron triggers and workers.dev status
get_worker_code - Download a Worker's deployed source (all modules)
deploy_worker - Upload and deploy ES-module Workers with bindings (
plain_text,secret_text,kv_namespace,r2_bucket,d1,assets). Each module is inlinecontentor a local filepath(bundled.js,.wasm, text/data), so large sources never pass through the conversation. Existing secrets are kept across redeploysupdate_worker_settings - Change bindings/compat/logpush/observability without re-uploading code (existing secrets are kept unless listed)
delete_worker - Permanently delete a Worker (optional
force)
Secrets
list_secrets - Secret names and types on a Worker (values are never returned)
set_secrets - Set or delete several secrets in one new deployed version (
nulldeletes) without touching code or other bindingsdelete_secret - Remove one secret
Versions & deployments
list_versions / get_version - Immutable version history and per-version detail
create_version - Staged upload that does NOT touch live traffic
list_deployments / create_deployment - Map traffic to versions: single version at 100% or gradual splits (e.g. 90/10)
rollback_worker - Deploy an older version back to 100% traffic
Domains, routing, cron
list_worker_domains / add_worker_domain / delete_worker_domain - Custom domains (zone must be active in your account)
set_workers_dev - Enable/disable
<name>.<account>.workers.devserving and version preview URLsget_cron_triggers / set_cron_triggers - Read or replace a Worker's cron trigger set
Observability
tail_worker - Live tail like
wrangler tailfor a short window (up to 50 s): requests,console.logoutput, exceptions and outcomes. Works on any Worker. Passtrigger_urlto send a request once connected and capture it in the same callquery_worker_logs - Workers Logs with time window, error filter, full-text search, and cursor paging to older events (
next_cursor). Requires observability enabled on the Workerhealth_check - Verify API token and connection to Cloudflare
Quick Start
Requires Node.js 22+.
Option A: install from npm
npm install -g cloudflare-workers-mcpOption B: clone and build locally (for code review)
git clone https://github.com/daniil-shumko/cloudflare-workers-mcp
cd cloudflare-workers-mcp
npm install
npm run build
npm test # unit + MCP protocol smoke, no creds neededConfigure Claude Desktop/Code
Create an API token with Workers Scripts: Edit (the "Edit Cloudflare Workers" template works; both user and account-owned tokens are fine), find your account ID in the dashboard, then:
{
"mcpServers": {
"cloudflare-workers": {
"command": "npx",
"args": ["cloudflare-workers-mcp"],
"env": {
"CLOUDFLARE_API_TOKEN": "your_token_here",
"CLOUDFLARE_ACCOUNT_ID": "your_account_id_here"
}
}
}
}(If you built from source, use "command": "node" with
"args": ["/absolute/path/to/cloudflare-workers-mcp/dist/index.js"] instead.)
Or with the Claude Code CLI:
claude mcp add cloudflare-workers \
-e CLOUDFLARE_API_TOKEN=your_token_here \
-e CLOUDFLARE_ACCOUNT_ID=your_account_id_here \
-- npx cloudflare-workers-mcpUsage Examples
Deploy the ./dist folder as a static site called my-blogDeploy ./build as an SPA — client-side routing should fall back to index.htmlDeploy this worker script with a KV binding for CACHE (namespace abc123)Stage the new version without deploying, then roll it out 10% / 90%Roll my-api back to the previous versionAttach app.example.com to my-api and add a cron trigger every 30 minutesShow me the errors my-api logged in the last 2 hoursTail my-api while you hit /checkout and tell me why it throwsDeploy ./dist as a preview of my-blog called redesignRotate STRIPE_KEY on my-api and remove the old LEGACY_TOKEN secretImportant Notes
Static site deploys
Unchanged files are deduped server-side: redeploying an identical directory uploads zero bytes and still creates a new version.
A
_headersor_redirectsfile at the directory root is applied as configuration (syntax), not uploaded as a public asset. A root.assetsignoreis applied with gitignore-style rules (globs,!negation,dir/and/anchoredpatterns; character classes unsupported) and the result reports how many files it excluded.Limits: 25 MiB per file; 20,000 files per version on free plans (100,000 on paid). Static-asset requests are free and unmetered.
Symlinks inside the directory are followed; symlinks pointing outside it abort the deploy.
Versions & rollouts
create_versionstages code; onlycreate_deployment(or a direct deploy) shifts traffic. Gradual rollouts split across at most two versions and percentages must sum to 100.Rollbacks reach the 100 most recent versions and never revert data in bound resources (KV, R2, D1); a changed secret blocks rollback unless
forceis set.Tools that build on the current version (
redeploy_assets,deploy_worker/create_versionwithkeep_assets, and binding or compatibility changes inupdate_worker_settings) refuse while a staged version or a gradual rollout is pending. Otherwise the staged code would silently become the base. Deploy or roll back first withcreate_deployment.Cloudflare also blocks secret edits while the newest version isn't the deployed one, for example right after a rollback (error 10215). Redeploy with
deploy_workeror deploy the newest version, then retry.
Domains & serving
Custom domains require the zone to be active in the same Cloudflare account — external/partial zones are not supported (unlike Pages).
Deploy tools enable workers.dev serving for newly created Workers so the result carries a working URL. Redeploys never change an existing Worker's workers.dev setting unless
enable_workers_devis passed explicitly — a deliberately disabled Worker stays private.When
compatibility_dateis omitted, deploys preserve the existing Worker's pinned date (new Workers get today's date) — a redeploy never silently activates newer runtime behavior.
Cron & logs
set_cron_triggersreplaces the full trigger set; pass[]to clear.query_worker_logsneeds the Worker uploaded with observability enabled (deploy_worker'senable_observability, orupdate_worker_settings). Retention is 3 days (free) / 7 days (paid).tail_workerneeds no setup but only sees traffic during its window, so usetrigger_url(https only, redirects not followed) or send traffic while it runs. Request headers andcfmetadata are dropped from the results.
Secrets & previews
Every
set_secrets/delete_secretcall creates and deploys a new version. Secret values travel through the conversation, so for highly sensitive valueswrangler secret putkeeps them out of it.Previews use Cloudflare's beta Worker Previews API and attach to an existing Worker (deploy production first).
deploy_previewturns on the Worker's preview URLs (previews_enabled) if they are off. It never changes production workers.dev serving.
Development
npm run build # compile to dist/ (tsup, ESM)
npm run typecheck # tsc --noEmit
npm test # unit + protocol smoke — safe, no creds, CI-ready
npm run test:unit # pure-logic units, fully mocked fetch
npm run test:protocol # drives the built server over the MCP stdio wire
npm run test:live # guarded live e2e (CF_LIVE_TEST=1 + real creds)See test/README.md for the test layering. The live e2e
deploys a throwaway cf-mcp-test-* site through the real server, verifies it
serves over HTTP, and always cleans up.
Related Links
IMPLEMENTATION_PLAN.md - Verified API reference, design decisions, milestone history
cloudflare-pages-mcp - The maintenance-mode predecessor for existing Pages projects
Workers static assets docs - What this server wraps
Direct upload protocol - The asset-upload flow behind
deploy_static_site
License
MIT License - see LICENSE for details.
Available Tools
29 toolsadd_worker_domainAdd Worker DomainAIdempotent
Attach a custom domain to a Worker. The domain's zone must be active in this Cloudflare account (external zones are not supported); Cloudflare creates the DNS record and certificate automatically.
Inputs: service (required), hostname (required), zone_id, zone_name, +1 more.
create_deploymentCreate DeploymentADestructive
Point live traffic at Worker versions: a single version at 100%, or a gradual rollout splitting traffic across two versions (e.g. 90/10). Percentages must sum to 100.
Inputs: versions (required), script_name (required), force, message.
create_versionCreate Version (staged)A
Upload a new Worker version WITHOUT deploying it — live traffic is unchanged until the version is referenced by create_deployment. Use for staged rollouts. Existing secrets carry over unless you pass a binding with the same name.
Inputs: modules (required), script_name (required), tag, message, +5 more.
delete_previewDelete PreviewADestructive
Delete a Worker preview and its deployments, by name, slug or id. Production is unaffected.
Inputs: preview (required), script_name (required).
delete_secretDelete SecretADestructive
Delete one secret binding from a Worker. This creates and deploys a new version without the secret, so code reading it will see undefined.
Inputs: name (required), script_name (required).
delete_workerDelete WorkerADestructive
Permanently delete a Worker script, including its versions, deployments, and any static assets. Set force to delete even when other resources depend on it.
Inputs: script_name (required), force.
delete_worker_domainDelete Worker DomainADestructive
Detach a custom domain from its Worker. The hostname stops routing to the Worker (and its previews).
Inputs: domain_id (required).
deploy_previewDeploy PreviewA
Deploy a preview of an existing Worker without touching production: either a static-site directory (assets) or Worker code (modules). Returns a stable per-preview URL (https://-..workers.dev) and a per-deployment URL. Re-deploying the same preview_name updates that preview. Uses the beta Worker Previews API.
Inputs: script_name (required), preview_name (required), modules, bindings, +7 more.
deploy_static_siteDeploy Static SiteADestructive
Deploy a local directory as a static site on Workers (assets-only Worker): builds the file manifest, uploads only files Cloudflare doesn't already have, and deploys. Newly created sites are served on workers.dev. Set not_found_handling to 'single-page-application' for SPAs, and base_path to serve the site under a URL prefix (e.g. '/docs'). _headers/_redirects at the directory root are applied as configuration (not uploaded), and .assetsignore rules (gitignore-style) exclude files from the deploy. Deploying over a Worker that has code replaces it with assets only, which removes its bindings and secrets.
Inputs: directory (required), script_name (required), base_path, html_handling, +3 more.
deploy_workerDeploy WorkerADestructive
Upload and deploy a Worker script (ES modules) with optional bindings (plain_text, secret_text, kv_namespace, r2_bucket, d1, assets). Replaces the Worker's code and binding set if it already exists; existing secrets are kept unless you pass a binding with the same name. Each module is either inline content or a local file path; prefer path for bundled or large code (the server reads the file, so the source stays out of the conversation, and binary .wasm modules work). Set keep_assets to retain a site's static assets while updating code. By default a new Worker is served on workers.dev.
Inputs: modules (required), script_name (required), bindings, keep_assets, +5 more.
get_cron_triggersGet Cron TriggersBRead-onlyIdempotent
Get a Worker's cron triggers (scheduled events).
Inputs: script_name (required).
get_versionGet VersionARead-onlyIdempotent
Get a Worker version's detail: main module, bindings, compatibility date/flags, asset config, placement and limits for that immutable snapshot.
Inputs: version_id (required), script_name (required).
get_workerGet WorkerARead-onlyIdempotent
Get a Worker's settings (bindings, compatibility date and flags, placement, observability, logpush) for its live version, plus its cron triggers and workers.dev subdomain status.
Inputs: script_name (required).
get_worker_codeGet Worker CodeARead-onlyIdempotent
Download the source code of a Worker's live version: one entry per module. Service-worker-syntax Workers return a single script; assets-only Workers have no code.
Inputs: script_name (required).
health_checkHealth CheckARead-onlyIdempotent
Verify the API token is valid and connection to Cloudflare is working. Useful for troubleshooting authentication issues.
Inputs: no named parameters.
list_deploymentsList DeploymentsARead-onlyIdempotent
List a Worker's deployments (newest first). Each deployment maps traffic percentages to one or more versions; the newest deployment is the live one.
Inputs: script_name (required).
list_previewsList PreviewsBRead-onlyIdempotent
List a Worker's previews with their stable URLs (beta Worker Previews API).
Inputs: script_name (required).
list_secretsList SecretsARead-onlyIdempotent
List the secret bindings on a Worker (names and types only; Cloudflare never returns secret values).
Inputs: script_name (required).
list_versionsList VersionsARead-onlyIdempotent
List a Worker's 100 most recent versions (newest first): version ID, number, author, source, and deploy message/tag. Versions are immutable snapshots; use list_deployments to see which are live.
Inputs: script_name (required).
list_worker_domainsList Worker DomainsARead-onlyIdempotent
List custom domains attached to Workers in this account. Optionally filter by Worker name, hostname, or zone.
Inputs: service, zone_id, hostname, zone_name, +1 more.
list_workersList WorkersARead-onlyIdempotent
List all Workers in your account: name, created/modified/last-deployed timestamps, and whether workers.dev serving and observability are on.
Inputs: no named parameters.
query_worker_logsQuery Worker LogsARead-onlyIdempotent
Query a Worker's logs (Workers Logs / observability). Returns the most recent matching events with message, outcome, request, and timing. The Worker must have observability enabled (deploy_worker's enable_observability or update_worker_settings).
Inputs: script_name (required), limit, cursor, search, +2 more.
redeploy_assetsRedeploy AssetsADestructive
Create and deploy a new version of an assets-only Worker that reuses its live version's files and asset config, e.g. to bump compatibility_date. It cannot change html_handling/not_found_handling/base_path; use deploy_static_site for that (unchanged files dedupe, so nothing is re-uploaded). Refuses while a staged version or a gradual rollout is pending.
Inputs: script_name (required), compatibility_date.
rollback_workerRollback WorkerADestructive
Roll a Worker back by deploying an older version at 100% traffic. Only the 100 most recent versions are eligible; bound resources (KV, R2, D1 data) are NOT reverted.
Inputs: version_id (required), script_name (required), force, message.
set_cron_triggersSet Cron TriggersADestructiveIdempotent
Replace a Worker's full cron trigger set (the Worker must export a scheduled handler). Pass an empty list to remove all triggers.
Inputs: crons (required), script_name (required).
set_secretsSet SecretsADestructiveIdempotent
Create, update or delete secrets on a Worker without touching its code or other bindings. All changes land in ONE new version, deployed immediately. Pass a string to set a secret and null to delete it. Values are never echoed back. Secret values pass through the conversation, so for highly sensitive values prefer wrangler secret put.
Inputs: secrets (required), script_name (required).
set_workers_devSet workers.dev ServingAIdempotent
Enable or disable serving a Worker on its <script_name>..workers.dev subdomain, and optionally version preview URLs.
Inputs: enabled (required), script_name (required), previews_enabled.
tail_workerTail WorkerARead-only
Live-tail a Worker for a short window, like wrangler tail: returns requests, console logs, exceptions and outcomes as they happen. Works on any Worker; observability doesn't need to be enabled. Only traffic during the window is captured, so pass trigger_url to send a request once connected. For historical logs use query_worker_logs.
Inputs: script_name (required), search, max_events, errors_only, +2 more.
update_worker_settingsUpdate Worker SettingsADestructiveIdempotent
Update a Worker's settings (bindings, compatibility date/flags, logpush, observability) without re-uploading its code. Bindings REPLACE the Worker's full binding set, except that existing secrets are kept unless listed. Binding and compatibility changes deploy a new version; refuses while a staged version or a gradual rollout is pending.
Inputs: script_name (required), logpush, bindings, observability, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools map to a distinct resource+action, and descriptions actively disambiguate the tricky pairs (deploy_worker vs create_version vs deploy_preview, tail_worker vs query_worker_logs). However, get_worker and get_version both return bindings/compatibility settings for overlapping scopes, and delete_secret is essentially a shortcut for set_secrets' null-delete path, creating minor redundancy.
The set overwhelmingly follows verb_noun (list_workers, create_deployment, add_worker_domain, rollback_worker, set_cron_triggers). Minor deviations: health_check reverses the order to noun_verb, and the secret tools mix plural and singular (list_secrets/set_secrets vs delete_secret), which slightly obscures that delete_secret is the same family.
29 tools is heavy, but the domain is genuinely broad (deploy, versions, deployments, domains, cron, secrets, logs, previews, static sites). Most tools earn their place, though a few (delete_secret, redeploy_assets) could be folded into existing operations to trim the surface.
Lifecycle coverage is strong: deploy, version, deployment, rollback, previews, domains, cron, secrets, logs, and auth health are all present. Notable gaps remain around zone route patterns (only custom domains are supported), deleting individual versions, and inspecting a specific deployment by ID.
Maintenance
Related MCP Connectors
Build, validate and deploy workflows as Cloudflare Workers in your own account, with approval.
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Agent personas for Claude. 16 tools, 13 personas, 3 workflows. Zero extra API cost. Free.
Related MCP Servers
- AlicenseBqualityDmaintenanceExposes Cloudflare DNS, security, redirects and zone-settings functionality as structured tools that AI assistants like Claude Desktop can invoke directly.18MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Cloudflare resources through natural language, including DNS records, zone management, Workers KV storage, cache purging, and analytics. Supports comprehensive Cloudflare operations with secure API token authentication.132MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Cloudflare infrastructure including DNS records, cache purging, SSL settings, Workers, and analytics through the Cloudflare API. Eliminates dashboard context-switching by allowing natural language control of domain management and infrastructure operations.-
- AlicenseBqualityCmaintenanceEnables deterministic, typed tool calls for managing Cloudflare infrastructure, including D1 SQL queries, Workers inventory, KV/R2 storage, DNS records, and on-demand documentation search.17MIT