[05] MCP

MCP

Built-in MCP server inside TouchDesigner. Connects AI agents (Claude Code, Cursor, Codex) to your live TD session over HTTP — they create operators, wire networks, read errors, run Python, capture screenshots, and reason about your patch through natural language.

What you can do

Things your agent can act on directly:

"Check errors inside *this comp"
"Why is this slow? List the top slow ops with cook times"
"Audit *this op and the surrounding chain — don't change anything yet"
"Refactor *this network: same result, fewer ops, no broken refs"
"Rebuild [.html / .pen] ui example into TD native panels, exactly and responsive to par.w/h"
"Find <name> in my twozero Cloud and place it into *this network"

The agent traverses your project, executes changes live in the editor, and returns structured results — all while you watch. It can also reach your Cloud — list repos and files, download a component and place it in the current network — without you leaving the chat.

Setup

Connect your agent in one click. The connection wizard opens right after installation, and any time from SettingsReconnect agents. It scans your machine for Claude Code, Cursor, Codex and Claude Desktop, and writes the twozero_td entry into the config of the ones you pick:

  1. CONNECT next to an agent — twozero merges the entry into that agent's own config file (~/.claude.json, ~/.cursor/mcp.json, ~/.codex/config.toml, Claude Desktop config). Nothing else in the file is touched. Already-connected agents show CONNECTED, and DISCONNECT removes the entry again.
  2. The wizard then verifies the connection live and shows a starter prompt you can copy.
  3. Reload the client afterwards — reload Cursor, run /mcp in Claude Code, restart codex, fully quit and reopen Claude Desktop.

What we recommend: Claude Code — either in the terminal, or the Code section inside Claude Desktop. Both talk to twozero directly, with nothing else to install.

The Chat section of Claude Desktop is a different route: it reaches local servers through npx mcp-remote, so it additionally needs Node.js installed, and the wizard says so instead of offering the button. We don't recommend going that way — use Code instead.

Auto-start on TD launchSettings → MCP → Auto start → Yes. The server boots on the next TD launch using the port from Settings → MCP → Port (default 40404).

Manual config, if you prefer to do it yourself — add one server named twozero_td pointing at http://localhost:40404/mcp, or just ask your agent:

Add twozero TD MCP for me with server key "twozero_td" and URL "http://localhost:40404/mcp". Configure it globally (user scope).

After that the agent picks up TD automatically from any project / workspace. Configure only one MCP URL — twozero handles additional TD instances internally; do not add separate client entries per instance.

Starting a chat

The twozero MCP server has to be running before you open the chat. It comes up together with TouchDesigner — Settings → MCP → Auto start is on by default — and the MCP status in the twozero window reads connected once the server is up and reachable.

Only then open the chat. An agent connects to twozero once, at the moment the chat starts, and does not retry — a chat that was already open when the server came up stays without the twozero tools for good, no matter how many times you reconnect from inside it. Server first, then a new chat.

Open every new agent chat with a priming prompt so the agent immediately uses MCP and confirms it can see your current TD context (project, network, selected ops):

Show me what you can see in my TD project.
check in TD: <your task here>
*here in TD: <your task here>
Check *this op in TD: <your task here>

Once the agent confirms context, drop the ritual and just talk normally.

Pointers — `*here` and `*this`

Two phrases that resolve to your current viewport / selection:

*here / *тут The network you are currently looking at in TD.
*this / *этот / *эту The single operator you have selected.
*these / *эти All operators you have currently selected (multi-select).

The asterisk is the magic: it never appears in normal code or text, so the agent treats these as unambiguous pointers and the response is rock-solid. Plain "here" / "this op" works too, but the asterisk version is bulletproof — use it when precision matters.

Handing the agent exact operators

Pointers cover "the thing I'm looking at right now". When you need to name specific operators instead — several at once, or ones sitting in another network — select them in the network editor and press Ctrl/Cmd+C. twozero puts their full paths on the clipboard, comma-separated; paste them into the chat and write the task around them:

/project1/base1/noise1, /project1/base1/blur1 — make these two audio-reactive

The copy includes the operator under the white outline, not only the highlighted ones, and it works even with the twozero window closed — the only requirement is that a network editor pane is in focus. On by default: SettingsCopy paths to clipboard.

Built-in triggers

Phrases the agent recognises as named flows:

study this project / изучи проект Cold-start project analysis. Best for unfamiliar or large patches when you want a tour, not a single-op poke.
twozero bug report / twozero баг репорт Built-in bug report flow. The word twozero is required so generic "report a bug" doesn't trigger it accidentally.

Working safely

Two workflow phrases that keep the agent from breaking your patch:

Plan first, then change: diagnose, propose, wait for my approval.
After fixes: re-run error and performance checks to verify.

Combine with the asterisk pointers — *this to scope the work, *here to keep the agent inside the network you're looking at.

Russian and TD slang

Mix English and Russian freely — the agent normalises TD terms across languages:

TouchDesigner TD · тач
project / patch проект · патч · .toe file
operator op · оператор · оп
parameter par · параметр · пар
*here in TD в таче *тут
*this op in TD в таче *этот оп
*these ops in TD в таче *эти опы
Show me what you can see in my TD project. Посмотри, что у меня в таче.

How it works

Agent → MCP request → twozero server (inside TD) → executes in your live project → result back to agent. Everything happens on your machine; nothing leaves except whatever your agent's LLM provider sees in the conversation.

When several TD instances are open at once, twozero auto-claims the next free port for each (40404, 40405, …) and the agent lists them and asks which one to act on — no manual configuration.

Troubleshooting

The agent doesn't see the twozero tools Usually timing. An agent connects to twozero once, when the chat starts, and does not retry — so a chat opened before TouchDesigner had finished loading stays without the tools for its whole life. With TD fully loaded, start a new chat and ask whether the twozero_td tools are there. Going back to the old chat will not help, and the setup screen showing the connection as done only means your config file is right, not that a live connection exists.
Still nothing in a brand-new chat In a terminal, run curl http://localhost:40404/ (use your own port if you changed it in Settings). JSON back — the server is running. *Connection refused* — it never started: confirm twozero is running in TD, that the port is free, and on macOS check the firewall. In Claude Code you can also do /mcptwozero_tdreinitialize.
Not sure the config is right SettingsReconnect agents — the wizard shows which agents are connected and can rewrite the entry for you.
Commands fail silently TD build must be 2025.33070 or higher — older builds lack the APIs MCP depends on.

Notes

  • twozero must be running in TouchDesigner for the MCP server to be reachable.
  • Keep Settings → MCP → Local only = Yes (recommended).
  • Use the strongest model your agent offers (e.g. Claude Opus) — smaller models hallucinate operator parameters more often.
  • Source & issues: github.com/404dotzero/twozero-td-mcp