Skip to content

code

code

MCP tools for code execution inside Houdini.

Exposes 4 tools for running Python code, HScript commands, evaluating expressions, and reading Houdini environment variables.

Functions:

Name Description
evaluate_expression

Evaluate an expression in Houdini and return its result.

execute_hscript

Execute an HScript command in Houdini.

execute_python

Execute Python code inside Houdini for scene-level scripting only.

get_env_variable

Get a Houdini environment variable value.

Functions

evaluate_expression async

evaluate_expression(
    ctx: Context, expression: str, language: str = "hscript"
) -> dict

Evaluate an expression in Houdini and return its result.

Parameters:

Name Type Description Default
expression
str

Expression string to evaluate.

required
language
str

Expression language, "hscript" or "python".

'hscript'

execute_hscript async

execute_hscript(ctx: Context, command: str) -> dict

Execute an HScript command in Houdini.

Parameters:

Name Type Description Default
command
str

HScript command string to execute.

required

execute_python async

execute_python(
    ctx: Context, code: str, return_expression: str | None = None
) -> dict

Execute Python code inside Houdini for scene-level scripting only.

Use create_node/create_wrangle for geometry work instead.

Parameters:

Name Type Description Default
code
str

Python source code to execute.

required
return_expression
str | None

Python expression to evaluate after execution.

None

get_env_variable async

get_env_variable(ctx: Context, var_name: str) -> dict

Get a Houdini environment variable value.

Parameters:

Name Type Description Default
var_name
str

Name of the environment variable.

required