Deploy Static Site
deploy_static_siteDeploys 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
| Name | Required | Description | Default |
|---|---|---|---|
| base_path | No | 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. | |
| directory | Yes | Path to the built site directory to upload (absolute path recommended) | |
| script_name | Yes | Worker name to deploy the site as (lowercase, alphanumeric and hyphens) | |
| html_handling | No | How HTML URLs are canonicalized (default: auto-trailing-slash) | |
| compatibility_date | No | Worker compatibility date (YYYY-MM-DD); defaults to today | |
| enable_workers_dev | No | Serve the site at <script_name>.<account>.workers.dev. Default: enabled for newly created Workers; existing Workers keep their current setting. | |
| not_found_handling | No | Response when no asset matches: 'single-page-application' serves /index.html (SPA mode), '404-page' serves /404.html (default: none) |