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,
)

See also

PreviewLabGalleryWindows

Inheritors

Constructors

Link copied to clipboard
constructor(enabled: Boolean = true, host: String = "0.0.0.0", port: Int = 7007, additionalMcpServerSetting: Server.() -> Unit = {})

Types

Link copied to clipboard

Predefined configuration to disable the MCP server.

Properties

Link copied to clipboard

Additional configuration block for the MCP server.

Link copied to clipboard

Whether the MCP server is enabled. Defaults to true.

Link copied to clipboard

The host address to bind the server to. Defaults to "0.0.0.0".

Link copied to clipboard
val port: Int

The port number for the MCP server. Defaults to 7007.