Use the controller with Node
The controller does not require a browser worker. Any runtime that can list handlers and reset handlers fits the contract.
Runtime contract
Section titled “Runtime contract”interface MswRuntimeController { listHandlers(): readonly MswAnyHandler[]; resetHandlers(...nextHandlers: MswAnyHandler[]): void;}setupServer satisfies this pattern, which is why the Node example can reuse the same controller model.
Local example
Section titled “Local example”Run the example CLI:
pnpm dev:example-nodeAvailable commands include:
listuserprojectstoggle 1all offexit
Disabled state is persisted to apps/example-node/.msw-panel-state.json.
Why Node works cleanly here
Section titled “Why Node works cleanly here”The controller only depends on a runtime that can list handlers and reset handlers. That keeps the package useful outside the browser without special Node-specific UI logic.