Core Concepts

Preview fixtures

Seed the dev View editor with static input from preview.ts.

preview.ts feeds the local View editor. It is dev-only and never ships in production.

Add a default fixture

Add preview.ts beside your tool:

get-forecast/preview.ts
export default { city: "San Francisco" };

Start the View editor

pnpm dev

The preview host loads the default fixture, calls your tool with that input, and renders the View iframe.

Add a second case

delete-rows/preview.ts
export default { query: "beta" };

export const empty = { query: "" };

Switch cases in the dev UI. Each named export becomes a selectable fixture.

Verify production excludes fixtures

pnpm build

preview.ts is not included in dist/manifest.json or the production tool registry.

Fixtures also drive MRTR previews. Export input that matches your tool schema, for example export default { query: "beta" }.

Reference

Fixture rules

RuleDetail
Locationsrc/tools/<name>/preview.ts only
Default exportPrimary fixture case
Named exportsAdditional cases in the dev UI
ProductionNever bundled or registered

Use bitmcp dev --csp-widget to edit CSP allowlists from the preview host.