UModeler X MCPis live — model with an AI agent
UModeler X

DSL Language

How to create and edit parametric shapes from a line-based script (DSL), and how the MCP integration works.

Parametric shapes can also be created and edited from a line-based script (DSL). Instead of assembling the scene by clicking, you write the whole structure as text and run it in one go.

group "Table" @0,0,0
  box "Top" w=2 h=.1 d=1 @0,1,0
  cylinder "LegFL" r=.05 h=1 @-0.9,0,-0.4
  cylinder "LegFR" r=.05 h=1 @0.9,0,-0.4

Two ways to run it

PathHowDocs
Script windowPaste a script into an editor window and press RunScript Window
MCP toolsAn MCP client drives the Unity Editor directlyMCP integration below

Both paths run exactly the same code. Validation rules, error messages and Undo behavior are identical.


The MCP tools

ToolWhat it doesSyntax
umx_parametric_shapeCreate and edit parametric shapes in the scene.Scene Script Syntax
umx_hotspotCreate and edit hotspot layout assets.Hotspot Script Syntax

Both tools take a single parameter, script. Instead of one tool call per object, a whole structure is built from one script — which cuts the number of calls and the token cost dramatically.


MCP integration

UModeler X detects the MCP package installed in your project and registers its tools automatically. No configuration or extra code is needed.

MCP packagePackage name
Unity AI Assistant / Unity MCPcom.unity.ai.assistant
Coplay — MCP for Unitycom.coplaydev.unity-mcp
Unity-MCP (Ivan Murzak)com.ivanmurzak.unity.mcp

Once the package is installed and compilation finishes, umx_parametric_shape and umx_hotspot appear in your MCP client's tool list.


Rules shared by both syntaxes

umx_parametric_shape and umx_hotspot share the same parser rules.

  • One statement per line.
  • Indentation is exactly 2 spaces per level, and depth cannot increase by more than one level at a time. Tabs are not allowed.
  • A line starting with # is a comment.
  • Names are wrapped in double quotes — "Table Top" may contain spaces.
  • Numbers use a period as the decimal separator (0.5, .1), independent of your locale.
  • Returned names use the form "Name#id". The #id part is how you target exactly one object when several share a name.

Validation before execution

Every script goes through these stages.

  1. Parse — indentation and token format
  2. Static validation — shape kind and parameter name whitelists
  3. Preflight — modifier types and parameters, and whether referenced targets exist
  4. Execution

If any error is found in stages 1 – 3, the scene is left completely untouched and only the error list comes back. Error messages always include a line number, and typos come back with the list of valid values.

If an individual node fails during stage 4, only that node and its children are skipped and the rest continues. The failure list is returned with the result.


DSL Language | UModeler X Manual