Skip to main content
Glama
Cloudflare Workers MCP Server

Cloudflare Workers MCP Server

Deploy Static Site

deploy_static_site
Destructive

Deploys a local directory as an assets-only static site on Cloudflare Workers, uploading only missing files and applying headers, redirects, ignore rules, SPA routing, and base-path configuration.

Instructions

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.

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>",
      "directory": "<directory>"
    },
    "name": "deploy_static_site"
  }
}

Input Schema

NameRequiredDescriptionDefault
base_pathNoServe the assets under this URL prefix, e.g. '/blog' (default '/'). Paths in _headers and _redirects must include the prefix; requests outside it don't resolve assets. Cloudflare is rolling this out per account — a non-root value may fail with error 100343 until enabled.
directoryYesPath to the built site directory to upload (absolute path recommended)
script_nameYesWorker name to deploy the site as (lowercase, alphanumeric and hyphens)
html_handlingNoHow HTML URLs are canonicalized (default: auto-trailing-slash)
compatibility_dateNoWorker compatibility date (YYYY-MM-DD); defaults to today
enable_workers_devNoServe the site at <script_name>.<account>.workers.dev. Default: enabled for newly created Workers; existing Workers keep their current setting.
not_found_handlingNoResponse when no asset matches: 'single-page-application' serves /index.html (SPA mode), '404-page' serves /404.html (default: none)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 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 / base_path
      Added value: +{
      +  "description": "Serve the assets under this URL prefix, e.g. '/blog' (default '/'). Paths in _headers and _redirects must include the prefix; requests outside it don't resolve assets. Cloudflare is rolling this out per account — a non-root value may fail with error 100343 until enabled.",
      +  "pattern": "^\\/",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description adds the substance the agent needs: only missing files are uploaded, _headers/_redirects are applied as config rather than uploaded, .assetsignore excludes files, and most importantly that deploying over a coded Worker replaces it with assets only and strips its bindings and secrets. That last clause is exactly the consequence an agent must know before invoking a destructive tool.

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?

The core action is front-loaded in the first clause, and each subsequent sentence covers a distinct concern (hosting, SPA/prefix options, config files, destructive replacement). It is dense but every sentence earns its place; minor cost is that configuration-file rules and parameter hints share one long paragraph rather than being visually separated.

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 destructive, seven-parameter deploy tool with no output schema, the description covers the risk profile, incremental upload behavior, config-file handling, and ignore semantics. The one gap is that it never says what the call returns (e.g., the deployed URL or version id), which matters since there is no output schema to lean on.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters are already documented, including enum values and the base_path prefix caveat. The description restates SPA mode and the base_path purpose without adding syntax, defaults, or constraints beyond what the schema carries, so it sits at the expected baseline.

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

Purpose5/5

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

"Deploy a local directory as a static site on Workers (assets-only Worker)" names a specific verb and resource and immediately scopes it as assets-only, which is what separates it from the sibling deploy_worker that handles code. It also enumerates the mechanics (manifest build, incremental upload, deploy) so the agent knows the operation's shape.

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

Usage Guidelines4/5

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

It gives actionable when-to-use guidance for two optional parameters (SPA mode via not_found_handling, prefix serving via base_path) and makes the assets-only vs code distinction clear. It stops short of explicitly naming deploy_worker or redeploy_assets as the alternative, so the routing decision requires the agent to infer from 'assets-only Worker'.

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