touchdesigner-mcp-server 1.1.0 → 1.1.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.ja.md +26 -75
- package/README.md +25 -74
- package/dist/core/constants.js +0 -1
- package/dist/features/tools/handlers/tdTools.js +50 -162
- package/dist/features/tools/types.js +1 -26
- package/dist/gen/endpoints/TouchDesignerAPI.js +1 -1
- package/dist/gen/mcp/touchDesignerAPI.zod.js +1 -1
- package/dist/server/touchDesignerServer.js +1 -1
- package/package.json +3 -4
- package/dist/features/tools/metadata/touchDesignerToolMetadata.js +0 -402
- package/dist/features/tools/presenter/classListFormatter.js +0 -187
- package/dist/features/tools/presenter/index.js +0 -11
- package/dist/features/tools/presenter/markdownRenderer.js +0 -25
- package/dist/features/tools/presenter/nodeDetailsFormatter.js +0 -140
- package/dist/features/tools/presenter/nodeListFormatter.js +0 -124
- package/dist/features/tools/presenter/operationFormatter.js +0 -117
- package/dist/features/tools/presenter/presenter.js +0 -62
- package/dist/features/tools/presenter/responseFormatter.js +0 -66
- package/dist/features/tools/presenter/scriptResultFormatter.js +0 -171
- package/dist/features/tools/presenter/templates/markdown/classDetailsSummary.md +0 -13
- package/dist/features/tools/presenter/templates/markdown/classListSummary.md +0 -7
- package/dist/features/tools/presenter/templates/markdown/default.md +0 -3
- package/dist/features/tools/presenter/templates/markdown/detailedPayload.md +0 -5
- package/dist/features/tools/presenter/templates/markdown/nodeDetailsSummary.md +0 -10
- package/dist/features/tools/presenter/templates/markdown/nodeListSummary.md +0 -8
- package/dist/features/tools/presenter/templates/markdown/scriptSummary.md +0 -15
- package/dist/features/tools/presenter/toolMetadataFormatter.js +0 -118
package/README.ja.md
CHANGED
|
@@ -9,75 +9,35 @@ TouchDesignerのためのMCP(Model Context Protocol) サーバー実装です。
|
|
|
9
9
|
[](https://youtu.be/V2znaqGU7f4?si=6HDFbcBHCFPdttkM&t=635)
|
|
10
10
|
|
|
11
11
|
TouchDesigner MCPは、AIモデルとTouchDesigner WebServer DAT 間のブリッジとして機能し、AIエージェントが以下のことが可能になります
|
|
12
|
-
|
|
13
12
|
- ノードの作成、変更、削除
|
|
14
13
|
- ノードプロパティやプロジェクト構造の照会
|
|
15
14
|
- PythonスクリプトによるTouchDesignerのプログラム的制御
|
|
16
15
|
|
|
17
|
-
## アーキテクチャ
|
|
18
|
-
|
|
19
|
-
```mermaid
|
|
20
|
-
flowchart LR
|
|
21
|
-
A["🤖<br/>MCP client<br/>(Claude / Codex / ...)"]
|
|
22
|
-
|
|
23
|
-
subgraph S [Node.js MCP server]
|
|
24
|
-
B1["🧰<br/>Tools & prompts<br/>(src/features/tools)"]
|
|
25
|
-
B2["🖌️<br/>Presenters & formatters<br/>(markdown output)"]
|
|
26
|
-
B3["🌐<br/>OpenAPI HTTP client<br/>(src/tdClient)"]
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
subgraph T [TouchDesigner project]
|
|
30
|
-
C1["🧩<br/>WebServer DAT<br/>(mcp_webserver_base.tox)"]
|
|
31
|
-
C2["🐍<br/>Python controllers / services<br/>(td/modules/mcp)"]
|
|
32
|
-
C3["🎛️<br/>Project nodes & parameters<br/>(/project1/...)"]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
A --> B1
|
|
36
|
-
B1 --> B2
|
|
37
|
-
B1 --> B3
|
|
38
|
-
B2 --> A
|
|
39
|
-
B3 <--> C1
|
|
40
|
-
C1 <--> C2
|
|
41
|
-
C2 <--> C3
|
|
42
|
-
|
|
43
|
-
%% Higher-contrast colors for readability
|
|
44
|
-
classDef client fill:#d8e8ff,stroke:#1f6feb,stroke-width:2px,color:#111,font-weight:bold
|
|
45
|
-
classDef server fill:#efe1ff,stroke:#8250df,stroke-width:2px,color:#111,font-weight:bold
|
|
46
|
-
classDef td fill:#d7f5e3,stroke:#2f9e44,stroke-width:2px,color:#111,font-weight:bold
|
|
47
|
-
class A client;
|
|
48
|
-
class B1,B2,B3 server;
|
|
49
|
-
class C1,C2,C3 td;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
16
|
## 利用方法
|
|
53
17
|
|
|
54
18
|
<details>
|
|
55
19
|
<summary>方法1: Claude Desktop + Desktop Extensions(推奨)</summary>
|
|
56
20
|
|
|
57
|
-
##### 1.
|
|
58
|
-
|
|
21
|
+
##### 1. ファイルをダウンロード:
|
|
59
22
|
[リリースページ](https://github.com/8beeeaaat/touchdesigner-mcp/releases/latest)から以下をダウンロード:
|
|
60
|
-
|
|
61
23
|
- **TouchDesigner Components**: `touchdesigner-mcp-td.zip`
|
|
62
24
|
- **Desktop Extensions (.dxt)**: `touchdesigner-mcp.dxt`
|
|
63
25
|
|
|
64
|
-
##### 2. TouchDesigner
|
|
65
|
-
|
|
26
|
+
##### 2. TouchDesignerコンポーネントを設置:
|
|
66
27
|
1. `touchdesigner-mcp-td.zip`を展開
|
|
67
28
|
2. 展開したフォルダから`mcp_webserver_base.tox`を操作したいTouchDesignerプロジェクト直下にインポート
|
|
68
29
|
例: `/project1/mcp_webserver_base`となるように配置
|
|
69
30
|
|
|
70
|
-
|
|
31
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
71
32
|
|
|
72
33
|
TouchDesignerのメニューからTextportを起動してサーバーの起動ログを確認できます。
|
|
73
34
|
|
|
74
35
|

|
|
75
36
|
|
|
76
|
-
##### 3. Desktop Extension
|
|
77
|
-
|
|
37
|
+
##### 3. Desktop Extensionをインストール:
|
|
78
38
|
`touchdesigner-mcp.dxt`ファイルをダブルクリックしてClaude Desktopに拡張機能をインストール
|
|
79
39
|
|
|
80
|
-
|
|
40
|
+
https://github.com/user-attachments/assets/0786d244-8b82-4387-bbe4-9da048212854
|
|
81
41
|
|
|
82
42
|
##### 4. 拡張機能が自動的にTouchDesignerサーバー接続を処理
|
|
83
43
|
|
|
@@ -90,22 +50,20 @@ flowchart LR
|
|
|
90
50
|
|
|
91
51
|
*Node.jsがインストールされていることが前提となります*
|
|
92
52
|
|
|
93
|
-
##### 1. TouchDesigner
|
|
94
|
-
|
|
53
|
+
##### 1. TouchDesignerコンポーネントを設置:
|
|
95
54
|
1. [リリースページ](https://github.com/8beeeaaat/touchdesigner-mcp/releases/latest)から`touchdesigner-mcp-td.zip`をダウンロード
|
|
96
55
|
2. zipファイルを展開し、`mcp_webserver_base.tox`を操作したいTouchDesignerプロジェクト直下にインポート
|
|
97
56
|
例: `/project1/mcp_webserver_base`となるように配置
|
|
98
57
|
|
|
99
|
-
|
|
58
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
100
59
|
|
|
101
60
|
TouchDesignerのメニューからTextportを起動してサーバーの起動ログを確認できます。
|
|
102
61
|
|
|
103
62
|

|
|
104
63
|
|
|
105
|
-
##### 2. MCP
|
|
64
|
+
##### 2. MCPサーバー設定:
|
|
106
65
|
|
|
107
66
|
*例 Claude Desktop*
|
|
108
|
-
|
|
109
67
|
```json
|
|
110
68
|
{
|
|
111
69
|
"mcpServers": {
|
|
@@ -118,7 +76,6 @@ flowchart LR
|
|
|
118
76
|
```
|
|
119
77
|
|
|
120
78
|
**カスタマイズ:** `--host`と`--port`引数を追加してTouchDesignerサーバー接続をカスタマイズできます:
|
|
121
|
-
|
|
122
79
|
```json
|
|
123
80
|
"args": [
|
|
124
81
|
"-y",
|
|
@@ -128,7 +85,6 @@ flowchart LR
|
|
|
128
85
|
"--port=9982"
|
|
129
86
|
]
|
|
130
87
|
```
|
|
131
|
-
|
|
132
88
|
</details>
|
|
133
89
|
|
|
134
90
|
<details>
|
|
@@ -136,15 +92,13 @@ flowchart LR
|
|
|
136
92
|
|
|
137
93
|
[](https://www.youtube.com/watch?v=BRWoIEVb0TU)
|
|
138
94
|
|
|
139
|
-
##### 1.
|
|
140
|
-
|
|
95
|
+
##### 1. リポジトリをクローン:
|
|
141
96
|
```bash
|
|
142
97
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
143
98
|
cd touchdesigner-mcp
|
|
144
99
|
```
|
|
145
100
|
|
|
146
101
|
##### 2. Dockerイメージのビルド
|
|
147
|
-
|
|
148
102
|
```bash
|
|
149
103
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
150
104
|
cd touchdesigner-mcp
|
|
@@ -158,7 +112,7 @@ TouchDesignerを起動し、`td/mcp_webserver_base.tox`コンポーネントを
|
|
|
158
112
|
|
|
159
113
|
toxファイルのインポートにより`td/import_modules.py`スクリプトが実行され、APIサーバーのコントローラなどのモジュールがロードされます。
|
|
160
114
|
|
|
161
|
-
|
|
115
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
162
116
|
|
|
163
117
|
TouchDesignerのメニューからTextportを起動してサーバーの起動ログを確認できます。
|
|
164
118
|
|
|
@@ -170,10 +124,9 @@ TouchDesignerのメニューからTextportを起動してサーバーの起動
|
|
|
170
124
|
docker-compose up -d
|
|
171
125
|
```
|
|
172
126
|
|
|
173
|
-
##### 5. AIエージェントがDocker
|
|
127
|
+
##### 5. AIエージェントがDockerコンテナを使用するように設定:
|
|
174
128
|
|
|
175
129
|
*例 Claude Desktop*
|
|
176
|
-
|
|
177
130
|
```json
|
|
178
131
|
{
|
|
179
132
|
"mcpServers": {
|
|
@@ -199,7 +152,6 @@ docker-compose up -d
|
|
|
199
152
|
*Windows システムでは、ドライブレターを含めてください。例:`C:\\path\\to\\your\\touchdesigner-mcp\\docker-compose.yml`*
|
|
200
153
|
|
|
201
154
|
**カスタマイズ:** `--port`引数を追加してTouchDesignerサーバー接続をカスタマイズできます:
|
|
202
|
-
|
|
203
155
|
```json
|
|
204
156
|
"args": [
|
|
205
157
|
...,
|
|
@@ -208,9 +160,9 @@ docker-compose up -d
|
|
|
208
160
|
"--port=9982"
|
|
209
161
|
]
|
|
210
162
|
```
|
|
211
|
-
|
|
212
163
|
</details>
|
|
213
164
|
|
|
165
|
+
|
|
214
166
|
## 接続確認
|
|
215
167
|
|
|
216
168
|
MCPサーバーが認識されていればセットアップは完了です。
|
|
@@ -271,12 +223,12 @@ td/
|
|
|
271
223
|
|
|
272
224
|
未実装
|
|
273
225
|
|
|
226
|
+
|
|
274
227
|
## 開発者向け
|
|
275
228
|
|
|
276
229
|
### 開発のクイックスタート
|
|
277
230
|
|
|
278
231
|
1. **環境設定:**
|
|
279
|
-
|
|
280
232
|
```bash
|
|
281
233
|
# リポジトリをクローンして依存関係をインストール
|
|
282
234
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
@@ -285,7 +237,6 @@ td/
|
|
|
285
237
|
```
|
|
286
238
|
|
|
287
239
|
2. **プロジェクトをビルド:**
|
|
288
|
-
|
|
289
240
|
```bash
|
|
290
241
|
make build # Docker-based build(推奨)
|
|
291
242
|
# または
|
|
@@ -293,7 +244,6 @@ td/
|
|
|
293
244
|
```
|
|
294
245
|
|
|
295
246
|
3. **利用可能なコマンド:**
|
|
296
|
-
|
|
297
247
|
```bash
|
|
298
248
|
npm run test # ユニットテストと統合テストを実行
|
|
299
249
|
npm run dev # デバッグ用MCPインスペクターを起動
|
|
@@ -333,24 +283,25 @@ td/
|
|
|
333
283
|
└── orval.config.ts # Orval 設定 (TSクライアント生成)
|
|
334
284
|
```
|
|
335
285
|
|
|
286
|
+
|
|
336
287
|
### APIコード生成ワークフロー
|
|
337
288
|
|
|
338
289
|
このプロジェクトでは、OpenAPIによるコード生成ツール ( Orval / openapi-generator-cli )を使用しています:
|
|
339
290
|
|
|
340
291
|
**API定義:** Node.js MCPサーバーとTouchDesigner内で実行されるPythonサーバー間のAPI規約は `src/api/index.yml` で定義されます。
|
|
341
292
|
|
|
342
|
-
1.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
2.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
3.
|
|
352
|
-
|
|
353
|
-
|
|
293
|
+
1. **Pythonサーバー生成 (`npm run gen:webserver`):**
|
|
294
|
+
* Docker経由で `openapi-generator-cli` を使用します。
|
|
295
|
+
* `src/api/index.yml` を読み取ります。
|
|
296
|
+
* API定義に基づいてPythonサーバーのスケルトン (`td/modules/td_server/`) を生成します。このコードはWebServer DATを介してTouchDesigner内で実行されます。
|
|
297
|
+
* **Dockerがインストールされ、実行されている必要があります。**
|
|
298
|
+
2. **Pythonハンドラ生成 (`npm run gen:handlers`):**
|
|
299
|
+
* カスタムNode.jsスクリプト (`td/genHandlers.js`) とMustacheテンプレート (`td/templates/`) を使用します。
|
|
300
|
+
* 生成されたPythonサーバーコードまたはOpenAPI仕様を読み取ります。
|
|
301
|
+
* `td/modules/mcp/services/api_service.py` にあるビジネスロジックに接続するハンドラ実装 (`td/modules/mcp/controllers/generated_handlers.py`) を生成します。
|
|
302
|
+
3. **TypeScriptクライアント生成 (`npm run gen:mcp`):**
|
|
303
|
+
* `Orval` を使用し `openapi-generator-cli` がバンドルしたスキーマYAMLからAPIクライアントコードとToolの検証に用いるZodスキーマを生成します。
|
|
304
|
+
* Node.jsサーバーが WebServerDAT にリクエストを行うために使用する、型付けされたTypeScriptクライアント (`src/tdClient/`) を生成します。
|
|
354
305
|
|
|
355
306
|
ビルドプロセス (`npm run build`) は、必要なすべての生成ステップ (`npm run gen`) を実行し、その後にTypeScriptコンパイル (`tsc`) を行います。
|
|
356
307
|
|
package/README.md
CHANGED
|
@@ -9,78 +9,37 @@ This is an implementation of an MCP (Model Context Protocol) server for TouchDes
|
|
|
9
9
|
[](https://youtu.be/V2znaqGU7f4?si=6HDFbcBHCFPdttkM&t=635)
|
|
10
10
|
|
|
11
11
|
TouchDesigner MCP acts as a bridge between AI models and the TouchDesigner WebServer DAT, enabling AI agents to:
|
|
12
|
-
|
|
13
12
|
- Create, modify, and delete nodes
|
|
14
13
|
- Query node properties and project structure
|
|
15
14
|
- Programmatically control TouchDesigner via Python scripts
|
|
16
15
|
|
|
17
|
-
## Architecture
|
|
18
|
-
|
|
19
|
-
```mermaid
|
|
20
|
-
flowchart LR
|
|
21
|
-
A["🤖<br/>MCP client<br/>(Claude / Codex / ...)"]
|
|
22
|
-
|
|
23
|
-
subgraph S [Node.js MCP server]
|
|
24
|
-
B1["🧰<br/>Tools & prompts<br/>(src/features/tools)"]
|
|
25
|
-
B2["🖌️<br/>Presenters & formatters<br/>(markdown output)"]
|
|
26
|
-
B3["🌐<br/>OpenAPI HTTP client<br/>(src/tdClient)"]
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
subgraph T [TouchDesigner project]
|
|
30
|
-
C1["🧩<br/>WebServer DAT<br/>(mcp_webserver_base.tox)"]
|
|
31
|
-
C2["🐍<br/>Python controllers / services<br/>(td/modules/mcp)"]
|
|
32
|
-
C3["🎛️<br/>Project nodes & parameters<br/>(/project1/...)"]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
A --> B1
|
|
36
|
-
B1 --> B2
|
|
37
|
-
B1 --> B3
|
|
38
|
-
B2 --> A
|
|
39
|
-
B3 <--> C1
|
|
40
|
-
C1 <--> C2
|
|
41
|
-
C2 <--> C3
|
|
42
|
-
|
|
43
|
-
%% Higher-contrast colors for readability
|
|
44
|
-
classDef client fill:#d8e8ff,stroke:#1f6feb,stroke-width:2px,color:#111,font-weight:bold
|
|
45
|
-
classDef server fill:#efe1ff,stroke:#8250df,stroke-width:2px,color:#111,font-weight:bold
|
|
46
|
-
classDef td fill:#d7f5e3,stroke:#2f9e44,stroke-width:2px,color:#111,font-weight:bold
|
|
47
|
-
class A client;
|
|
48
|
-
class B1,B2,B3 server;
|
|
49
|
-
class C1,C2,C3 td;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
16
|
## Usage
|
|
53
17
|
|
|
54
18
|
<details>
|
|
55
19
|
<summary>Method 1: Using Claude Desktop and Desktop Extensions (Recommended)</summary>
|
|
56
20
|
|
|
57
21
|
### 1. Download Files
|
|
58
|
-
|
|
59
22
|
Download the following from the [releases page](https://github.com/8beeeaaat/touchdesigner-mcp/releases/latest):
|
|
60
|
-
|
|
61
23
|
- **TouchDesigner Components**: `touchdesigner-mcp-td.zip`
|
|
62
24
|
- **Desktop Extension (.dxt)**: `touchdesigner-mcp.dxt`
|
|
63
25
|
|
|
64
26
|
### 2. Set up TouchDesigner Components
|
|
65
|
-
|
|
66
27
|
1. Extract the TouchDesigner components from `touchdesigner-mcp-td.zip`.
|
|
67
28
|
2. Import `mcp_webserver_base.tox` into your TouchDesigner project.
|
|
68
29
|
3. Place it at `/project1/mcp_webserver_base`.
|
|
69
30
|
|
|
70
|
-
|
|
31
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
71
32
|
|
|
72
33
|
You can check the startup logs by opening the Textport from the TouchDesigner menu.
|
|
73
34
|
|
|
74
35
|

|
|
75
36
|
|
|
76
37
|
### 3. Install the Desktop Extension
|
|
77
|
-
|
|
78
38
|
Double-click the `touchdesigner-mcp.dxt` file to install the extension in Claude Desktop.
|
|
79
39
|
|
|
80
|
-
|
|
40
|
+
https://github.com/user-attachments/assets/0786d244-8b82-4387-bbe4-9da048212854
|
|
81
41
|
|
|
82
42
|
### 4. Connect to the Server
|
|
83
|
-
|
|
84
43
|
The extension will automatically handle the connection to the TouchDesigner server.
|
|
85
44
|
|
|
86
45
|
**⚠️ Important:** The directory structure must be preserved exactly as extracted. The `mcp_webserver_base.tox` component references relative paths to the `modules/` directory and other files.
|
|
@@ -93,12 +52,11 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
93
52
|
*Requires Node.js to be installed.*
|
|
94
53
|
|
|
95
54
|
### 1. Set up TouchDesigner Components
|
|
96
|
-
|
|
97
55
|
1. Download and extract the TouchDesigner components from `touchdesigner-mcp-td.zip` ([releases page](https://github.com/8beeeaaat/touchdesigner-mcp/releases/latest)).
|
|
98
56
|
2. Import `mcp_webserver_base.tox` into your TouchDesigner project.
|
|
99
57
|
3. Place it at `/project1/mcp_webserver_base`.
|
|
100
58
|
|
|
101
|
-
|
|
59
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
102
60
|
|
|
103
61
|
You can check the startup logs by opening the Textport from the TouchDesigner menu.
|
|
104
62
|
|
|
@@ -107,7 +65,6 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
107
65
|
### 2. Set up the MCP Server Configuration
|
|
108
66
|
|
|
109
67
|
*Example for Claude Desktop:*
|
|
110
|
-
|
|
111
68
|
```json
|
|
112
69
|
{
|
|
113
70
|
"mcpServers": {
|
|
@@ -120,7 +77,6 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
120
77
|
```
|
|
121
78
|
|
|
122
79
|
**Customization:** You can customize the TouchDesigner server connection by adding `--host` and `--port` arguments:
|
|
123
|
-
|
|
124
80
|
```json
|
|
125
81
|
"args": [
|
|
126
82
|
"-y",
|
|
@@ -130,7 +86,6 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
130
86
|
"--port=9982"
|
|
131
87
|
]
|
|
132
88
|
```
|
|
133
|
-
|
|
134
89
|
</details>
|
|
135
90
|
|
|
136
91
|
<details>
|
|
@@ -138,42 +93,39 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
138
93
|
|
|
139
94
|
[](https://www.youtube.com/watch?v=BRWoIEVb0TU)
|
|
140
95
|
|
|
141
|
-
### 1. Clone the repository
|
|
142
|
-
|
|
96
|
+
### 1. Clone the repository
|
|
143
97
|
```bash
|
|
144
98
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
145
99
|
cd touchdesigner-mcp
|
|
146
100
|
```
|
|
147
101
|
|
|
148
|
-
### 2. Build the Docker image
|
|
149
|
-
|
|
102
|
+
### 2. Build the Docker image
|
|
150
103
|
```bash
|
|
151
104
|
make build
|
|
152
105
|
```
|
|
153
106
|
|
|
154
|
-
### 3. Install the API Server in Your TouchDesigner Project
|
|
107
|
+
### 3. Install the API Server in Your TouchDesigner Project
|
|
155
108
|
|
|
156
109
|
Start TouchDesigner and import the `td/mcp_webserver_base.tox` component into the project you want to control.
|
|
157
110
|
Example: Place it at `/project1/mcp_webserver_base`.
|
|
158
111
|
|
|
159
112
|
Importing the `.tox` file will trigger the `td/import_modules.py` script, which loads the necessary modules for the API server.
|
|
160
113
|
|
|
161
|
-
|
|
114
|
+
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
|
|
162
115
|
|
|
163
116
|
You can check the startup logs by opening the Textport from the TouchDesigner menu.
|
|
164
117
|
|
|
165
118
|

|
|
166
119
|
|
|
167
|
-
### 4. Start the MCP server container
|
|
120
|
+
### 4. Start the MCP server container
|
|
168
121
|
|
|
169
122
|
```bash
|
|
170
123
|
docker-compose up -d
|
|
171
124
|
```
|
|
172
125
|
|
|
173
|
-
### 5. Configure your AI agent to use the Docker container
|
|
126
|
+
### 5. Configure your AI agent to use the Docker container
|
|
174
127
|
|
|
175
128
|
*Example for Claude Desktop:*
|
|
176
|
-
|
|
177
129
|
```json
|
|
178
130
|
{
|
|
179
131
|
"mcpServers": {
|
|
@@ -199,7 +151,6 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
199
151
|
*On Windows systems, include the drive letter, e.g., `C:\path\to\your\touchdesigner-mcp\docker-compose.yml`.*
|
|
200
152
|
|
|
201
153
|
**Note:** You can customize the TouchDesigner server connection by adding `--host` and `--port` arguments:
|
|
202
|
-
|
|
203
154
|
```json
|
|
204
155
|
"args": [
|
|
205
156
|
...,
|
|
@@ -208,9 +159,9 @@ The extension will automatically handle the connection to the TouchDesigner serv
|
|
|
208
159
|
"--port=9982"
|
|
209
160
|
]
|
|
210
161
|
```
|
|
211
|
-
|
|
212
162
|
</details>
|
|
213
163
|
|
|
164
|
+
|
|
214
165
|
## Verify Connection
|
|
215
166
|
|
|
216
167
|
If the MCP server is recognized, the setup is complete.
|
|
@@ -236,6 +187,7 @@ The `mcp_webserver_base.tox` component uses relative paths to locate Python modu
|
|
|
236
187
|
|
|
237
188
|

|
|
238
189
|
|
|
190
|
+
|
|
239
191
|
## MCP Server Features
|
|
240
192
|
|
|
241
193
|
This server enables AI agents to perform operations in TouchDesigner using the Model Context Protocol (MCP).
|
|
@@ -271,12 +223,12 @@ Prompts provide instructions for AI agents to perform specific actions in TouchD
|
|
|
271
223
|
|
|
272
224
|
Not implemented.
|
|
273
225
|
|
|
226
|
+
|
|
274
227
|
## For Developers
|
|
275
228
|
|
|
276
229
|
### Quick Start for Development
|
|
277
230
|
|
|
278
231
|
1. **Set up your environment:**
|
|
279
|
-
|
|
280
232
|
```bash
|
|
281
233
|
# Clone and install dependencies
|
|
282
234
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
@@ -285,7 +237,6 @@ Not implemented.
|
|
|
285
237
|
```
|
|
286
238
|
|
|
287
239
|
2. **Build the project:**
|
|
288
|
-
|
|
289
240
|
```bash
|
|
290
241
|
make build # Docker-based build (recommended)
|
|
291
242
|
# OR
|
|
@@ -293,7 +244,6 @@ Not implemented.
|
|
|
293
244
|
```
|
|
294
245
|
|
|
295
246
|
3. **Available commands:**
|
|
296
|
-
|
|
297
247
|
```bash
|
|
298
248
|
npm run test # Run unit and integration tests
|
|
299
249
|
npm run dev # Launch the MCP inspector for debugging
|
|
@@ -333,24 +283,25 @@ Not implemented.
|
|
|
333
283
|
└── orval.config.ts # Orval config (TypeScript client generation)
|
|
334
284
|
```
|
|
335
285
|
|
|
286
|
+
|
|
336
287
|
### API Code Generation Workflow
|
|
337
288
|
|
|
338
289
|
This project uses OpenAPI-based code generation tools (Orval and openapi-generator-cli).
|
|
339
290
|
|
|
340
291
|
**API Definition:** The API contract between the Node.js MCP server and the Python server running inside TouchDesigner is defined in `src/api/index.yml`.
|
|
341
292
|
|
|
342
|
-
1.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
2.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
3.
|
|
352
|
-
|
|
353
|
-
|
|
293
|
+
1. **Python server generation (`npm run gen:webserver`):**
|
|
294
|
+
* Uses `openapi-generator-cli` via Docker.
|
|
295
|
+
* Reads `src/api/index.yml`.
|
|
296
|
+
* Generates a Python server skeleton (`td/modules/td_server/`) based on the API definition. This code runs inside TouchDesigner's WebServer DAT.
|
|
297
|
+
* **Requires Docker to be installed and running.**
|
|
298
|
+
2. **Python handler generation (`npm run gen:handlers`):**
|
|
299
|
+
* Uses a custom Node.js script (`td/genHandlers.js`) and Mustache templates (`td/templates/`).
|
|
300
|
+
* Reads the generated Python server code or OpenAPI spec.
|
|
301
|
+
* Generates handler implementations (`td/modules/mcp/controllers/generated_handlers.py`) that connect to the business logic in `td/modules/mcp/services/api_service.py`.
|
|
302
|
+
3. **TypeScript client generation (`npm run gen:mcp`):**
|
|
303
|
+
* Uses `Orval` to generate an API client and Zod schemas for tool validation from the schema YAML, which is bundled by `openapi-generator-cli`.
|
|
304
|
+
* Generates a typed TypeScript client (`src/tdClient/`) used by the Node.js server to make requests to the WebServer DAT.
|
|
354
305
|
|
|
355
306
|
The build process (`npm run build`) runs all necessary generation steps (`npm run gen`), followed by TypeScript compilation (`tsc`).
|
|
356
307
|
|
package/dist/core/constants.js
CHANGED
|
@@ -9,7 +9,6 @@ export const TD_PYTHON_CLASS_REFERENCE_INDEX_URL = `${TD_PYTHON_CLASS_REFERENCE_
|
|
|
9
9
|
export const TOOL_NAMES = {
|
|
10
10
|
CREATE_TD_NODE: "create_td_node",
|
|
11
11
|
DELETE_TD_NODE: "delete_td_node",
|
|
12
|
-
DESCRIBE_TD_TOOLS: "describe_td_tools",
|
|
13
12
|
EXECUTE_PYTHON_SCRIPT: "execute_python_script",
|
|
14
13
|
EXECUTE_NODE_METHOD: "exec_node_method",
|
|
15
14
|
GET_TD_INFO: "get_td_info",
|