@dpantani/tdmcp 0.4.0 → 0.6.1
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 +15 -10
- package/dist/cli/agent.d.ts +119 -1
- package/dist/cli/agent.js +14188 -1962
- package/dist/cli/agent.js.map +1 -1
- package/dist/index.js +30182 -14832
- package/dist/index.js.map +1 -1
- package/dist/recipes/animus_rings_visualizer.json +37 -0
- package/dist/recipes/body_tracking_reactive.json +127 -0
- package/dist/recipes/mediapipe_body_dots.json +86 -0
- package/dist/recipes/pose_skeleton_mediapipe.json +67 -0
- package/package.json +36 -6
- package/recipes/animus_rings_visualizer.json +37 -0
- package/recipes/body_tracking_reactive.json +127 -0
- package/recipes/mediapipe_body_dots.json +86 -0
- package/recipes/pose_skeleton_mediapipe.json +67 -0
- package/safeskill.manifest.json +37 -0
- package/scripts/fetch-shader-park-td.mjs +79 -0
- package/scripts/tdmcp-lops.mjs +52 -0
- package/td/README.md +1 -1
- package/td/bootstrap.py +41 -9
- package/td/modules/mcp/controllers/api_controller.py +87 -3
- package/td/modules/mcp/install.py +49 -1
- package/td/modules/mcp/services/api_service.py +82 -0
- package/td/modules/mcp/services/connect_service.py +213 -0
- package/td/modules/mcp/services/log_service.py +136 -0
- package/td/modules/mcp/services/param_text_service.py +218 -0
- package/td/modules/utils/version.py +1 -1
- package/td/tests/test_api_controller.py +0 -307
- package/td/tests/test_services.py +0 -209
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/Pantani/tdmcp/actions/workflows/ci.yml)
|
|
4
4
|
[](https://pantani.github.io/tdmcp/)
|
|
5
|
+
[](https://www.npmjs.com/package/@dpantani/tdmcp)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
[](https://modelcontextprotocol.io)
|
|
5
8
|
[](LICENSE)
|
|
9
|
+
[](https://glama.ai/mcp/servers/Pantani/tdmcp)
|
|
6
10
|
|
|
7
11
|
**tdmcp is a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server
|
|
8
12
|
for [TouchDesigner](https://derivative.ca)** — build TouchDesigner from plain
|
|
@@ -34,9 +38,10 @@ Full guides and reference live on the **docs site → <https://pantani.github.io
|
|
|
34
38
|
| [What is tdmcp?](https://pantani.github.io/tdmcp/guide/what-is-tdmcp) | [Architecture](https://pantani.github.io/tdmcp/reference/architecture) |
|
|
35
39
|
| [Install (no terminal)](https://pantani.github.io/tdmcp/guide/install) | [Tools reference](https://pantani.github.io/tdmcp/reference/tools) |
|
|
36
40
|
| [Your first visual](https://pantani.github.io/tdmcp/guide/first-visual) | [Environment variables](https://pantani.github.io/tdmcp/reference/environment) |
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
41
|
+
| [Shader Park](https://pantani.github.io/tdmcp/guide/shader-park) | [CLI & local copilot](https://pantani.github.io/tdmcp/reference/cli) |
|
|
42
|
+
| [Prompt cookbook](https://pantani.github.io/tdmcp/guide/prompt-cookbook) | [Bridge & REST API](https://pantani.github.io/tdmcp/reference/bridge-api) |
|
|
43
|
+
| [Recipe gallery](https://pantani.github.io/tdmcp/guide/recipes) | [Roadmap](docs/ROADMAP.md) |
|
|
44
|
+
| [Troubleshooting](https://pantani.github.io/tdmcp/guide/troubleshooting) | [Deployment](docs/DEPLOYMENT.md) |
|
|
40
45
|
|
|
41
46
|
🇧🇷 **Documentação em português:** <https://pantani.github.io/tdmcp/pt/>
|
|
42
47
|
|
|
@@ -66,7 +71,7 @@ Three pieces talk to each other on your computer:
|
|
|
66
71
|
|
|
67
72
|
Node.js is only needed for the build-from-source path (**[Node 20+](https://nodejs.org)**).
|
|
68
73
|
The one-click Claude Desktop extension needs nothing extra — the server is bundled
|
|
69
|
-
inside the `.dxt`.
|
|
74
|
+
inside the `.mcpb` (formerly `.dxt`; legacy `.dxt` files still install).
|
|
70
75
|
|
|
71
76
|
## Get started
|
|
72
77
|
|
|
@@ -77,16 +82,16 @@ You set up **two sides**: your **AI** (so it gets the tdmcp tools) and
|
|
|
77
82
|
**Cursor**? Paste this one message in:
|
|
78
83
|
|
|
79
84
|
```text
|
|
80
|
-
Install and connect tdmcp for me
|
|
81
|
-
https://
|
|
85
|
+
Install and connect tdmcp for me using the official install guide:
|
|
86
|
+
https://pantani.github.io/tdmcp/guide/install
|
|
82
87
|
Do every step yourself; only stop when you need me to paste one line into TouchDesigner.
|
|
83
88
|
```
|
|
84
89
|
|
|
85
90
|
It clones, builds and wires everything up; the only manual step is pasting one
|
|
86
91
|
line into TouchDesigner (Step 2 below).
|
|
87
92
|
|
|
88
|
-
**🟢 Claude Desktop — one-click `.
|
|
89
|
-
**[tdmcp.
|
|
93
|
+
**🟢 Claude Desktop — one-click `.mcpb` (no terminal, no Node).** Download
|
|
94
|
+
**[tdmcp.mcpb](https://github.com/Pantani/tdmcp/releases/latest/download/tdmcp.mcpb)**,
|
|
90
95
|
then in Claude Desktop open **Settings → Extensions** and install it (drag it in or
|
|
91
96
|
**Install from file**). Leave host/port at `127.0.0.1` / `9980`. Full walkthrough:
|
|
92
97
|
[the install guide](https://pantani.github.io/tdmcp/guide/install).
|
|
@@ -105,7 +110,7 @@ Open TouchDesigner, open the **Textport** (`Dialogs → Textport and DATs`), pas
|
|
|
105
110
|
this **one line** and press Enter:
|
|
106
111
|
|
|
107
112
|
```python
|
|
108
|
-
import urllib.request; exec(urllib.request.urlopen("https://
|
|
113
|
+
import urllib.request; exec(urllib.request.urlopen("https://github.com/Pantani/tdmcp/raw/main/td/bootstrap.py").read().decode())
|
|
109
114
|
```
|
|
110
115
|
|
|
111
116
|
You should see `[tdmcp] bridge running on port 9980 (/project1/tdmcp_bridge)`. ✅
|
|
@@ -131,7 +136,7 @@ the [prompt cookbook](https://pantani.github.io/tdmcp/guide/prompt-cookbook).
|
|
|
131
136
|
|
|
132
137
|
## What you can do
|
|
133
138
|
|
|
134
|
-
**
|
|
139
|
+
**179 tools** across three layers, plus library/packaging and Obsidian vault integrations — from
|
|
135
140
|
one-line artist generators (`create_feedback_network`, `create_audio_reactive`,
|
|
136
141
|
`create_particle_system`, `create_generative_art`, …) to building blocks
|
|
137
142
|
(`create_control_panel`, `animate_parameter`, `create_external_io` for
|
package/dist/cli/agent.d.ts
CHANGED
|
@@ -278,9 +278,9 @@ declare const RecipeSchema: z.ZodObject<{
|
|
|
278
278
|
node: z.ZodString;
|
|
279
279
|
name: z.ZodString;
|
|
280
280
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
281
|
+
color: "color";
|
|
281
282
|
float: "float";
|
|
282
283
|
vec: "vec";
|
|
283
|
-
color: "color";
|
|
284
284
|
}>>;
|
|
285
285
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
286
286
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -441,6 +441,26 @@ declare class TouchDesignerClient {
|
|
|
441
441
|
outputs?: string[] | undefined;
|
|
442
442
|
family?: string | undefined;
|
|
443
443
|
errors?: string[] | undefined;
|
|
444
|
+
flags?: {
|
|
445
|
+
bypass?: boolean | undefined;
|
|
446
|
+
render?: boolean | undefined;
|
|
447
|
+
display?: boolean | undefined;
|
|
448
|
+
lock?: boolean | undefined;
|
|
449
|
+
allowCooking?: boolean | undefined;
|
|
450
|
+
cloneImmune?: boolean | undefined;
|
|
451
|
+
is_clone?: boolean | undefined;
|
|
452
|
+
clone?: string | null | undefined;
|
|
453
|
+
} | undefined;
|
|
454
|
+
wires_in?: {
|
|
455
|
+
in_index: number | null;
|
|
456
|
+
from: string;
|
|
457
|
+
out_index: number;
|
|
458
|
+
}[] | undefined;
|
|
459
|
+
nodeX?: number | undefined;
|
|
460
|
+
nodeY?: number | undefined;
|
|
461
|
+
comment?: string | undefined;
|
|
462
|
+
color?: number[] | undefined;
|
|
463
|
+
tags?: string[] | undefined;
|
|
444
464
|
}>;
|
|
445
465
|
updateNodeParameters(path: string, parameters: Record<string, unknown>): Promise<{
|
|
446
466
|
path: string;
|
|
@@ -452,6 +472,26 @@ declare class TouchDesignerClient {
|
|
|
452
472
|
outputs?: string[] | undefined;
|
|
453
473
|
family?: string | undefined;
|
|
454
474
|
errors?: string[] | undefined;
|
|
475
|
+
flags?: {
|
|
476
|
+
bypass?: boolean | undefined;
|
|
477
|
+
render?: boolean | undefined;
|
|
478
|
+
display?: boolean | undefined;
|
|
479
|
+
lock?: boolean | undefined;
|
|
480
|
+
allowCooking?: boolean | undefined;
|
|
481
|
+
cloneImmune?: boolean | undefined;
|
|
482
|
+
is_clone?: boolean | undefined;
|
|
483
|
+
clone?: string | null | undefined;
|
|
484
|
+
} | undefined;
|
|
485
|
+
wires_in?: {
|
|
486
|
+
in_index: number | null;
|
|
487
|
+
from: string;
|
|
488
|
+
out_index: number;
|
|
489
|
+
}[] | undefined;
|
|
490
|
+
nodeX?: number | undefined;
|
|
491
|
+
nodeY?: number | undefined;
|
|
492
|
+
comment?: string | undefined;
|
|
493
|
+
color?: number[] | undefined;
|
|
494
|
+
tags?: string[] | undefined;
|
|
455
495
|
}>;
|
|
456
496
|
executePythonScript(script: string, returnOutput?: boolean): Promise<{
|
|
457
497
|
result?: unknown;
|
|
@@ -514,6 +554,71 @@ declare class TouchDesignerClient {
|
|
|
514
554
|
total_cook_time_ms?: number | undefined;
|
|
515
555
|
gpu_memory_mb?: number | undefined;
|
|
516
556
|
}>;
|
|
557
|
+
connectNodes(sourcePath: string, targetPath: string, sourceOutput?: number, targetInput?: number): Promise<{
|
|
558
|
+
source_path: string;
|
|
559
|
+
target_path: string;
|
|
560
|
+
source_output: number;
|
|
561
|
+
connected: boolean;
|
|
562
|
+
requested_input?: number | undefined;
|
|
563
|
+
actual_input?: number | undefined;
|
|
564
|
+
}>;
|
|
565
|
+
disconnectNodes(toPath: string, fromPath?: string, toInput?: number): Promise<{
|
|
566
|
+
to_path: string;
|
|
567
|
+
removed: {
|
|
568
|
+
input: number;
|
|
569
|
+
from: string;
|
|
570
|
+
}[];
|
|
571
|
+
warnings: string[];
|
|
572
|
+
from_path?: string | null | undefined;
|
|
573
|
+
to_input?: number | null | undefined;
|
|
574
|
+
}>;
|
|
575
|
+
readParameterModes(path: string, keys?: string[], nonDefaultOnly?: boolean): Promise<{
|
|
576
|
+
path: string;
|
|
577
|
+
type: string;
|
|
578
|
+
name: string;
|
|
579
|
+
parameters: {
|
|
580
|
+
name: string;
|
|
581
|
+
mode: string;
|
|
582
|
+
value?: unknown;
|
|
583
|
+
expr?: string | undefined;
|
|
584
|
+
bind_expr?: string | undefined;
|
|
585
|
+
export_op?: string | undefined;
|
|
586
|
+
}[];
|
|
587
|
+
warnings: string[];
|
|
588
|
+
}>;
|
|
589
|
+
setParameterMode(path: string, param: string, mode: string, expr?: string, value?: unknown): Promise<{
|
|
590
|
+
path: string;
|
|
591
|
+
param: string;
|
|
592
|
+
mode: string;
|
|
593
|
+
readback_mode: string;
|
|
594
|
+
readback_expr: string;
|
|
595
|
+
}>;
|
|
596
|
+
getDatText(path: string): Promise<{
|
|
597
|
+
path: string;
|
|
598
|
+
text: string;
|
|
599
|
+
is_table: boolean;
|
|
600
|
+
num_rows: number;
|
|
601
|
+
num_cols: number;
|
|
602
|
+
}>;
|
|
603
|
+
putDatText(path: string, text: string): Promise<{
|
|
604
|
+
path: string;
|
|
605
|
+
old_length: number;
|
|
606
|
+
new_length: number;
|
|
607
|
+
}>;
|
|
608
|
+
getLogs(severity?: string, maxLines?: number, scope?: string): Promise<{
|
|
609
|
+
lines: {
|
|
610
|
+
source: string;
|
|
611
|
+
message: string;
|
|
612
|
+
severity: string;
|
|
613
|
+
type: string;
|
|
614
|
+
absframe?: number | undefined;
|
|
615
|
+
frame?: number | undefined;
|
|
616
|
+
}[];
|
|
617
|
+
count: number;
|
|
618
|
+
available: boolean;
|
|
619
|
+
warnings: string[];
|
|
620
|
+
error_dat?: string | undefined;
|
|
621
|
+
}>;
|
|
517
622
|
}
|
|
518
623
|
|
|
519
624
|
/** Shared dependencies injected into every tool handler (keeps handlers testable). */
|
|
@@ -529,6 +634,11 @@ interface ToolContext {
|
|
|
529
634
|
* allowed (the default); only an explicit `false` locks them out.
|
|
530
635
|
*/
|
|
531
636
|
allowRawPython?: boolean;
|
|
637
|
+
/**
|
|
638
|
+
* Tool exposure profile. `"safe"` hides destructive/raw-code tools.
|
|
639
|
+
* Undefined means `"full"` (the default).
|
|
640
|
+
*/
|
|
641
|
+
toolProfile?: "full" | "safe";
|
|
532
642
|
}
|
|
533
643
|
|
|
534
644
|
declare const ConfigSchema: z.ZodObject<{
|
|
@@ -555,6 +665,10 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
555
665
|
on: "on";
|
|
556
666
|
off: "off";
|
|
557
667
|
}>>;
|
|
668
|
+
toolProfile: z.ZodDefault<z.ZodEnum<{
|
|
669
|
+
full: "full";
|
|
670
|
+
safe: "safe";
|
|
671
|
+
}>>;
|
|
558
672
|
bridgeToken: z.ZodOptional<z.ZodString>;
|
|
559
673
|
llmBaseUrl: z.ZodDefault<z.ZodString>;
|
|
560
674
|
llmModel: z.ZodDefault<z.ZodString>;
|
|
@@ -577,6 +691,10 @@ declare function runCli(argv: string[], opts?: RunCliOptions): Promise<CliResult
|
|
|
577
691
|
interface RunWatchOptions {
|
|
578
692
|
config?: TdmcpConfig;
|
|
579
693
|
includeHighFrequency?: boolean;
|
|
694
|
+
/** Only emit events whose `type` is in this list (e.g. ["beat","onset"]). */
|
|
695
|
+
filter?: string[];
|
|
696
|
+
/** Drop events whose `type` is in this list (e.g. ["timeline.frame"]). */
|
|
697
|
+
exclude?: string[];
|
|
580
698
|
/** Where each event line goes; defaults to stdout. Overridable for tests. */
|
|
581
699
|
write?: (line: string) => void;
|
|
582
700
|
/** Inject a stream factory for tests; defaults to a real `TdEventStream`. */
|