用途:让 Hermes Agent 通过 twozero MCP 驱动运行中的 TouchDesigner 实例,完成算子创建、参数设置、连线、执行 Python 与实时视觉搭建。架构为 Hermes Agent → MCP(Streamable HTTP) → twozero.tox(端口40404) → TD Python。
主要能力:36 个原生工具。常用核心工具包括 td_execute_python、td_create_operator、td_set_operator_pars、td_get_operator_info、td_get_network、td_get_errors、td_get_par_info、td_get_hints、td_get_focus;读写类有 td_read_dat、td_write_dat、td_read_chop、td_read_textport;视觉类有 td_get_screenshot、td_get_screenshots、td_get_screen_screenshot、td_navigate_to;搜索类有 td_find_op、td_search;系统类有 td_get_perf、td_list_instances、td_get_docs、td_agents_md、td_reinit_extension、td_clear_textport。另有输入自动化与 admin/dev 两组工具(td_input_execute、td_project_quit 等),文档建议仅在用户明确要求时使用。工具具备上下文感知,能识别当前选中算子与网络。健康检查可访问 http://localhost:40404/mcp。
使用方式:从 Nous 插件目录安装并启用插件,命令为 hermes plugins install touchdesigner 与 hermes plugins enable td;启用后为每个新会话注册 twozero MCP 服务器(http://127.0.0.1:40404/mcp),无需写入 config.yaml 的 mcp_servers。可用脚本 bash "${HERMES_SKILL_DIR}/scripts/setup.sh" 做检查、下载与健康探测。手动步骤不可自动化:将 ~/Downloads/twozero.tox 拖入 TD 网络编辑器并点击 Install;点 twozero 图标 → Settings → mcp → 开启 auto start MCP;重启 Hermes 会话。验证命令:nc -z 127.0.0.1 40404 && echo "twozero MCP: READY"。若曾用旧方式安装,需从 ~/.hermes/config.yaml 移除重复条目。
重要规则:设置参数前必须先调用 td_get_par_info 确认参数名,不要凭记忆猜测;出现 tdAttributeError 时先调用 td_get_operator_info;脚本回调不要硬编码绝对路径,使用 me.parent() / scriptOp.parent();优先使用原生工具而非 td_execute_python;构建前调用 td_get_hints。清理与创建应拆分为不同 MCP 调用,避免同名节点重建报错。
适用场景:实时视觉、音频反应式 GLSL、生成式视觉、录像导出、网络构建与调试。限制:TouchDesigner 仅支持 Windows 与 macOS,无 Linux 版本;MCP 仅在 localhost 通信且无认证;td_execute_python 拥有 TD 进程用户级文件系统权限;非商用版分辨率上限 1280×1280,H.264/H.265/AV1 编码需商用许可,推荐 prores 或 mjpa;录像导出用 MovieFileOut 而非 TOP.save()。