MCP Server
Quick Start
Two end-to-end walkthroughs: one for chat-class agents (ChatGPT, Claude.ai), one for desktop coding agents (Claude Code, Codex). Pick the one that matches your environment.
Chat agent flow (ChatGPT, Claude.ai)
Endpoint: https://www.webase.com/mcp/managed/messages. The agent generates source files via MCP; Webase compiles automatically in the background. Preview is live within a few seconds of the last write.
- Discover constraints. Call
get_runtime_constraintsto learn the entry-point candidates, import map, Tailwind / HashRouter rules, and the data API URL shape. - Create an empty app.
The defaulttools/call create_application { name: "Daily Standup", description: "Team standup tracker" }build_modeisbrowser_bundler, which is what chat agents want. - (Optional) Define schemas.
tools/call create_data_model { application_id_or_slug: "daily-standup", name: "Posts", fields: [ { name: "user", field_type: "String" }, { name: "plan", field_type: "Text" }, { name: "date", field_type: "Date" } ] } - Write the source tree. One MCP call writes everything; pass
delete_missing: trueto mirror an external file tree exactly.tools/call bulk_update_source_files { application_id_or_slug: "daily-standup", files: [ { filename: "src/index.tsx", content: "..." }, { filename: "src/App.tsx", content: "..." }, { filename: "public/index.html", content: "..." }, { filename: "package.json", content: "{...}" } ], delete_missing: true } - Get the preview URL.
The bundle finishes within a few seconds of the previous step.tools/call get_preview_url { application_id_or_slug: "daily-standup" } // → { "preview_url": "https://www.webase.com/preview/daily-standup", ... } - Iterate. Edit individual files with
update_source_file, mutate records withcreate_record/update_record/delete_record, runevaluate_applicationfor a quality signal. - Deploy.
deploy_applicationpushes the compiled bundle to Netlify and returns the production URL.
Coding agent flow (Claude Code, Codex)
Endpoint: https://www.webase.com/mcp/external/messages. The agent codes with any local toolchain (Vite, Next, plain esbuild — full npm), builds locally, and uploads the compiled tree.
- Discover constraints. Call
get_runtime_constraints— only theexternal_staticanddata_apisections apply. - Create the app with build_mode
external_static.tools/call create_application { name: "Daily Standup", build_mode: "external_static" } - Build locally with anything.
npm create vite,next build, plain esbuild — your call. Real npm dependencies, real Tailwind via PostCSS, BrowserRouter is fine because Webase servesindex.htmlas the SPA fallback. - Upload the build. One call uploads the compiled assets and (optionally) the source snapshot, atomically, in a single transaction.
The new build becomes active atomically; the previous active build is marked superseded.# In a shell on the agent's machine: BUILD_TAR=$(tar -cz -C dist . | base64) SRC_TAR=$(tar -cz . --exclude=node_modules --exclude=dist --exclude=.git | base64) # Then via MCP: tools/call upload_build { application_id_or_slug: "daily-standup", build_tarball_base64: "$BUILD_TAR", source_tarball_base64: "$SRC_TAR" } - Preview is live immediately. Webase serves
index.htmlat/preview/<slug>and any other asset at/preview/<slug>/<path>. Hashed asset filenames get long-lived immutable cache headers automatically. - Iterate. Edit, rebuild, upload again. Each
upload_buildcreates a newBuildrow; activation is atomic. - Roll back if needed.
list_builds→rollback_build(build_id). Activation flips, preview swaps instantly.
What every agent should know
- Reads are cheap. Repeatedly call
get_application,list_source_files(include_content: true),list_records(humanize_keys: true)— none cost message credits. - Records use field IDs as keys in their canonical storage form. Pass
humanize_keys: trueon reads to swap field names in. - Evaluations are free.
evaluate_applicationreturns a structured score + per-requirement check without consuming credits. - Deploy is separate from preview.
get_preview_urlreturns the Webase-hosted preview;deploy_applicationpublishes to Netlify.