PreviewLabMcpServerConfig
open class PreviewLabMcpServerConfig(val enabled: Boolean = true, val host: String = "0.0.0.0", val port: Int = 7007, val additionalMcpServerSetting: Server.() -> Unit = {})
Configuration for the MCP (Model Context Protocol) server.
Note: MCP Server is an experimental feature. The API may change in future versions.
This class configures how the MCP server runs within PreviewLabGallery, allowing AI assistants (Claude Code, Claude Desktop, Cursor, etc.) to interact with previews.
// Default configuration (enabled on port 7007)
PreviewLabGalleryWindows(
previewList = myModule.PreviewList,
mcpServerConfig = PreviewLabMcpServerConfig(),
)
// Custom port
PreviewLabGalleryWindows(
previewList = myModule.PreviewList,
mcpServerConfig = PreviewLabMcpServerConfig(port = 8080),
)
// Disable MCP server
PreviewLabGalleryWindows(
previewList = myModule.PreviewList,
mcpServerConfig = PreviewLabMcpServerConfig.Disable,
)Content copied to clipboard
See also
PreviewLabGalleryWindows