touchdesigner-mcp-server 0.2.8 → 0.2.9

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 CHANGED
@@ -15,20 +15,27 @@ TouchDesigner MCPは、AIモデルとTouchDesigner WebServer DAT 間のブリッ
15
15
 
16
16
  ## 利用方法
17
17
 
18
- *Node.js がインストールされていることが前提となります*
18
+ *Docker または Node.js がインストールされていることが前提となります*
19
19
 
20
- [![tutorial](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/tutorial.png)](https://www.youtube.com/watch?v=jFaUP1fYum0)
20
+ #### 方法1: Dockerイメージを利用(推奨)
21
21
 
22
- ### 1. touchdesigner-mcp-server パッケージのインストール
22
+ ##### 1. リポジトリをクローン:
23
+ ```bash
24
+ git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
25
+ cd touchdesigner-mcp
26
+ ```
23
27
 
24
- `mkdir some && cd ./some` *(必要に応じて作成)*
25
- `npm install touchdesigner-mcp-server`
28
+ ##### 2. 環境設定ファイルの設置とビルド
29
+ .envのテンプレートファイルをコピーし、必要に応じて TD_WEB_SERVER_URL を調整してから Dockerイメージをビルドしてください。
26
30
 
27
- ### 2. TouchDesignerとの接続
31
+ ```bash
32
+ cp dotenv .env
33
+ docker-compose build
34
+ ```
28
35
 
29
- #### mcp_webserver_base.tox TouchDesigner に配置
36
+ ##### 3. TouchDesigner プロジェクトにMCP連携用のAPIサーバーを設置
30
37
 
31
- TouchDesignerを起動し、`td/mcp_webserver_base.tox` コンポーネントをTouchDesignerプロジェクト直下にimportします。
38
+ TouchDesignerを起動し、`td/mcp_webserver_base.tox` コンポーネントを操作したいTouchDesignerプロジェクト直下にimportします。
32
39
  例: `/project1/mcp_webserver_base` となるように配置
33
40
 
34
41
  tox のimport により `td/import_modules.py` スクリプトが動作し、APIサーバのコントローラなどのモジュールがロードされます。
@@ -39,8 +46,51 @@ TouchDesigner のメニューから Textportを起動してサーバーの起動
39
46
 
40
47
  ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/textport.png)
41
48
 
42
- ### 3. TouchDesigner MCP Server の設定
43
- TouchDesignerが起動した状態で、AIエージェント(Claude Desktop,Cursor, VSCode CopilotChatなど)をMCPサーバーに接続するように設定します。
49
+ ##### 4. AIエージェントがDockerコンテナを使用するように設定して起動:
50
+
51
+ *例 Claude Desktop*
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "touchdesigner": {
56
+ "args": [
57
+ "run",
58
+ "--rm",
59
+ "-i",
60
+ "touchdesigner-mcp-server",
61
+ ],
62
+ "command": "docker"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ #### 方法2: NPMパッケージ を利用する
69
+
70
+ Node.jsから直接ビルド済みのjsを利用する場合は、以下の手順に従います:
71
+
72
+ [![tutorial](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/tutorial.png)](https://www.youtube.com/watch?v=jFaUP1fYum0)
73
+
74
+ ##### 1. パッケージのインストール
75
+ ```bash
76
+ mkdir some && cd ./some # 必要に応じて任意のディレクトリを作成
77
+ npm install touchdesigner-mcp-server
78
+ ```
79
+
80
+ ##### 2. TouchDesigner プロジェクトにMCP連携用のAPIサーバーを設置
81
+
82
+ TouchDesignerを起動し、`some/node_modules/touchdesigner-mcp-server/td/mcp_webserver_base.tox` コンポーネントを操作したいTouchDesignerプロジェクト直下にimportします。
83
+ 例: `/project1/mcp_webserver_base` となるように配置
84
+
85
+ tox のimport により `some/node_modules/touchdesigner-mcp-server/td/import_modules.py` スクリプトが動作し、APIサーバのコントローラなどのモジュールがロードされます。
86
+
87
+ ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/import.png)
88
+
89
+ TouchDesigner のメニューから Textportを起動してサーバーの起動ログを確認することができます。
90
+
91
+ ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/textport.png)
92
+
93
+ ##### 3. AIエージェントの設定:
44
94
 
45
95
  *例 Claude Desktop*
46
96
  ```json
@@ -51,8 +101,7 @@ TouchDesignerが起動した状態で、AIエージェント(Claude Desktop,Cu
51
101
  "/path/to/your/node_modules/touchdesigner-mcp-server/dist/index.js", // <-- node_modules/touchdesigner-mcp-server/dist/index.js への絶対パスに置き換えてください
52
102
  "--stdio"
53
103
  ],
54
- "command": "node",
55
- "transportType": "stdio"
104
+ "command": "node"
56
105
  }
57
106
  }
58
107
  }
@@ -60,10 +109,12 @@ TouchDesignerが起動した状態で、AIエージェント(Claude Desktop,Cu
60
109
 
61
110
  *Windows環境では C:\\ の様にドライブレターを含めてください。 例. `C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js`*
62
111
 
112
+ ### 3. 接続確認
113
+
63
114
  MCPサーバーが認識されていればセットアップは完了です。
64
115
  認識されない場合はAIエージェントを再起動するなどしてください。
65
116
  起動時にエラーが表示される場合はTouchDesignerを先に起動してから再度エージェントを起動してください。
66
- TouchDesigner で APIサーバーが実行されていれば、エージェントは提供された TouchDesigner ツールを通じてTouchDesignerを使用できます。
117
+ TouchDesigner で APIサーバーが実行されていれば、エージェントは提供された ツール等を通じてTouchDesignerを使用できます。
67
118
 
68
119
  ![demo](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/nodes_list.png)
69
120
 
@@ -105,77 +156,23 @@ TouchDesigner で APIサーバーが実行されていれば、エージェン
105
156
 
106
157
  ## 開発者向け
107
158
 
108
- ### MCPサーバーコードのビルド
109
-
110
- 1. リポジトリのクローン
111
- ```bash
112
- git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
113
- ```
114
-
115
- 2. 依存パッケージのインストール
116
- ```bash
117
- cd touchdesigner-mcp
118
- npm install
119
- ```
120
- 3. 環境設定ファイルの設置とビルド
121
- ```
122
- # テンプレートをコピーし、必要に応じて TD_WEB_SERVER_URL を調整してください
123
- cp dotenv .env
124
-
125
- # プロジェクトのビルド(APIクライアント/サーバー向けスキーマを生成し、MCPリソースをコンパイルします)
126
- # このコマンドを実行する前にDockerデーモンが実行されていることを確認してください
127
- npm run build
128
- ```
129
-
130
- ### TouchDesignerのセットアップ
159
+ ### クライアント・APIサーバーコードのビルド
131
160
 
132
- #### 1. **コード生成:**
133
- `npm run build` を実行します。これにより以下のコードが生成されます。
134
- - MCPサーバコード
135
- - TouchDesigner WebSever DAT向けのAPIサーバーコード
161
+ 1. `cp dotenv .env`
162
+ 2. `.env` ファイルの `TD_WEB_SERVER_URL` を開発環境に合わせて変更
163
+ 3. `docker-compose build` もしくは `npm run build` を実行してコードを再生成する
136
164
 
137
- #### 2. **TouchDesigner に MCPサーバー向けWebServerをインポートする:**
138
- TouchDesignerを起動し、`td/mcp_webserver_base.tox` コンポーネントをTouchDesignerプロジェクト直下にimportします。
139
- tox のimport により `td/import_modules.py` スクリプトが動作し、APIサーバのコントローラなどのモジュールがロードされます。
165
+ ビルドしたコードを再反映する場合は MCPサーバーと TouchDesigner を再起動してください
140
166
 
141
- #### 3. **APIサーバの動作確認:**
142
- `td/modules` ディレクトリ内のPythonモジュールが `mcp_webserver_base` コンポーネントからアクセス可能であることを確認します。
143
- `npm run test` を実行することでMCPサーバーコードのユニットテストと TouchDesigner への結合テストが実行されます。
167
+ ### APIサーバの動作確認
168
+ - `npm run test`
169
+ MCPサーバーコードのユニットテストと TouchDesigner への結合テストが実行されます。
144
170
  TouchDesigner のメニューから Textportを起動すると通信のログを確認することができます。
145
171
 
146
- `npm run dev` で @modelcontextprotocol/inspector させデバッグすることができます。
147
-
148
- *TIPS*
149
- `mcp_webserver_base.tox` には、MCPサーバーとTouchDesignerを連携させるように設定された WebServer DAT が含まれています。
150
- このDATがActiveであり、`.env` ファイルの `TD_WEB_SERVER_URL` で指定されたポートで実行されていることを確認してください。(デフォルト: `9981`)
151
- 実行するポートを任意のものに変更したい場合は、以下の手順に従ってください。
152
- 1. `.env` ファイルの `TD_WEB_SERVER_PORT` を変更
153
- 2. `npm run build` を再実行
154
- 3. mcp_webserver_base (WebServer DAT) のポートを変更し、WebServer DATをRestart
155
-
156
- ### MCP対応 AIエージェントとの接続
157
-
158
- TouchDesignerが起動した状態で、AIエージェント(Cursor, Claude Desktop, VSCode CopilotChatなど)をMCPサーバーに接続するように設定します。
159
-
160
- #### 例. Claude Desktop
161
- ```json
162
- {
163
- "mcpServers": {
164
- "dev_touchdesigner": {
165
- "args": [
166
- "/path/to/your/touchdesigner-mcp/dist/index.js", // <-- ビルド後の /dist/index.js への絶対パスに置き換えてください
167
- "--stdio"
168
- ],
169
- "command": "node",
170
- "transportType": "stdio"
171
- }
172
- }
173
- }
174
- ```
175
-
176
- *Windows環境では C:\\ の様にドライブレターを含めてください。 例. `C:\\path\\to\\your\\touchdesigner-mcp\\dist\\index.js`*
172
+ - `npm run dev`
173
+ @modelcontextprotocol/inspector が起動し、各種機能をデバッグすることができます。
177
174
 
178
- ### セットアップ後のプロジェクト構造概要
175
+ ### プロジェクト構造の概要
179
176
 
180
177
  ```
181
178
  ├── src/ # MCPサーバー ソースコード
package/README.md CHANGED
@@ -15,20 +15,27 @@ TouchDesigner MCP acts as a bridge between AI models and the TouchDesigner WebSe
15
15
 
16
16
  ## Usage
17
17
 
18
- *Requires Node.js to be installed*
18
+ *Requires Docker or Node.js to be installed*
19
19
 
20
- [![tutorial](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/tutorial.png)](https://www.youtube.com/watch?v=jFaUP1fYum0)
20
+ #### Method 1: Using Docker Image (Recommended)
21
21
 
22
- ### 1. Install the touchdesigner-mcp-server package
22
+ ##### 1. Clone the repository:
23
+ ```bash
24
+ git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
25
+ cd touchdesigner-mcp
26
+ ```
23
27
 
24
- `mkdir some && cd ./some` *(If you need)*
25
- `npm install touchdesigner-mcp-server`
28
+ ##### 2. Set up the environment file and build:
29
+ Copy the template file and adjust the TD_WEB_SERVER_URL as needed before building the Docker image.
26
30
 
27
- ### 2. Connect to TouchDesigner
31
+ ```bash
32
+ cp dotenv .env
33
+ docker-compose build
34
+ ```
28
35
 
29
- #### Place mcp_webserver_base.tox in TouchDesigner
36
+ ##### 3. Install the API Server in Your TouchDesigner Project:
30
37
 
31
- Start TouchDesigner and import the `td/mcp_webserver_base.tox` component directly under your TouchDesigner project.
38
+ Start TouchDesigner and import the `td/mcp_webserver_base.tox` component directly under the TouchDesigner project you want to control.
32
39
  Example: Place it as `/project1/mcp_webserver_base`
33
40
 
34
41
  Importing the tox will trigger the `td/import_modules.py` script, which loads modules such as API server controllers.
@@ -39,10 +46,53 @@ You can check boot logs by opening the Textport from the TouchDesigner menu.
39
46
 
40
47
  ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/textport.png)
41
48
 
42
- ### 3. Configure the TouchDesigner MCP Server
43
- With TouchDesigner running, configure your AI agent (Claude Desktop, Cursor, VSCode CopilotChat, etc.) to connect to the MCP server.
49
+ ##### 4. Configure your AI agent to use the Docker container:
50
+
51
+ *Example for Claude Desktop*
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "touchdesigner": {
56
+ "args": [
57
+ "run",
58
+ "--rm",
59
+ "-i",
60
+ "touchdesigner-mcp-server"
61
+ ],
62
+ "command": "docker"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ #### Method 2: Using the NPM Package
69
+
70
+ To use the pre-built JS directly from Node.js:
71
+
72
+ [![tutorial](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/tutorial.png)](https://www.youtube.com/watch?v=jFaUP1fYum0)
73
+
74
+ ##### 1. Install the package
75
+ ```bash
76
+ mkdir some && cd ./some # If you need a new directory
77
+ npm install touchdesigner-mcp-server
78
+ ```
79
+
80
+ ##### 2. Install the API Server in Your TouchDesigner Project:
81
+
82
+ Start TouchDesigner and import the `some/node_modules/touchdesigner-mcp-server/td/mcp_webserver_base.tox` component directly under the TouchDesigner project you want to control.
83
+ Example: Place it as `/project1/mcp_webserver_base`
84
+
85
+ Importing the tox will trigger the `some/node_modules/touchdesigner-mcp-server/td/import_modules.py` script, which loads modules such as API server controllers.
86
+
87
+ ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/import.png)
88
+
89
+ You can check boot logs by opening the Textport from the TouchDesigner menu.
90
+
91
+ ![import](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/textport.png)
92
+
93
+ ##### 3. Configure your AI agent:
44
94
 
45
- *Example: Claude Desktop*
95
+ *Example for Claude Desktop*
46
96
  ```json
47
97
  {
48
98
  "mcpServers": {
@@ -51,19 +101,20 @@ With TouchDesigner running, configure your AI agent (Claude Desktop, Cursor, VSC
51
101
  "/path/to/your/node_modules/touchdesigner-mcp-server/dist/index.js", // <-- Replace with the absolute path to node_modules/touchdesigner-mcp-server/dist/index.js
52
102
  "--stdio"
53
103
  ],
54
- "command": "node",
55
- "transportType": "stdio"
104
+ "command": "node"
56
105
  }
57
106
  }
58
107
  }
59
108
  ```
60
109
 
61
- *On Windows system, please include the drive letter such as C: e.g. `C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js`*
110
+ *On Windows systems, include the drive letter like C: e.g. `C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js`*
111
+
112
+ ### 3. Verify Connection
62
113
 
63
114
  If the MCP server is recognized, setup is complete.
64
- Restart the agent, if not recognized.
65
- If you see an error at startup, try launching the agent again after starting TouchDesigner.
66
- If the API server is running in TouchDesigner, the agent can use TouchDesigner via the provided tools.
115
+ If it's not recognized, try restarting your AI agent.
116
+ If you see an error at startup, try launching the agent again after starting TouchDesigner first.
117
+ When the API server is running properly in TouchDesigner, the agent can use the provided tools to operate TouchDesigner.
67
118
 
68
119
  ![demo](https://github.com/8beeeaaat/touchdesigner-mcp/blob/main/assets/nodes_list.png)
69
120
 
@@ -106,77 +157,31 @@ Not implemented
106
157
 
107
158
  ## For Developers
108
159
 
109
- ### Building the MCP Server Code
110
-
111
- 1. Clone the repository
112
- ```bash
113
- git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
114
- ```
115
-
116
- 2. Install dependencies
117
- ```bash
118
- cd touchdesigner-mcp
119
- npm install
120
- ```
121
- 3. Set up environment file and build
122
- ```
123
- # Copy the template and adjust TD_WEB_SERVER_URL as needed
124
- cp dotenv .env
125
-
126
- # Build the project (generates API client/server schemas and compiles MCP resources)
127
- # Make sure the Docker daemon is running before executing this command
128
- npm run build
129
- ```
160
+ ### Building Client and API Server Code
130
161
 
131
- ### TouchDesigner Setup
162
+ 1. `cp dotenv .env`
163
+ 2. Adjust `TD_WEB_SERVER_URL` in the `.env` file to match your development environment
164
+ 3. Run `docker-compose build` or `npm run build` to regenerate the code
132
165
 
133
- #### 1. **Code Generation:**
134
- Run `npm run build` to generate the following code:
135
- - MCP server code
136
- - API server code for TouchDesigner WebServer DAT
166
+ When you need to reflect the built code, please restart both the MCP server and TouchDesigner.
137
167
 
138
- #### 2. **Import the WebServer for MCP server into TouchDesigner:**
139
- Start TouchDesigner and import the `td/mcp_webserver_base.tox` component directly under your project.
140
- Importing the tox will trigger the `td/import_modules.py` script, which loads modules such as API server controllers.
141
-
142
- #### 3. **Verify API server operation:**
143
- Ensure that the Python modules in the `td/modules` directory are accessible from the `mcp_webserver_base` component.
144
- Run `npm run test` to execute unit and integration tests for the MCP server code and TouchDesigner connection.
168
+ ### Verifying the API Server
169
+ - `npm run test`
170
+ Run unit tests for the MCP server code and integration tests with TouchDesigner.
145
171
  You can check communication logs by opening the Textport from the TouchDesigner menu.
146
172
 
147
- You can debug with @modelcontextprotocol/inspector using `npm run dev`.
173
+ - `npm run dev`
174
+ Launch @modelcontextprotocol/inspector to debug various features.
148
175
 
149
176
  *TIPS*
150
177
  `mcp_webserver_base.tox` includes a WebServer DAT configured to link the MCP server and TouchDesigner.
151
178
  Ensure this DAT is active and running on the port specified by `TD_WEB_SERVER_URL` in your `.env` file (default: `9981`).
152
179
  To change the port:
153
180
  1. Change `TD_WEB_SERVER_PORT` in `.env`
154
- 2. Re-run `npm run build`
181
+ 2. Run `docker-compose build` or `npm run build` to regenerate client code
155
182
  3. Change the port in mcp_webserver_base (WebServer DAT) and restart the DAT
156
183
 
157
- ### Connecting with MCP-compatible AI Agents
158
-
159
- With TouchDesigner running, configure your AI agent (Cursor, Claude Desktop, VSCode CopilotChat, etc.) to connect to the MCP server.
160
-
161
- #### Example: Claude Desktop
162
- ```json
163
- {
164
- "mcpServers": {
165
- "dev_touchdesigner": {
166
- "args": [
167
- "/path/to/your/touchdesigner-mcp/dist/index.js", // <-- Replace with the absolute path to /dist/index.js after build
168
- "--stdio"
169
- ],
170
- "command": "node",
171
- "transportType": "stdio"
172
- }
173
- }
174
- }
175
- ```
176
-
177
- *On Windows system, please include the drive letter such as C: e.g. `C:\\path\\to\\your\\touchdesigner-mcp\\dist\\index.js`*
178
-
179
- ### Project Structure After Setup
184
+ ### Project Structure Overview
180
185
 
181
186
  ```
182
187
  ├── src/ # MCP server source code
@@ -1,8 +1,6 @@
1
1
  import Axios from "axios";
2
- const API_BASE_URL = process.env.API_BASE_URL || "http://localhost:9981";
3
- export const AXIOS_INSTANCE = Axios.create({
4
- baseURL: API_BASE_URL,
5
- });
2
+ const API_BASE_URL = process.env.TD_WEB_SERVER_URL;
3
+ export const AXIOS_INSTANCE = Axios.create(API_BASE_URL ? { baseURL: API_BASE_URL } : {});
6
4
  export const customInstance = (config, options) => {
7
5
  const source = Axios.CancelToken.source();
8
6
  const promise = AXIOS_INSTANCE({
@@ -3,7 +3,7 @@
3
3
  * Do not edit manually.
4
4
  * TouchDesigner API
5
5
  * OpenAPI schema for generating TouchDesigner API client code
6
- * OpenAPI spec version: 0.2.8
6
+ * OpenAPI spec version: 0.2.9
7
7
  */
8
8
  import { customInstance } from '../../api/customInstance.js';
9
9
  // eslint-disable-next-line @typescript-eslint/no-redeclare
@@ -3,7 +3,7 @@
3
3
  * Do not edit manually.
4
4
  * TouchDesigner API
5
5
  * OpenAPI schema for generating TouchDesigner API client code
6
- * OpenAPI spec version: 0.2.8
6
+ * OpenAPI spec version: 0.2.9
7
7
  */
8
8
  import { z as zod } from 'zod';
9
9
  /**
@@ -18,7 +18,7 @@ export class TouchDesignerServer {
18
18
  constructor() {
19
19
  this.server = new McpServer({
20
20
  name: "TouchDesigner",
21
- version: "0.2.8",
21
+ version: "0.2.9",
22
22
  }, {
23
23
  capabilities: {
24
24
  prompts: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "touchdesigner-mcp-server",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "MCP server for TouchDesigner",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@biomejs/biome": "1.9.4",
31
+ "@openapitools/openapi-generator-cli": "^2.20.0",
31
32
  "@types/jsdom": "^21.1.7",
32
33
  "@types/node": "^22.15.3",
33
34
  "@vitest/coverage-v8": "^3.1.2",
@@ -58,7 +59,7 @@
58
59
  "test:unit": "vitest run ./tests/unit",
59
60
  "coverage": "vitest run --coverage",
60
61
  "gen": "run-s gen:*",
61
- "gen:webserver": "docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/src/api/index.yml -g python-flask -o /local/td/modules/td_server",
62
+ "gen:webserver": "openapi-generator-cli generate -i ./src/api/index.yml -g python-flask -o ./td/modules/td_server",
62
63
  "gen:handlers": "node td/genHandlers.js",
63
64
  "gen:mcp": "orval --config ./orval.config.ts"
64
65
  },
@@ -1 +1 @@
1
- 7.14.0-SNAPSHOT
1
+ 7.13.0
@@ -2,7 +2,7 @@ openapi: 3.0.0
2
2
  info:
3
3
  description: OpenAPI schema for generating TouchDesigner API client code
4
4
  title: TouchDesigner API
5
- version: 0.2.8
5
+ version: 0.2.9
6
6
  servers:
7
7
  - url: "{baseUrl}"
8
8
  variables: