MCP Tools (AI Agents)

The CrimsonUIToolset (module CrimsonUIEditor) lets an AI agent inspect and drive the CommonUI layer stack of a running PIE session over MCP. It registers only when Crimson MCP is enabled (Project Settings -> Crimson -> Crimson MCP; requires an editor restart - see CrimsonEditorUtilities -> Quick Start). All tools operate on the primary local player's root layout (UCrimsonPrimaryGameLayout) in the first PIE world that owns a local player - never the dedicated-server world, which shows no UI. The act tools push/pop widgets on the local UI only; errors surface to the agent as a script error.

ToolKindDescription
GetUIStatereadConfigured policy / dialog classes (from UCrimsonUISettings), the runtime UI policy class, local-multiplayer interaction mode, the primary player's root layout class + dormant flag, and registered-layer / widget counts.
ListLayersreadEvery UI.Layer.* layer on the root layout with its widget count and active (top) widget class, or not registered when the layout has no container for that tag.
GetLayerDetailreadOne layer's full widget stack, top-first, marking the active widget. Param: a UI.Layer.* tag (e.g. UI.Layer.GameMenu).
PushWidgetToLayeractCreate and push a UCommonActivatableWidget subclass onto a layer stack. Params: a registered UI.Layer.* tag and the widget's full class path (a _C suffix is appended for Blueprints).
PopWidgetFromLayeractRemove the active (top) widget from a layer stack. Param: a registered UI.Layer.* tag.