Skip to main content
Glama

unreal_execute_python

Run Python scripts in the live Unreal Editor with full unreal API access to automate asset, level, Sequencer, and other editor workflows.

Instructions

Run Python in the live Unreal Editor with the full unreal API. The most powerful tool: anything the editor can do through Python is reachable here (Sequencer, Movie Render Queue, Variant Manager, Datasmith, Niagara, PCG, World Partition, Control Rig, data tables, ...).

    ``unreal`` is preloaded. Returns the ``result`` variable if set, else the last
    expression's value, plus stdout and a traceback on error. Return dicts/lists.
    Batch related steps into one script and wrap edits in
    ``unreal.ScopedEditorTransaction`` so they can be undone. Read
    ``unreal_get_guide("unreal_python")`` first and use ``unreal_lookup_api`` when
    unsure of a class or property.

    Requires advanced security mode and ``security.allow_python_execution``. In
    ``confirmation`` mode pass ``confirmed=true`` (preview with
    ``preview_only=true``). Safe Python execution (on by default) refuses, before
    anything runs, scripts that start programs, delete files or assets, use the
    network, quit the editor, run console commands or use eval/exec/__import__.

    ``timeout``: seconds (default 60, max 3600). Not a secure sandbox.
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "unreal_execute_python"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
timeoutNo
confirmedNo
preview_onlyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

Score is being calculated.

Deploy Server

Other Tools