Skip to main content
Glama
Cloudflare Workers MCP Server

Cloudflare Workers MCP Server

Deploy Worker

deploy_worker
Destructive

Deploy or update a Cloudflare Worker by uploading ES module scripts with optional bindings; existing secrets remain unless overridden.

Instructions

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "script_name": "<script_name>",
      "modules": "<modules>"
    },
    "name": "deploy_worker"
  }
}

Input Schema

NameRequiredDescriptionDefault
modulesYesModules, each with inline content or a local file path; the first is the entry point unless main_module says otherwise
bindingsNoResource bindings (replaces the full set)
keep_assetsNoRetain the previous version's static assets (deploy code changes to a site without re-uploading files)
main_moduleNoEntry-point module name (default: first module)
script_nameYesWorker name (lowercase, alphanumeric and hyphens)
compatibility_dateNoYYYY-MM-DD; defaults to today (if omitted at the API level it would fall back to 2021-11-02)
enable_workers_devNoServe the Worker at <script_name>.<account>.workers.dev. Default: enabled for newly created Workers; existing Workers keep their current setting.
compatibility_flagsNoRuntime compatibility flags. nodejs_compat is on by default for compatibility_date >= 2026-08-04, so it is not needed with the default (today) date
enable_observabilityNoEnable Workers Logs for this Worker (required for query_worker_logs)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.4.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / compatibility_flags / description
      Added value: +"Runtime compatibility flags. nodejs_compat is on by default for compatibility_date >= 2026-08-04, so it is not needed with the default (today) date"
    • changedInput schema / properties / modules / description
      Previous value: -"ES modules; the first is the entry point unless main_module says otherwise"New value: +"Modules, each with inline content or a local file path; the first is the entry point unless main_module says otherwise"
    • addedInput schema / properties / modules / items / additionalProperties
      Added value: +false
    • changedInput schema / properties / modules / items / properties / content / description
      Previous value: -"Module source code"New value: +"Inline module source code. Use path instead for large or bundled sources"
    • changedInput schema / properties / modules / items / properties / content_type / description
      Previous value: -"Part content type (default application/javascript+module)"New value: +"Module content type. Default: inferred from the path's extension (.js/.mjs ES module, .cjs, .py, .wasm, .txt/.html/.sql text, .bin data), else application/javascript+module"
    • changedInput schema / properties / modules / items / properties / name / description
      Previous value: -"Module filename, e.g. index.js"New value: +"Module filename, e.g. index.js. Required with content; defaults to the file's basename with path"
    • addedInput schema / properties / modules / items / properties / path
      Added value: +{
      +  "description": "Local file to upload as this module (absolute path recommended), e.g. a bundled dist/index.js or a .wasm file. The server reads it, so the source never passes through the conversation",
      +  "type": "string"
      +}
    • removedInput schema / properties / modules / items / required
      Removed value: -[
      -  "name",
      -  "content"
      -]
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing the destructive mechanics: the code and the entire binding set are replaced on redeploy, while existing secrets survive unless a same-named binding is passed. It also explains the side-channel benefit of the path form (source never enters the conversation, binary .wasm works) and the default workers.dev serving behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action, then the replace-secrets rule, then the path-vs-content advice, then keep_assets. Every sentence carries weight, though the closing workers.dev sentence partly restates the enable_workers_dev schema description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter destructive mutation with no output schema, the description covers what is destroyed, what is preserved, and how to supply code safely. It stops short of saying what the call returns (version/deployment identifiers) or whether a deployment record is created, which matters given the create_version/create_deployment siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds real semantics on top, notably the secret-retention rule for bindings and the keep_assets behavior, which are cross-parameter effects not expressed in the schema. The path-vs-content and content_type guidance largely duplicates the existing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource pair ('Upload and deploy a Worker script') and scopes the payload (ES modules plus optional bindings). It does not explicitly name the sibling it is not (deploy_static_site, redeploy_assets, create_version/create_deployment), so the boundary with those is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage guidance is present but is parameter-level rather than tool-level: 'prefer path for bundled or large code', 'Set keep_assets to retain a site's static assets'. There is no statement of when to choose this over deploy_static_site, redeploy_assets, or create_version/create_deployment, so an agent must infer the routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.