The preview helper and preview MCP host for AXSG preview orchestration.
This repo component is not a shipped global tool or public NuGet package. It is an operational host artifact used by:
XamlToCSharpGenerator.PreviewerHost supports two modes:
--mcpPreview MCP mode:
dotnet run --project src/XamlToCSharpGenerator.PreviewerHost -- --mcp
This host owns preview-session orchestration, not workspace analysis and not general runtime hot reload hosting.
It is responsible for:
axsg.preview.hotReloadIt uses the shared contracts from XamlToCSharpGenerator.RemoteProtocol.Preview, so MCP mode and the lightweight helper transport share the same normalized preview operation layer.
When started with --mcp, the host exposes:
axsg.preview.startaxsg.preview.hotReloadaxsg.preview.updateaxsg.preview.stopaxsg.preview.hotReload is the preferred mutation tool when the caller needs the in-process live-apply result. axsg.preview.update is the lower-level dispatch-only operation.
axsg://preview/session/statusaxsg://preview/session/eventsaxsg://preview/session/currentThe host advertises:
notifications/tools/list_changednotifications/resources/list_changedresources/subscribenotifications/resources/updatedThat dynamic behavior matters because the active preview session changes the available tool/resource catalog.
It is not:
Use:
XamlToCSharpGenerator.McpServer.Tool for workspace MCP queriesXamlSourceGenRuntimeMcpServer for live runtime hot reload, hot design, and studio stateXamlToCSharpGenerator.Previewer.DesignerHost as the internal designer-process layer that actually hosts source-generated preview runtime loadingThe preview pipeline is split intentionally:
XamlToCSharpGenerator.PreviewerHost
XamlToCSharpGenerator.Previewer.DesignerHost
This separation lets AXSG reuse the same preview session layer across the VS Code extension, MCP clients, and test harnesses.