MCP Server
Build Modes
Each Webase application has a build_mode: it determines who compiles the source and what gets served at /preview/:slug. The mode is set at create_application time and is not switched after.
browser_bundler (default)
Webase compiles the application's SourceFiles server-side into a single self-contained HTML document and stores it on applications.bundled_html. The in-app editor's live preview also bundles client-side via esbuild-wasm for instant feedback while typing.
- Best for: chat-class agents (ChatGPT, Claude.ai), the in-platform AI, and humans editing in the browser.
- Source of truth:
SourceFilerows on theApplication. - How writes happen:
update_source_file,bulk_update_source_files,delete_source_filevia MCP. After each write, Webase enqueues a backgroundBundleApplicationJob(debounced) that POSTs the source tree to the bundler sidecar and persists the result. - Preview latency: a few seconds after the last write.
- Constraints apply: see Runtime Constraints. esm.sh import map, Tailwind via CDN, HashRouter only.
external_static
The agent compiles the application locally with any modern toolchain (Vite, Next, plain esbuild) and uploads the compiled dist/ tree. Webase serves the assets directly from a BuildAsset table, with SPA fallback to index.html for unmatched paths.
- Best for: desktop coding agents (Claude Code, Codex) with full Node access.
- Source of truth: the agent's local repo. Webase optionally stores a
BuildSourceFilesnapshot per build for audit / browse, but the snapshot never serves traffic. - How writes happen:
upload_buildwith a base64-encoded tar.gz of the compiled bundle (must containindex.htmlat the root) and an optional second tarball with the source tree. - Constraints relax: any npm dependencies, real Tailwind via PostCSS, BrowserRouter is fine.
- Atomicity: each upload creates a new
Buildrow. Activation is atomic — previous active build flips tosupersededin the same transaction. Rollback is just flipping the active flag back.
Side by side
| Concern | browser_bundler | external_static |
|---|---|---|
| Who compiles | Webase (sidecar) | The agent (locally) |
| React | esm.sh@19 via import map | npm (any version) |
| Tailwind | CDN script tag | PostCSS, full config |
| Router | HashRouter only | BrowserRouter or HashRouter |
| Other npm deps | esm.sh URL or package.json (auto-mapped) | Real npm install |
| Preview latency | ~2-5 s after write | Immediate after upload |
| Rollback | Edit history of SourceFiles | rollback_build(build_id) |
| In-app editor | Full editing experience | Read-only file viewer (planned) |
| MCP endpoint default | Managed | External |
Why you can't switch modes mid-app
Each mode has a different source of truth (SourceFile rows vs the agent's local repo). Conflating them is asking for surprises. Pick the right mode at create_application time. If a user later wants to migrate, have them export the source and create a new app in the other mode.