Skip to content
ClaudeUnreal
GitHub

UI & UMG

This content is not available in your language yet.

36 tools — 0 typed MCP · 36 via cu CLI.

  • UI — UMG Widgets — 24 tools
  • UI — Layout Containers — 6 tools
  • UI — Widget Operations — 5 tools
  • UI — Widget Animation — 1 tools

Create a new UMG Widget Blueprint for building in-game UI (HUDs, menus, overlays).

@mcp.tool()
@showcase(
"Create a new UMG Widget Blueprint for building in-game UI (HUDs, menus, overlays).",
featured=True,
)
def create_umg_widget_blueprint(
ctx: Context,
widget_name: str,
parent_class: str = "UserWidget",
path: str = "/Game/UI"
) -> ToolResult:
"""[UMG]
Create a new UMG Widget Blueprint.
Anti-patterns:
- Do not call this if an asset already exists at the path — handler
errors with "already exists"; use ``find_assets`` first to check.
- Do not pass ``path`` outside ``/Game/`` — engine/plugin mounts can't
host new widgets. Default ``/Game/UI`` is the conventional location.
- Do not pass an unknown ``parent_class`` — handler scans UMG/Engine
modules and the loaded UClass list, but custom C++ classes that
aren't loaded into the editor will fail.
Args:
widget_name: Name of the widget blueprint to create
parent_class: Parent class for the widget (default: UserWidget)
path: Content browser path where the widget should be created
Returns:
ToolResult containing success status and widget path
"""
from claude_unreal_server import get_unreal_connection
try:
unreal = get_unreal_connection()
if not unreal:
logger.error("Failed to connect to Unreal Engine")
return err("Failed to connect to Unreal Engine")
params = {
"name": widget_name,
"parent_class": parent_class,
"path": path
}
logger.info(f"Creating UMG Widget Blueprint with params: {params}")
response = unreal.send_command("create_umg_widget_blueprint", params)
if not response:
logger.error("No response from Unreal Engine")
return err(f"Created Widget Blueprint '{widget_name}': no response from Unreal Engine")
logger.info(f"Create UMG Widget Blueprint response: {response}")
if response.get("status") == "error":
return err(f"Created Widget Blueprint '{widget_name}' failed", error=response.get("error", "Unknown error"))
result = response.get("result", response)
return ok(f"Created Widget Blueprint '{widget_name}'", **result)
except Exception as e:
error_msg = f"Error creating UMG Widget Blueprint: {e}"
logger.error(error_msg)
return err(f"Created Widget Blueprint '{widget_name}' failed", error=error_msg)

Create widget animations with keyframed tracks for opacity, color, and transform.

@mcp.tool()
@showcase(
"Create widget animations with keyframed tracks for opacity, color, and transform.",
featured=True,
)
def add_widget_animation(
ctx: Context,
widget_name: str,
animation_name: str,
length: float = None
) -> ToolResult:
"""[UMG] Create a new Widget Animation inside a Widget Blueprint.
The animation can later have tracks added via add_widget_animation_track.
Anti-patterns:
- Do not pass ``length`` <= 0 — handler rejects ("must be positive").
- Do not call with an ``animation_name`` already in use on the same
WBP — handler errors instead of silently replacing.
Args:
ctx: The MCP context
widget_name: Name of the Widget Blueprint (e.g. "GameHUD")
animation_name: Name for the new animation (e.g. "FadeIn", "SlideUp")
length: Duration in seconds (default: 1.0)
Returns:
ToolResult with animation_name and length
"""
from claude_unreal_server import get_unreal_connection
try:
unreal = get_unreal_connection()
if not unreal:
return err(f"Created animation '{animation_name}' in '{widget_name}': no response from Unreal Engine")
params = {"blueprint_name": widget_name, "animation_name": animation_name}
if length is not None:
params["length"] = length
response = unreal.send_command("add_widget_animation", params)
if not response:
return err(f"Created animation '{animation_name}' in '{widget_name}': no response from Unreal Engine")
if response.get("status") == "error":
return err(f"Created animation '{animation_name}' in '{widget_name}' failed", error=response.get("error", "Unknown error"))
result = response.get("result", response)
return ok(f"Created animation '{animation_name}' in '{widget_name}'", **result)
except Exception as e:
return err(f"Created animation '{animation_name}' in '{widget_name}' failed", error=str(e))

add_uniform_grid_panel_to_widget CLI

Section titled “add_uniform_grid_panel_to_widget ”