@dpantani/tdmcp 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -346
- package/dist/cli/agent.d.ts +139 -3
- package/dist/cli/agent.js +10236 -405
- package/dist/cli/agent.js.map +1 -1
- package/dist/index.js +13845 -2954
- package/dist/index.js.map +1 -1
- package/dist/knowledge/data/meta.json +1 -1
- package/dist/recipes/feedback_tunnel.json +4 -4
- package/dist/recipes/noise_landscape.json +102 -1
- package/dist/recipes/performable_feedback_tunnel.json +92 -0
- package/dist/recipes/webcam_glitch.json +5 -1
- package/package.json +21 -3
- package/recipes/feedback_tunnel.json +4 -4
- package/recipes/noise_landscape.json +102 -1
- package/recipes/performable_feedback_tunnel.json +92 -0
- package/recipes/webcam_glitch.json +5 -1
- package/td/README.md +1 -1
- package/td/modules/mcp/controllers/api_controller.py +70 -7
- package/td/modules/mcp/services/analysis_service.py +7 -2
- package/td/modules/mcp/services/api_service.py +25 -3
- package/td/modules/mcp/services/batch_service.py +36 -2
- package/td/modules/mcp/services/preview_service.py +89 -11
- package/td/modules/utils/version.py +1 -1
- package/td/tests/test_api_controller.py +67 -2
- package/td/tests/test_services.py +209 -0
package/README.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
# tdmcp —
|
|
1
|
+
# tdmcp — TouchDesigner MCP server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[
|
|
5
|
-
(
|
|
6
|
-
|
|
3
|
+
[](https://github.com/Pantani/tdmcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pantani.github.io/tdmcp/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
**tdmcp is a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server
|
|
8
|
+
for [TouchDesigner](https://derivative.ca)** — build TouchDesigner from plain
|
|
9
|
+
language. You describe a visual to an AI assistant (Claude, Claude Code, Cursor,
|
|
10
|
+
Codex); the AI builds the actual network of nodes inside your project, checks it
|
|
11
|
+
for errors, and shows you a preview.
|
|
7
12
|
|
|
8
13
|
> *"Create a feedback tunnel from noise with blur and displace, then add bloom and
|
|
9
14
|
> output it to a window."*
|
|
@@ -13,13 +18,27 @@ nodes inside your project, checks it for errors, and shows you a preview.
|
|
|
13
18
|
It works because it pairs two things every other tool was missing:
|
|
14
19
|
|
|
15
20
|
- **Real knowledge** — an embedded reference of 629 operators, 68 Python classes,
|
|
16
|
-
|
|
21
|
+
workflow patterns, GLSL techniques and tutorials, so the AI uses real
|
|
17
22
|
TouchDesigner operators instead of guessing.
|
|
18
23
|
- **Real execution** — a small **bridge** running inside TouchDesigner that
|
|
19
24
|
actually creates, connects, inspects and previews nodes — with a
|
|
20
|
-
create → verify → preview loop so the AI can see and fix its own work.
|
|
25
|
+
create → verify → preview loop so the AI can see and fix its own work. Every
|
|
26
|
+
generated network is auto-arranged into a readable left→right layout.
|
|
27
|
+
|
|
28
|
+
## 📖 Documentation
|
|
29
|
+
|
|
30
|
+
Full guides and reference live on the **docs site → <https://pantani.github.io/tdmcp/>**
|
|
31
|
+
|
|
32
|
+
| For artists / musicians | For developers |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| [What is tdmcp?](https://pantani.github.io/tdmcp/guide/what-is-tdmcp) | [Architecture](https://pantani.github.io/tdmcp/reference/architecture) |
|
|
35
|
+
| [Install (no terminal)](https://pantani.github.io/tdmcp/guide/install) | [Tools reference](https://pantani.github.io/tdmcp/reference/tools) |
|
|
36
|
+
| [Your first visual](https://pantani.github.io/tdmcp/guide/first-visual) | [Environment variables](https://pantani.github.io/tdmcp/reference/environment) |
|
|
37
|
+
| [Prompt cookbook](https://pantani.github.io/tdmcp/guide/prompt-cookbook) | [CLI & local copilot](https://pantani.github.io/tdmcp/reference/cli) |
|
|
38
|
+
| [Recipe gallery](https://pantani.github.io/tdmcp/guide/recipes) | [Bridge & REST API](https://pantani.github.io/tdmcp/reference/bridge-api) |
|
|
39
|
+
| [Troubleshooting](https://pantani.github.io/tdmcp/guide/troubleshooting) | [Roadmap](docs/ROADMAP.md) · [Deployment](docs/DEPLOYMENT.md) |
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
🇧🇷 **Documentação em português:** <https://pantani.github.io/tdmcp/pt/>
|
|
23
42
|
|
|
24
43
|
## How it works
|
|
25
44
|
|
|
@@ -38,375 +57,106 @@ Three pieces talk to each other on your computer:
|
|
|
38
57
|
3. **The bridge** — a tiny piece that runs *inside* TouchDesigner so the server
|
|
39
58
|
can actually drive it. You switch it on once per machine.
|
|
40
59
|
|
|
41
|
-
You set all three up below. It takes about 5 minutes.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
60
|
## What you'll need
|
|
46
61
|
|
|
47
|
-
- **[TouchDesigner](https://derivative.ca/download)**
|
|
48
|
-
edition is fine
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
number ≥ 20 you're set; otherwise install it from the link.
|
|
52
|
-
- An MCP-capable AI client: **Claude Code**, **Claude Desktop**, or **Cursor**.
|
|
62
|
+
- **[TouchDesigner](https://derivative.ca/download)** — the free non-commercial
|
|
63
|
+
edition is fine.
|
|
64
|
+
- An MCP-capable AI assistant: **Claude Desktop** (easiest), **Claude Code**,
|
|
65
|
+
**Codex**, or **Cursor**.
|
|
53
66
|
|
|
54
|
-
|
|
67
|
+
Node.js is only needed for the build-from-source path (**[Node 20+](https://nodejs.org)**).
|
|
68
|
+
The one-click Claude Desktop extension needs nothing extra — the server is bundled
|
|
69
|
+
inside the `.dxt`.
|
|
55
70
|
|
|
56
71
|
## Get started
|
|
57
72
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
your AI client — **every path also needs the bridge in Step 2.** Budget ~5 min.
|
|
61
|
-
|
|
62
|
-
> **Which path?** Claude Desktop → the one-click extension just below. Claude
|
|
63
|
-
> Code or Cursor → Steps 1–3.
|
|
64
|
-
|
|
65
|
-
> 🤖 **Or let an AI do it for you.** Hand
|
|
66
|
-
> [`tdmcp-install-prompt.md`](tdmcp-install-prompt.md) to Claude Code, Codex, or
|
|
67
|
-
> Cursor and it runs the install and client wiring itself — you only paste one
|
|
68
|
-
> line into TouchDesigner at the end. The manual steps below are the alternative
|
|
69
|
-
> if you'd rather drive it yourself.
|
|
70
|
-
|
|
71
|
-
### Claude Desktop: the one-click extension (`.dxt`) — easiest
|
|
73
|
+
You set up **two sides**: your **AI** (so it gets the tdmcp tools) and
|
|
74
|
+
**TouchDesigner** (so the AI can drive it).
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
a settings form — no JSON, no `claude mcp add`, nothing to keep running yourself.
|
|
76
|
+
**🤖 Easiest — let your AI install it.** Using **Claude Code**, **Codex**, or
|
|
77
|
+
**Cursor**? Paste this one message in:
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<details>
|
|
82
|
-
<summary>Or build it yourself (needs <a href="https://nodejs.org">Node 20+</a>)</summary>
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
git clone https://github.com/Pantani/tdmcp.git
|
|
86
|
-
cd tdmcp
|
|
87
|
-
npm install
|
|
88
|
-
npm run build:dxt # writes tdmcp.dxt into this folder
|
|
79
|
+
```text
|
|
80
|
+
Install and connect tdmcp for me by reading and following
|
|
81
|
+
https://raw.githubusercontent.com/Pantani/tdmcp/main/tdmcp-install-prompt.md
|
|
82
|
+
Do every step yourself; only stop when you need me to paste one line into TouchDesigner.
|
|
89
83
|
```
|
|
90
84
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
**2. Install it in Claude Desktop.** Open **Settings → Extensions**, choose
|
|
94
|
-
**Install from file** (or drag `tdmcp.dxt` onto the window). When asked, set the
|
|
95
|
-
TouchDesigner **host** / **port** if they differ from `127.0.0.1` / `9980`, then
|
|
96
|
-
**enable** the extension.
|
|
97
|
-
|
|
98
|
-
**3. Turn on the bridge** inside TouchDesigner — do **Step 2** below. The
|
|
99
|
-
extension *drives* TouchDesigner; the bridge is what lets it in.
|
|
100
|
-
|
|
101
|
-
That's the whole Claude Desktop setup — skip to **Step 4** and start creating.
|
|
102
|
-
More detail (and the Docker/HTTP options) live in
|
|
103
|
-
[`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md).
|
|
85
|
+
It clones, builds and wires everything up; the only manual step is pasting one
|
|
86
|
+
line into TouchDesigner (Step 2 below).
|
|
104
87
|
|
|
105
|
-
|
|
88
|
+
**🟢 Claude Desktop — one-click `.dxt` (no terminal, no Node).** Download
|
|
89
|
+
**[tdmcp.dxt](https://github.com/Pantani/tdmcp/releases/latest/download/tdmcp.dxt)**,
|
|
90
|
+
then in Claude Desktop open **Settings → Extensions** and install it (drag it in or
|
|
91
|
+
**Install from file**). Leave host/port at `127.0.0.1` / `9980`. Full walkthrough:
|
|
92
|
+
[the install guide](https://pantani.github.io/tdmcp/guide/install).
|
|
106
93
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
Open a terminal and run these four lines. You only ever do this once.
|
|
94
|
+
**🛠️ Claude Code / Codex / Cursor — build from source.**
|
|
110
95
|
|
|
111
96
|
```bash
|
|
112
97
|
git clone https://github.com/Pantani/tdmcp.git
|
|
113
98
|
cd tdmcp
|
|
114
|
-
npm
|
|
115
|
-
npm run build
|
|
99
|
+
npm run setup # installs, builds, and prints the exact line to connect your client
|
|
116
100
|
```
|
|
117
101
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
> ⚡ **Shortcut:** instead of `npm install && npm run build`, run **`npm run
|
|
121
|
-
> setup`** (or `./setup.sh`). It installs, builds, and then prints the exact line
|
|
122
|
-
> to connect your AI — with your real paths already filled in.
|
|
123
|
-
|
|
124
|
-
> 💡 **Tip — you'll need this folder's full path twice below.** While you're
|
|
125
|
-
> still in the `tdmcp` folder, run `pwd`. Copy what it prints (e.g.
|
|
126
|
-
> `/Users/you/tdmcp`) — that's your **project path**. Wherever the steps below
|
|
127
|
-
> say `<project-path>`, paste it in.
|
|
128
|
-
|
|
129
|
-
### Step 2 — Switch on the bridge inside TouchDesigner
|
|
130
|
-
|
|
131
|
-
This lets the server actually control TouchDesigner. The easy, set-and-forget way:
|
|
132
|
-
|
|
133
|
-
1. **Open TouchDesigner.**
|
|
134
|
-
2. Open **Preferences** (`Edit → Preferences`, or the **TouchDesigner** menu on
|
|
135
|
-
macOS). In the **General** section, find **"Python 64-bit Module Path"** and
|
|
136
|
-
paste:
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
<project-path>/td/modules
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
(That's the `tdmcp` folder you cloned — e.g. `/Users/you/tdmcp/td/modules`; run
|
|
143
|
-
`pwd` inside it if you're unsure of the full path.) Click OK.
|
|
144
|
-
3. Open the **Textport** (`Dialogs → Textport and DATs`), type this one line and
|
|
145
|
-
press Enter:
|
|
146
|
-
|
|
147
|
-
```python
|
|
148
|
-
from mcp import install; install.run()
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
You should see:
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
[tdmcp] bridge running on port 9980 (/project1/tdmcp_bridge)
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Done — a `tdmcp_bridge` node now lives in your network and is listening. ✅
|
|
158
|
-
|
|
159
|
-
> This is **safe and reversible**: it only adds one tidy `tdmcp_bridge` component.
|
|
160
|
-
> Re-running the line just reconfigures it. To remove it later, run
|
|
161
|
-
> `from mcp import install; install.uninstall()`.
|
|
162
|
-
>
|
|
163
|
-
> Want it to start automatically in *every* project? Save the project (with that
|
|
164
|
-
> Module Path preference) as your **Default Project**, or see
|
|
165
|
-
> [`td/README.md`](td/README.md) for the Execute-DAT auto-start and the fully
|
|
166
|
-
> manual Web Server DAT setup.
|
|
167
|
-
|
|
168
|
-
**Two even-easier ways to do Step 2:**
|
|
169
|
-
|
|
170
|
-
- **No clone, no Preferences** — paste this single line into the Textport. It
|
|
171
|
-
fetches the bridge and starts it for you:
|
|
172
|
-
|
|
173
|
-
```python
|
|
174
|
-
import urllib.request; exec(urllib.request.urlopen("https://raw.githubusercontent.com/Pantani/tdmcp/main/td/bootstrap.py").read().decode())
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
- **From the terminal** — if you installed the server with `npx` (so there's no
|
|
178
|
-
local `td/modules`), run `npx @dpantani/tdmcp install-bridge` (or
|
|
179
|
-
`node <project-path>/dist/index.js install-bridge` from a clone). It copies the
|
|
180
|
-
bridge to `~/tdmcp-bridge` and prints the exact line to paste in the Textport.
|
|
102
|
+
### Turn on the bridge inside TouchDesigner (everyone)
|
|
181
103
|
|
|
182
|
-
|
|
104
|
+
Open TouchDesigner, open the **Textport** (`Dialogs → Textport and DATs`), paste
|
|
105
|
+
this **one line** and press Enter:
|
|
183
106
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
**Claude Code**
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
claude mcp add tdmcp -- node <project-path>/dist/index.js
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
> Once tdmcp is published to npm this becomes path-free:
|
|
193
|
-
> `claude mcp add tdmcp -- npx -y @dpantani/tdmcp`.
|
|
194
|
-
|
|
195
|
-
**Claude Desktop** — the easiest route is the **one-click `.dxt` extension**
|
|
196
|
-
described at the top of *Get started* (no config file needed). To wire it up
|
|
197
|
-
manually instead, edit `claude_desktop_config.json`
|
|
198
|
-
(`Settings → Developer → Edit Config`) and add:
|
|
199
|
-
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"mcpServers": {
|
|
203
|
-
"tdmcp": {
|
|
204
|
-
"command": "node",
|
|
205
|
-
"args": ["<project-path>/dist/index.js"]
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
107
|
+
```python
|
|
108
|
+
import urllib.request; exec(urllib.request.urlopen("https://raw.githubusercontent.com/Pantani/tdmcp/main/td/bootstrap.py").read().decode())
|
|
209
109
|
```
|
|
210
110
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
"tdmcp": {
|
|
217
|
-
"command": "node",
|
|
218
|
-
"args": ["<project-path>/dist/index.js"]
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
Restart your AI client so it picks up the new server.
|
|
111
|
+
You should see `[tdmcp] bridge running on port 9980 (/project1/tdmcp_bridge)`. ✅
|
|
112
|
+
It's safe and reversible — it adds one tidy component; remove it later with
|
|
113
|
+
`from mcp import install; install.uninstall()`. Other install methods (module
|
|
114
|
+
path, terminal, reusable `.tox`) are in the
|
|
115
|
+
[bridge docs](https://pantani.github.io/tdmcp/reference/bridge-api).
|
|
225
116
|
|
|
226
|
-
###
|
|
117
|
+
### Make something
|
|
227
118
|
|
|
228
|
-
With TouchDesigner open and your AI
|
|
119
|
+
With TouchDesigner open and your AI connected, ask in plain language:
|
|
229
120
|
|
|
230
121
|
> *"Create an audio-reactive particle galaxy and show me a preview."*
|
|
231
122
|
|
|
232
|
-
The AI builds the network
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
---
|
|
123
|
+
The AI builds the network, checks it for errors, and returns a thumbnail. Iterate:
|
|
124
|
+
*"make it warmer," "add a feedback trail," "output it fullscreen."* More ideas in
|
|
125
|
+
the [prompt cookbook](https://pantani.github.io/tdmcp/guide/prompt-cookbook).
|
|
237
126
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
| The AI says **"TouchDesigner isn't reachable."** | Make sure TD is open and the bridge is on (Step 2). Test it: `curl http://127.0.0.1:9980/api/info` should return JSON. |
|
|
243
|
-
| `from mcp import install` → **`No module named 'mcp'`** | The Module Path isn't set. Re-check Step 2.2 — it must point at `<project-path>/td/modules`, then restart TouchDesigner. |
|
|
244
|
-
| **`command not found: node` / `npm`** | Node isn't installed (or is too old). Install Node ≥ 20 from [nodejs.org](https://nodejs.org) and reopen the terminal. |
|
|
245
|
-
| **Your AI client doesn't list any tdmcp tools** | Restart the client after adding the server, and double-check the path to `dist/index.js` is the full absolute path. |
|
|
246
|
-
| **Port 9980 is already taken** | Set a different port in *both* places: the bridge (`install.run(port=9981)`) and the client (`TDMCP_TD_PORT=9981`). |
|
|
247
|
-
|
|
248
|
-
The server runs fine even when TouchDesigner is closed — TD-dependent tools just
|
|
249
|
-
return a friendly "not reachable" message instead of crashing.
|
|
250
|
-
|
|
251
|
-
---
|
|
127
|
+
> **Not connecting?** The two most common fixes: make sure the bridge is on
|
|
128
|
+
> (`curl http://127.0.0.1:9980/api/info` returns JSON), and **restart your AI
|
|
129
|
+
> client** after adding the server. Full
|
|
130
|
+
> [troubleshooting](https://pantani.github.io/tdmcp/guide/troubleshooting).
|
|
252
131
|
|
|
253
132
|
## What you can do
|
|
254
133
|
|
|
255
|
-
**
|
|
256
|
-
|
|
257
|
-
`
|
|
258
|
-
`
|
|
259
|
-
|
|
260
|
-
**
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
**
|
|
268
|
-
`
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
`
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
**Prompt modes**: `visual_artist_mode`, `debug_network`, `optimize_performance`,
|
|
283
|
-
`explain_network`, `remix_visual`.
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
## Architecture (for developers)
|
|
288
|
-
|
|
289
|
-
```
|
|
290
|
-
MCP client ──stdio──▶ tdmcp server (Node/TS) ──HTTP──▶ TouchDesigner bridge (Python)
|
|
291
|
-
├── Layer 1 artist tools (create_visual_system, …)
|
|
292
|
-
├── Layer 2 building blocks (create_node_chain, …)
|
|
293
|
-
├── Layer 3 atomic ops (create_td_node, …)
|
|
294
|
-
├── Knowledge base (MCP resources)
|
|
295
|
-
├── Recipes (validated network templates)
|
|
296
|
-
└── Feedback engine (errors / preview / performance)
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Environment variables
|
|
300
|
-
|
|
301
|
-
| Variable | Default | Description |
|
|
302
|
-
| --- | --- | --- |
|
|
303
|
-
| `TDMCP_TD_HOST` | `127.0.0.1` | TouchDesigner bridge host |
|
|
304
|
-
| `TDMCP_TD_PORT` | `9980` | Web Server DAT port |
|
|
305
|
-
| `TDMCP_TRANSPORT` | `stdio` | MCP transport: `stdio` (default) or `http` (Streamable HTTP) |
|
|
306
|
-
| `TDMCP_HTTP_PORT` | `3939` | Port for the HTTP transport (when `TDMCP_TRANSPORT=http`) |
|
|
307
|
-
| `TDMCP_EVENTS` | `on` | Subscribe to TD WebSocket events and forward them as MCP logging notifications (`on`/`off`) |
|
|
308
|
-
| `TDMCP_RAW_PYTHON` | `on` | Whether to expose the raw-Python escape-hatch tools (`execute_python_script`, `exec_node_method`). Set to `off` to lock them out for restricted setups |
|
|
309
|
-
| `TDMCP_BRIDGE_TOKEN` | _(unset)_ | Optional shared bearer token. When set, the server sends it and the bridge requires it — set the **same** value in TouchDesigner's environment to turn auth on |
|
|
310
|
-
| `TDMCP_BRIDGE_ALLOW_EXEC` | `1` | **Set in TouchDesigner's environment.** Set to `0`/`false`/`off` to make the bridge refuse the arbitrary-code endpoints (`/api/exec`, node `method`) — enforced bridge-side, even for direct network callers |
|
|
311
|
-
| `TDMCP_LOG_LEVEL` | `info` | `debug` / `info` / `warn` / `error` / `silent` (stderr) |
|
|
312
|
-
| `TDMCP_REQUEST_TIMEOUT_MS` | `10000` | Per-request timeout to the bridge |
|
|
313
|
-
|
|
314
|
-
The HTTP transport (`TDMCP_TRANSPORT=http`) serves MCP at `POST/GET/DELETE /mcp`
|
|
315
|
-
on `127.0.0.1:$TDMCP_HTTP_PORT` with stateful sessions — handy for remote/headless
|
|
316
|
-
setups. See [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md) for Docker and the Claude
|
|
317
|
-
Desktop `.dxt` extension.
|
|
318
|
-
|
|
319
|
-
### Security
|
|
320
|
-
|
|
321
|
-
The TouchDesigner bridge runs **arbitrary Python inside your TD process** (that is
|
|
322
|
-
what lets the assistant build networks for you). Treat it like an open door to the
|
|
323
|
-
machine TD runs on:
|
|
324
|
-
|
|
325
|
-
- **The Web Server DAT listens on its port (default `9980`) on all network
|
|
326
|
-
interfaces.** Anyone who can reach `http://<your-ip>:9980` can run code on that
|
|
327
|
-
machine. Only run it on a trusted network, and/or firewall the port to localhost.
|
|
328
|
-
- **Turn on bridge auth for untrusted networks:** set `TDMCP_BRIDGE_TOKEN` to a
|
|
329
|
-
shared secret in **both** the MCP server's environment and TouchDesigner's
|
|
330
|
-
environment. The bridge then rejects any request without a matching
|
|
331
|
-
`Authorization: Bearer <token>` (HTTP `401`). Unset (default) keeps the
|
|
332
|
-
zero-config local flow.
|
|
333
|
-
- `TDMCP_RAW_PYTHON=off` hides the raw-Python MCP tools, but it only gates the
|
|
334
|
-
**MCP-server side** — a direct network caller could still hit the bridge's
|
|
335
|
-
`/api/exec` and node-`method` endpoints. To close them at the bridge itself, set
|
|
336
|
-
`TDMCP_BRIDGE_ALLOW_EXEC=0` in TouchDesigner's environment (defense in depth that
|
|
337
|
-
holds even without a token); the structured endpoints keep working.
|
|
338
|
-
- The MCP server itself binds to loopback (`127.0.0.1`) for both stdio and HTTP
|
|
339
|
-
transports and enables DNS-rebinding protection on HTTP.
|
|
340
|
-
|
|
341
|
-
### Command-line agent (`tdmcp-agent`)
|
|
342
|
-
|
|
343
|
-
The package also installs a second binary, `tdmcp-agent`, that drives the same
|
|
344
|
-
tools from a shell with machine-readable output — useful for scripts and CI:
|
|
345
|
-
|
|
346
|
-
```bash
|
|
347
|
-
tdmcp-agent --help # list commands
|
|
348
|
-
tdmcp-agent info # health check + TD/bridge info
|
|
349
|
-
tdmcp-agent nodes find --params '{"parent_path":"/project1","type":"TOP"}'
|
|
350
|
-
tdmcp-agent nodes create --dry-run --params '{"parent_path":"/project1","type":"noiseTOP"}'
|
|
351
|
-
tdmcp-agent schema "nodes create" # print a command's JSON Schema
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
Output format is `--output json` (default) / `ndjson` / `text`. Mutating commands
|
|
355
|
-
are tagged `mutates`; the Python escape hatches require `--allow-unsafe` and honour
|
|
356
|
-
`TDMCP_RAW_PYTHON=off`.
|
|
357
|
-
|
|
358
|
-
### Scripts
|
|
359
|
-
|
|
360
|
-
| Script | Purpose |
|
|
361
|
-
| --- | --- |
|
|
362
|
-
| `npm run setup` | guided install + build, then prints how to connect your client |
|
|
363
|
-
| `npm run dev` | run the server from source (stdio) |
|
|
364
|
-
| `npm run build` | typecheck + bundle + copy assets to `dist/` |
|
|
365
|
-
| `npm test` | unit + integration tests (Vitest + MSW) |
|
|
366
|
-
| `npm run typecheck` / `npm run lint` | TypeScript / Biome |
|
|
367
|
-
| `npm run smoke:live` | end-to-end test against a running TD |
|
|
368
|
-
| `npm run validate:recipes` | validate every recipe JSON |
|
|
369
|
-
| `npm run import:bottobot` | (re)build the embedded knowledge base — only needed to refresh it |
|
|
370
|
-
| `npm run build:dxt` | package a Claude Desktop `.dxt` extension (see `docs/DEPLOYMENT.md`) |
|
|
371
|
-
|
|
372
|
-
> The knowledge base ships in the repo, so a fresh clone needs only
|
|
373
|
-
> `npm install && npm run build`. `import:bottobot` is a maintenance command for
|
|
374
|
-
> regenerating it from `@bottobot/td-mcp`.
|
|
375
|
-
|
|
376
|
-
### Verify end-to-end
|
|
377
|
-
|
|
378
|
-
With TD open and the bridge running:
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
npm run smoke:live # creates a Noise→Null chain in /project1 and grabs a preview
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
---
|
|
385
|
-
|
|
386
|
-
## Current state
|
|
387
|
-
|
|
388
|
-
- ✅ 35 tools across 3 layers, 6 resource families, 5 prompts, 10 recipes, a
|
|
389
|
-
feedback engine, and the TouchDesigner Python bridge.
|
|
390
|
-
- ✅ Two transports: **stdio** (default) and **Streamable HTTP**; plus an optional
|
|
391
|
-
**WebSocket event stream** (TD → MCP logging notifications).
|
|
392
|
-
- ✅ `typecheck`, `build`, `lint`, and `test` all pass; the server boots over
|
|
393
|
-
stdio with clean stdout.
|
|
394
|
-
- 🔌 Verified end-to-end against a live TouchDesigner (CRUD, preview, batch, and
|
|
395
|
-
`node.created`/`node.deleted` events).
|
|
396
|
-
|
|
397
|
-
## Known limitations
|
|
398
|
-
|
|
399
|
-
- **WebSocket events** (`node.created` / `node.deleted` / `node.error` /
|
|
400
|
-
`project.saved` / `timeline.frame` / `node.cook`) are forwarded as MCP logging
|
|
401
|
-
notifications on both transports. High-frequency events (`timeline.frame`,
|
|
402
|
-
`node.cook`) are dropped by the consumer unless explicitly opted in.
|
|
403
|
-
- **Audio / particle / 3D builders and the exotic recipes** (kinect, LED,
|
|
404
|
-
projection) produce valid, connected networks but use best-effort TD parameter
|
|
405
|
-
names — fine-tuning may be needed, and they emit warnings to that effect.
|
|
406
|
-
- **Preview** returns the TOP at its native resolution (the requested size is
|
|
407
|
-
advisory).
|
|
408
|
-
- The bridge ships as Python modules plus a callbacks template (a binary `.tox`
|
|
409
|
-
can't be generated from source); the one-liner in Step 2 assembles it for you.
|
|
134
|
+
**102+ tools** across three layers, plus an Obsidian vault integration — from
|
|
135
|
+
one-line artist generators (`create_feedback_network`, `create_audio_reactive`,
|
|
136
|
+
`create_particle_system`, `create_generative_art`, …) to building blocks
|
|
137
|
+
(`create_control_panel`, `animate_parameter`, `create_external_io` for
|
|
138
|
+
OSC/MIDI/DMX/NDI, …) down to atomic node CRUD and inspection. Many systems arrive
|
|
139
|
+
**already playable**, with a control panel you can tweak, preset, or map to a
|
|
140
|
+
controller. See the full, always-current
|
|
141
|
+
[tools reference](https://pantani.github.io/tdmcp/reference/tools) and the
|
|
142
|
+
[recipe gallery](https://pantani.github.io/tdmcp/guide/recipes).
|
|
143
|
+
|
|
144
|
+
## Security
|
|
145
|
+
|
|
146
|
+
The bridge runs **arbitrary Python inside your TD process** and listens on port
|
|
147
|
+
`9980` on all interfaces — treat it like an open door to that machine. Run it only
|
|
148
|
+
on a trusted network, and for untrusted networks turn on bridge auth
|
|
149
|
+
(`TDMCP_BRIDGE_TOKEN`) and/or disable the exec endpoints
|
|
150
|
+
(`TDMCP_BRIDGE_ALLOW_EXEC=0`). Details:
|
|
151
|
+
[Security](https://pantani.github.io/tdmcp/reference/architecture#security).
|
|
152
|
+
|
|
153
|
+
## Contributing & development
|
|
154
|
+
|
|
155
|
+
Build with `npm install && npm run build`; run `npm test`, `npm run typecheck`,
|
|
156
|
+
`npm run lint`. Work on the docs with `npm run docs:dev` (the
|
|
157
|
+
[tools reference](https://pantani.github.io/tdmcp/reference/tools) is generated by
|
|
158
|
+
`scripts/gen-tool-docs.ts`). See [CONTRIBUTING.md](CONTRIBUTING.md),
|
|
159
|
+
[CHANGELOG.md](CHANGELOG.md), and the [roadmap](docs/ROADMAP.md).
|
|
410
160
|
|
|
411
161
|
## License
|
|
412
162
|
|