preview

command
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Command preview is a runnable MCP server built for inspecting gomukit: it exposes every widget the library renders as real MCP tools and ui:// resources, so an MCP Apps capable inspector drives them over the wire instead of through a fake host page.

It has two halves. The scenario is a small application, Acme Dispatch, with mutable state: customers and orders, listed, edited, confirmed and shipped through the widgets, where an action taken in one view shows up in the next. The gallery is a catalog: one tool per widget variant, each with its own resource, covering the renderings the scenario has no room for.

Run with streamable HTTP (default), then point the inspector at http://localhost:8081/mcp:

go run ./examples/preview

or over stdio, for hosts that spawn the server themselves:

go run ./examples/preview -stdio

Exposed publicly it should run with -sandbox, which gives every MCP session its own store: visitors still exercise the writing tools in full, but no one's edits reach anyone else's widgets.

Flags:

-addr             HTTP listen address (default :8081)
-mode             which tools to register: all, scenario or gallery (default all)
-quiet            do not log tool calls to stderr
-sandbox          give every session its own scenario store
-session-timeout  close idle sessions after this long (0 = never)
-cors             answer preflights and allow any origin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL