TD Run Python (live, UNSAFE)
td_run_pythonExecutes arbitrary Python code in a running TouchDesigner project via td_mcp bridge. Use for ad-hoc tasks not covered by structured live-control tools; requires the bridge's "Allow Python" flag to be enabled.
Instructions
Run ARBITRARY Python code inside a running TouchDesigner instance via the td_mcp bridge. WARNING: this is arbitrary code execution with full access to the TouchDesigner project and the host Python environment. It is DISABLED BY DEFAULT and only succeeds when the bridge's "Allow Python" flag is explicitly turned on; otherwise the bridge rejects the request. Prefer the structured live-control tools (td_build_template, td_set_parameter, td_connect, td_list_network, ...) for normal operations and only use this for ad-hoc Python that those cannot express. Returns stdout / the returned value plus any errors, warnings and scriptErrors from the bridge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source to execute in TouchDesigner. Runs in the project's Python context (td module available: op, ops, project, absTime, etc.). Only runs if the bridge's "Allow Python" flag is enabled. |