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: SourceFile rows on the Application.
  • How writes happen: update_source_file, bulk_update_source_files, delete_source_file via MCP. After each write, Webase enqueues a background BundleApplicationJob (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 BuildSourceFile snapshot per build for audit / browse, but the snapshot never serves traffic.
  • How writes happen: upload_build with a base64-encoded tar.gz of the compiled bundle (must contain index.html at 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 Build row. Activation is atomic — previous active build flips to superseded in the same transaction. Rollback is just flipping the active flag back.

Side by side

Concern browser_bundler external_static
Who compilesWebase (sidecar)The agent (locally)
Reactesm.sh@19 via import mapnpm (any version)
TailwindCDN script tagPostCSS, full config
RouterHashRouter onlyBrowserRouter or HashRouter
Other npm depsesm.sh URL or package.json (auto-mapped)Real npm install
Preview latency~2-5 s after writeImmediate after upload
RollbackEdit history of SourceFilesrollback_build(build_id)
In-app editorFull editing experienceRead-only file viewer (planned)
MCP endpoint defaultManagedExternal

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.