name = "tldraw-mcp-app" main = "src/worker.ts" # Keep in sync with WORKER_COMPATIBILITY_DATE in src/shared/types.ts compatibility_date = "2025-03-10" compatibility_flags = ["nodejs_compat"] preview_urls = true [assets] directory = "./dist" binding = "ASSETS" run_worker_first = true [durable_objects] bindings = [ { class_name = "TldrawMCP", name = "MCP_OBJECT" }, { class_name = "CanvasStore", name = "CANVAS_STORE" }, ] [[migrations]] tag = "v1" new_sqlite_classes = ["TldrawMCP"] [[migrations]] tag = "v2" new_sqlite_classes = ["CanvasStore"] [vars] # Set this to the public URL of the worker. Used for constructing absolute image URLs. # Override with `--var WORKER_ORIGIN:https://your-tunnel.trycloudflare.com` for cloudflared tunnels. WORKER_ORIGIN = "https://tldraw-mcp-app.tldraw.workers.dev" # Default to production-safe widget behavior. Local dev scripts override this with # `--var MCP_IS_DEV:true` so local HTTP connectors omit `ui.domain`. MCP_IS_DEV = "false" [[analytics_engine_datasets]] binding = "MCP_ANALYTICS" dataset = "MCP_ANALYTICS" [[worker_loaders]] binding = "LOADER" #################### Rate limiting #################### [[ratelimits]] name = "RATE_LIMITER" namespace_id = "2001" [ratelimits.simple] limit = 30 period = 60 #################### Observability #################### [observability] enabled = true # Invocation logs record every invocation, including ones that produce no output # of their own. The Agents SDK spends three Durable Object invocations per MCP # request on session routing before any work happens (a `set-name` fetch, plus # `getInitializeRequest` and `updateProps` RPCs), so those empty records were # roughly 80% of this worker's log volume. Turning them off keeps `console` # output — head sampling would drop real errors along with the noise. [observability.logs] invocation_logs = false