touchdesigner-mcp-server 0.2.9 → 0.2.11
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 -10
- package/README.md +84 -73
- package/dist/api/customInstance.js +1 -1
- package/dist/gen/endpoints/TouchDesignerAPI.js +1 -1
- package/dist/gen/mcp/touchDesignerAPI.zod.js +1 -1
- package/dist/server/connectionManager.js +1 -1
- package/dist/server/touchDesignerServer.js +1 -1
- package/package.json +8 -8
- package/td/modules/td_server/openapi_server/openapi/openapi.yaml +1 -1
package/README.ja.md
CHANGED
|
@@ -19,18 +19,20 @@ TouchDesigner MCPは、AIモデルとTouchDesigner WebServer DAT 間のブリッ
|
|
|
19
19
|
|
|
20
20
|
#### 方法1: Dockerイメージを利用(推奨)
|
|
21
21
|
|
|
22
|
+
[](https://www.youtube.com/watch?v=BRWoIEVb0TU)
|
|
23
|
+
|
|
22
24
|
##### 1. リポジトリをクローン:
|
|
23
25
|
```bash
|
|
24
26
|
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
25
27
|
cd touchdesigner-mcp
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
##### 2.
|
|
29
|
-
.envのテンプレートファイルをコピーし、必要に応じて
|
|
30
|
+
##### 2. 環境設定ファイルの設置とコードのビルド
|
|
31
|
+
.envのテンプレートファイルをコピーし、必要に応じて TD_WEB_SERVER_HOST / TD_WEB_SERVER_PORT を調整してから Dockerイメージをビルドしてください。
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
34
|
cp dotenv .env
|
|
33
|
-
|
|
35
|
+
make build
|
|
34
36
|
```
|
|
35
37
|
|
|
36
38
|
##### 3. TouchDesigner プロジェクトにMCP連携用のAPIサーバーを設置
|
|
@@ -46,25 +48,39 @@ TouchDesigner のメニューから Textportを起動してサーバーの起動
|
|
|
46
48
|
|
|
47
49
|

|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
#### 4. MCPサーバーのコンテナを起動
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
docker-compose up -d
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
##### 5. AIエージェントがDockerコンテナを使用するように設定して起動:
|
|
50
58
|
|
|
51
59
|
*例 Claude Desktop*
|
|
52
60
|
```json
|
|
53
61
|
{
|
|
54
62
|
"mcpServers": {
|
|
55
63
|
"touchdesigner": {
|
|
64
|
+
"command": "docker",
|
|
56
65
|
"args": [
|
|
57
|
-
"
|
|
58
|
-
"
|
|
66
|
+
"compose",
|
|
67
|
+
"-f",
|
|
68
|
+
"/path/to/your/touchdesigner-mcp/docker-compose.yml",
|
|
69
|
+
"exec",
|
|
59
70
|
"-i",
|
|
60
71
|
"touchdesigner-mcp-server",
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
"node",
|
|
73
|
+
"dist/index.js",
|
|
74
|
+
"--stdio"
|
|
75
|
+
]
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
78
|
}
|
|
66
79
|
```
|
|
67
80
|
|
|
81
|
+
*Windows環境では C:\\ の様にドライブレターを含めてください。 例. `C:\\path\\to\\your\\touchdesigner-mcp\\docker-compose.yml`*
|
|
82
|
+
|
|
83
|
+
|
|
68
84
|
#### 方法2: NPMパッケージ を利用する
|
|
69
85
|
|
|
70
86
|
Node.jsから直接ビルド済みのjsを利用する場合は、以下の手順に従います:
|
|
@@ -159,8 +175,8 @@ TouchDesigner で APIサーバーが実行されていれば、エージェン
|
|
|
159
175
|
### クライアント・APIサーバーコードのビルド
|
|
160
176
|
|
|
161
177
|
1. `cp dotenv .env`
|
|
162
|
-
2. `.env` ファイルの `
|
|
163
|
-
3. `
|
|
178
|
+
2. `.env` ファイルの `TD_WEB_SERVER_HOST`, `TD_WEB_SERVER_PORT` を開発環境に合わせて変更
|
|
179
|
+
3. `make build` もしくは `npm run build` を実行してコードを再生成する
|
|
164
180
|
|
|
165
181
|
ビルドしたコードを再反映する場合は MCPサーバーと TouchDesigner を再起動してください
|
|
166
182
|
|
package/README.md
CHANGED
|
@@ -17,97 +17,116 @@ TouchDesigner MCP acts as a bridge between AI models and the TouchDesigner WebSe
|
|
|
17
17
|
|
|
18
18
|
*Requires Docker or Node.js to be installed*
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
<details>
|
|
21
|
+
<summary>Method 1: Using Docker Image (Recommended)</summary>
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
25
|
-
cd touchdesigner-mcp
|
|
26
|
-
```
|
|
23
|
+
[](https://www.youtube.com/watch?v=BRWoIEVb0TU)
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
#### 1. Clone the repository:
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
|
|
28
|
+
cd touchdesigner-mcp
|
|
29
|
+
```
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
31
|
+
#### 2. Set up the environment file and build:
|
|
32
|
+
Copy the template file and adjust the TD_WEB_SERVER_HOST and TD_WEB_SERVER_PORT as needed before building the Docker image.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cp dotenv .env
|
|
36
|
+
make build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### 3. Install the API Server in Your TouchDesigner Project:
|
|
40
|
+
|
|
41
|
+
Start TouchDesigner and import the `td/mcp_webserver_base.tox` component directly under the TouchDesigner project you want to control.
|
|
42
|
+
Example: Place it as `/project1/mcp_webserver_base`
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
Importing the tox will trigger the `td/import_modules.py` script, which loads modules such as API server controllers.
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
Example: Place it as `/project1/mcp_webserver_base`
|
|
46
|
+

|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
You can check boot logs by opening the Textport from the TouchDesigner menu.
|
|
42
49
|
|
|
43
|
-

|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
#### 4. Start the MCP server container
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
```bash
|
|
55
|
+
docker-compose up -d
|
|
56
|
+
```
|
|
48
57
|
|
|
49
|
-
|
|
58
|
+
#### 5. Configure your AI agent to use the Docker container:
|
|
50
59
|
|
|
51
|
-
*Example for Claude Desktop*
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
*Example for Claude Desktop*
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"touchdesigner": {
|
|
65
|
+
"command": "docker",
|
|
66
|
+
"args": [
|
|
67
|
+
"compose",
|
|
68
|
+
"-f",
|
|
69
|
+
"/path/to/your/touchdesigner-mcp/docker-compose.yml",
|
|
70
|
+
"exec",
|
|
71
|
+
"-i",
|
|
72
|
+
"touchdesigner-mcp-server",
|
|
73
|
+
"node",
|
|
74
|
+
"dist/index.js",
|
|
75
|
+
"--stdio"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
|
-
|
|
66
|
-
```
|
|
80
|
+
```
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
*On Windows systems, include the drive letter like C: e.g. `C:\\path\\to\\your\\touchdesigner-mcp\\docker-compose.yml`*
|
|
83
|
+
</details>
|
|
69
84
|
|
|
70
|
-
|
|
85
|
+
<details>
|
|
86
|
+
<summary>Method 2: Using the NPM Package</summary>
|
|
71
87
|
|
|
72
|
-
|
|
88
|
+
To use the pre-built JS directly from Node.js:
|
|
73
89
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
[](https://www.youtube.com/watch?v=jFaUP1fYum0)
|
|
91
|
+
|
|
92
|
+
#### 1. Install the package
|
|
93
|
+
```bash
|
|
94
|
+
mkdir some && cd ./some # If you need a new directory
|
|
95
|
+
npm install touchdesigner-mcp-server
|
|
96
|
+
```
|
|
79
97
|
|
|
80
|
-
|
|
98
|
+
#### 2. Install the API Server in Your TouchDesigner Project:
|
|
81
99
|
|
|
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`
|
|
100
|
+
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.
|
|
101
|
+
Example: Place it as `/project1/mcp_webserver_base`
|
|
84
102
|
|
|
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.
|
|
103
|
+
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
104
|
|
|
87
|
-

|
|
105
|
+

|
|
88
106
|
|
|
89
|
-
You can check boot logs by opening the Textport from the TouchDesigner menu.
|
|
107
|
+
You can check boot logs by opening the Textport from the TouchDesigner menu.
|
|
90
108
|
|
|
91
|
-

|
|
109
|
+

|
|
92
110
|
|
|
93
|
-
|
|
111
|
+
#### 3. Configure your AI agent:
|
|
94
112
|
|
|
95
|
-
*Example for Claude Desktop*
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
*Example for Claude Desktop*
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"touchdesigner": {
|
|
118
|
+
"args": [
|
|
119
|
+
"/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
|
|
120
|
+
"--stdio"
|
|
121
|
+
],
|
|
122
|
+
"command": "node"
|
|
123
|
+
}
|
|
105
124
|
}
|
|
106
125
|
}
|
|
107
|
-
|
|
108
|
-
```
|
|
126
|
+
```
|
|
109
127
|
|
|
110
|
-
*On Windows systems, include the drive letter like C: e.g. `C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js`*
|
|
128
|
+
*On Windows systems, include the drive letter like C: e.g. `C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js`*
|
|
129
|
+
</details>
|
|
111
130
|
|
|
112
131
|
### 3. Verify Connection
|
|
113
132
|
|
|
@@ -160,8 +179,8 @@ Not implemented
|
|
|
160
179
|
### Building Client and API Server Code
|
|
161
180
|
|
|
162
181
|
1. `cp dotenv .env`
|
|
163
|
-
2. Adjust `
|
|
164
|
-
3. Run `
|
|
182
|
+
2. Adjust `TD_WEB_SERVER_HOST` and `TD_WEB_SERVER_PORT` in the `.env` file to match your development environment
|
|
183
|
+
3. Run `make build` or `npm run build` to regenerate the code
|
|
165
184
|
|
|
166
185
|
When you need to reflect the built code, please restart both the MCP server and TouchDesigner.
|
|
167
186
|
|
|
@@ -173,14 +192,6 @@ You can check communication logs by opening the Textport from the TouchDesigner
|
|
|
173
192
|
- `npm run dev`
|
|
174
193
|
Launch @modelcontextprotocol/inspector to debug various features.
|
|
175
194
|
|
|
176
|
-
*TIPS*
|
|
177
|
-
`mcp_webserver_base.tox` includes a WebServer DAT configured to link the MCP server and TouchDesigner.
|
|
178
|
-
Ensure this DAT is active and running on the port specified by `TD_WEB_SERVER_URL` in your `.env` file (default: `9981`).
|
|
179
|
-
To change the port:
|
|
180
|
-
1. Change `TD_WEB_SERVER_PORT` in `.env`
|
|
181
|
-
2. Run `docker-compose build` or `npm run build` to regenerate client code
|
|
182
|
-
3. Change the port in mcp_webserver_base (WebServer DAT) and restart the DAT
|
|
183
|
-
|
|
184
195
|
### Project Structure Overview
|
|
185
196
|
|
|
186
197
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Axios from "axios";
|
|
2
|
-
const API_BASE_URL = process.env.
|
|
2
|
+
const API_BASE_URL = `${process.env.TD_WEB_SERVER_HOST}:${process.env.TD_WEB_SERVER_PORT}`;
|
|
3
3
|
export const AXIOS_INSTANCE = Axios.create(API_BASE_URL ? { baseURL: API_BASE_URL } : {});
|
|
4
4
|
export const customInstance = (config, options) => {
|
|
5
5
|
const source = Axios.CancelToken.source();
|
|
@@ -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.
|
|
6
|
+
* OpenAPI spec version: 0.2.11
|
|
7
7
|
*/
|
|
8
8
|
import { customInstance } from '../../api/customInstance.js';
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
@@ -23,7 +23,7 @@ export class ConnectionManager {
|
|
|
23
23
|
this.transport = transport;
|
|
24
24
|
try {
|
|
25
25
|
await this.server.connect(transport);
|
|
26
|
-
this.logger.log(
|
|
26
|
+
this.logger.log(`Server connected and ready to process requests: ${process.env.TD_WEB_SERVER_HOST}:${process.env.TD_WEB_SERVER_PORT}`);
|
|
27
27
|
const connectionResult = await this.checkTDConnection();
|
|
28
28
|
if (!connectionResult.success) {
|
|
29
29
|
throw new Error(`Failed to connect to TouchDesigner: ${connectionResult.error.message}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "touchdesigner-mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "MCP server for TouchDesigner",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,33 +17,33 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/8beeeaaat/touchdesigner-mcp#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.11.1",
|
|
21
21
|
"@mozilla/readability": "^0.6.0",
|
|
22
22
|
"@types/axios": "^0.14.4",
|
|
23
23
|
"@types/ws": "^8.18.1",
|
|
24
24
|
"@types/yargs": "^17.0.33",
|
|
25
25
|
"axios": "^1.9.0",
|
|
26
26
|
"dotenv": "^16.5.0",
|
|
27
|
-
"zod": "^3.24.
|
|
27
|
+
"zod": "^3.24.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@biomejs/biome": "1.9.4",
|
|
31
31
|
"@openapitools/openapi-generator-cli": "^2.20.0",
|
|
32
32
|
"@types/jsdom": "^21.1.7",
|
|
33
|
-
"@types/node": "^22.15.
|
|
34
|
-
"@vitest/coverage-v8": "^3.1.
|
|
35
|
-
"msw": "^2.
|
|
33
|
+
"@types/node": "^22.15.17",
|
|
34
|
+
"@vitest/coverage-v8": "^3.1.3",
|
|
35
|
+
"msw": "^2.8.2",
|
|
36
36
|
"mustache": "^4.2.0",
|
|
37
37
|
"npm-run-all": "^4.1.5",
|
|
38
38
|
"orval": "^7.9.0",
|
|
39
39
|
"typescript": "^5.8.3",
|
|
40
|
-
"vitest": "^3.1.
|
|
40
|
+
"vitest": "^3.1.3",
|
|
41
41
|
"yaml": "^2.7.1"
|
|
42
42
|
},
|
|
43
43
|
"type": "module",
|
|
44
44
|
"main": "src/index.ts",
|
|
45
45
|
"bin": {
|
|
46
|
-
"mcp-server": "dist/index.js"
|
|
46
|
+
"touchdesigner-mcp-server": "dist/index.js"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "run-s build:*",
|