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:
export default { city: "San Francisco" };Start the View editor
pnpm devThe preview host loads the default fixture, calls your tool with that input, and renders the View iframe.
Add a second case
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 buildpreview.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
| Rule | Detail |
|---|---|
| Location | src/tools/<name>/preview.ts only |
| Default export | Primary fixture case |
| Named exports | Additional cases in the dev UI |
| Production | Never bundled or registered |
Related
- Installation — first fixture setup
- Views — what the iframe renders after the tool call
- Connecting — preview host behavior
Use bitmcp dev --csp-widget to edit CSP allowlists from the preview host.