Skip to main content
Glama
TouchDesigner MCP

TouchDesigner MCP

# TouchDesigner MCP

通过标准 MCP Server 控制正在运行的 TouchDesigner。TD 端使用可拖入的 .tox 组件提供本地 HTTP 桥接,MCP Server 通过 stdio 对外暴露工具。

内容

  • outputs/TD_MCP_Bridge.tox:TouchDesigner 组件,拖入 TD 即可使用。

  • src/:标准 MCP Server 源码。

  • touchdesigner/install_td_mcp.py:开发/重建 .tox 用的 TD 安装脚本。

Related MCP server: td-mcp

使用 TouchDesigner 组件

  1. 打开目标 .toe。

  2. 将 outputs/TD_MCP_Bridge.tox 拖入 TouchDesigner 网络编辑区。

  3. 选中 TD_MCP_Bridge 组件。

  4. 在 MCP 参数页设置:

    • 端口:默认 9980

    • 访问令牌:请自行设置,不要公开

    • 服务开关:打开后启动 Web Server DAT

  5. 连接地址通常是:

http://127.0.0.1:9980/api

安装 Node.js 依赖

要求 Node.js 20 或更高版本:

npm install
npm run build

MCP Client 配置示例

把 <项目目录> 替换为你本机 clone 后的目录,把 <访问令牌> 替换为 TD 组件 MCP 参数页里的访问令牌。

{
  "mcpServers": {
    "touchdesigner": {
      "command": "node",
      "args": [
        "<项目目录>/dist/index.js"
      ],
      "env": {
        "TD_MCP_URL": "http://127.0.0.1:9980/api",
        "TD_MCP_TOKEN": "<访问令牌>",
        "TD_MCP_TIMEOUT_MS": "10000"
      }
    }
  }
}

可用能力

  • td_ping

  • td_project_info

  • td_list_operators

  • td_operator_info

  • td_get_parameters

  • td_set_parameter

  • td_pulse_parameter

  • td_create_operator

  • td_connect_operators

  • td_disconnect_input

  • td_set_node_position

  • td_get_dat_text

  • td_set_dat_text

  • td_destroy_operator

  • td_save_project

  • td_execute_python

安全说明

  • 不要提交 .env 或真实访问令牌。

  • 默认只建议绑定本机 127.0.0.1 使用,不要把端口暴露到公网。

  • td_execute_python 默认关闭;确有需要时,在 TD 组件的 MCP 参数页手动开启 允许任意 Python。

  • td_destroy_operator 需要显式传入 confirm=true,并且桥接组件与工程根节点受保护。

验证

npm test

Available Tools

16 tools
td_connect_operatorsC

连接两个 Operator 的输出和输入连接器。

Inputs: source (required), target (required), target_input, source_output.

td_create_operatorC

在父 COMP 内创建新的 Operator。

Inputs: name (required), parent (required), op_type (required), node_x, +1 more.

td_destroy_operatorA

删除 Operator。必须明确传入 confirm=true;不能删除根节点或桥接自身。

Inputs: path (required), confirm (required).

td_disconnect_inputC

断开目标 Operator 的指定输入连接。

Inputs: target (required), target_input.

td_execute_pythonB

在 TouchDesigner 主环境执行 Python。TD 桥接的 Allow Python 默认关闭,只有显式开启后可用。

Inputs: code (required).

td_get_dat_textC

读取 Text DAT 等 DAT 的文本内容。

Inputs: path (required), max_chars.

td_get_parametersC

读取一个 Operator 的参数值、表达式、模式和只读状态。

Inputs: path (required), names.

td_list_operatorsB

递归列出指定根节点下的 Operators,可按名称、路径、OP 类型或 family 过滤。

Inputs: root, limit, family, op_type, +2 more.

td_operator_infoB

读取一个 Operator 的类型、连接、位置、子节点和可选参数。

Inputs: path (required), parameter_limit, include_parameters.

td_pingA

检查 TouchDesigner 桥接是否在线。

Inputs: no named parameters.

td_project_infoA

读取当前 TouchDesigner 工程、版本、时间轴和桥接信息。

Inputs: no named parameters.

td_pulse_parameterC

触发 Pulse 类型参数,例如 reset、reload、save。

Inputs: name (required), path (required).

td_save_projectA

保存当前 TouchDesigner 工程;可选另存为指定 .toe 路径。

Inputs: path.

td_set_dat_textC

替换 Text DAT 等 DAT 的文本内容。

Inputs: path (required), text (required).

td_set_node_positionC

设置 Operator 在 Network Editor 中的位置。

Inputs: path (required), node_x (required), node_y (required).

td_set_parameterC

设置 Operator 参数的常量值或 Python 表达式。

Inputs: name (required), path (required), mode, value.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool has a distinct action and target (e.g., connect, create, destroy, get_dat, set_param). No two tools overlap in purpose, ensuring agents can clearly distinguish them.

    Naming Consistency5/5

    All tools follow a consistent 'td_verb_noun' pattern using snake_case. Verbs are uniform and descriptive, such as create/destroy/list/get/set, making the set predictable.

    Tool Count5/5

    With 16 tools covering connection management, operator CRUD, parameter access, execution, and project operations, the count is well-scoped for TouchDesigner's domain without unnecessary bloat.

    Completeness4/5

    The set covers all major workflows: create, delete, connect, disconnect, parameter read/write, data table manipulation, and project save. Minor gaps like cloning or timeline control exist but do not impede core tasks.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for controlling TouchDesigner from AI coding agents like Claude Code and Codex CLI, enabling operator manipulation, parameter control, and screenshot capture.
      12
      14 PyPI
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server + web dashboard for TouchDesigner. Inspect, optimize, and control TD patches from Claude Code or the browser.
      MIT