unity-mcp-cli 0.56.0 → 0.57.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 +108 -40
- package/dist/commands/run-system-tool.d.ts +2 -0
- package/dist/commands/run-system-tool.js +132 -0
- package/dist/commands/run-system-tool.js.map +1 -0
- package/dist/commands/run-tool.js +36 -84
- package/dist/commands/run-tool.js.map +1 -1
- package/dist/commands/setup-mcp.d.ts +2 -0
- package/dist/commands/setup-mcp.js +119 -0
- package/dist/commands/setup-mcp.js.map +1 -0
- package/dist/commands/setup-skills.d.ts +2 -0
- package/dist/commands/setup-skills.js +113 -0
- package/dist/commands/setup-skills.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/agents.d.ts +22 -0
- package/dist/utils/agents.js +546 -0
- package/dist/utils/agents.js.map +1 -0
- package/dist/utils/connection.d.ts +34 -0
- package/dist/utils/connection.js +77 -0
- package/dist/utils/connection.js.map +1 -0
- package/dist/utils/input.d.ts +13 -0
- package/dist/utils/input.js +72 -0
- package/dist/utils/input.js.map +1 -0
- package/dist/utils/json-parse.d.ts +36 -0
- package/dist/utils/json-parse.js +103 -0
- package/dist/utils/json-parse.js.map +1 -0
- package/docs/README.es.md +206 -98
- package/docs/README.ja.md +205 -97
- package/docs/README.zh-CN.md +204 -96
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<h1>Unity MCP — <i>CLI</i></h1>
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/unity-mcp-cli)
|
|
5
|
-
[](https://nodejs.org/)
|
|
6
6
|
[](https://github.com/IvanMurzak/Unity-MCP/blob/main/LICENSE)
|
|
7
7
|
[](https://stand-with-ukraine.pp.ua)
|
|
8
8
|
|
|
@@ -37,6 +37,8 @@ Cross-platform CLI tool for **[Unity MCP](https://github.com/IvanMurzak/Unity-MC
|
|
|
37
37
|
- :white_check_mark: **Remove plugin** — remove Unity-MCP plugin from `manifest.json`
|
|
38
38
|
- :white_check_mark: **Configure** — enable/disable MCP tools, prompts, and resources
|
|
39
39
|
- :white_check_mark: **Run tools** — execute MCP tools directly from the command line
|
|
40
|
+
- :white_check_mark: **Setup MCP** — write AI agent MCP config files for any of 14 supported agents
|
|
41
|
+
- :white_check_mark: **Setup skills** — generate skill files for AI agents via the MCP server
|
|
40
42
|
- :white_check_mark: **Open & Connect** — launch Unity with optional MCP environment variables for automated server connection
|
|
41
43
|
- :white_check_mark: **Cross-platform** — Windows, macOS, and Linux
|
|
42
44
|
- :white_check_mark: **CI-friendly** — auto-detects non-interactive terminals and disables spinners/colors
|
|
@@ -47,20 +49,20 @@ Cross-platform CLI tool for **[Unity MCP](https://github.com/IvanMurzak/Unity-MC
|
|
|
47
49
|
|
|
48
50
|
# Quick Start
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
Install globally and run:
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
|
-
|
|
55
|
+
npm install -g unity-mcp-cli
|
|
56
|
+
unity-mcp-cli install-plugin /path/to/unity/project
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
Or
|
|
59
|
+
Or run any command instantly with `npx` — no global installation required:
|
|
57
60
|
|
|
58
61
|
```bash
|
|
59
|
-
|
|
60
|
-
unity-mcp-cli install-plugin /path/to/unity/project
|
|
62
|
+
npx unity-mcp-cli install-plugin /path/to/unity/project
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
> **Requirements:** [Node.js](https://nodejs.org/) >=
|
|
65
|
+
> **Requirements:** [Node.js](https://nodejs.org/) ^20.19.0 || >=22.12.0. [Unity Hub](https://unity.com/download) is installed automatically if not found.
|
|
64
66
|
|
|
65
67
|

|
|
66
68
|
|
|
@@ -68,16 +70,22 @@ unity-mcp-cli install-plugin /path/to/unity/project
|
|
|
68
70
|
|
|
69
71
|
- [Quick Start](#quick-start)
|
|
70
72
|
- [Commands](#commands)
|
|
71
|
-
- [`configure`](#configure)
|
|
72
|
-
- [`create-project`](#create-project)
|
|
73
|
-
- [`install-plugin`](#install-plugin)
|
|
74
|
-
- [`install-unity`](#install-unity)
|
|
75
|
-
- [`open`](#open)
|
|
76
|
-
- [`
|
|
77
|
-
- [`
|
|
78
|
-
- [
|
|
73
|
+
- [`configure`](#configure)
|
|
74
|
+
- [`create-project`](#create-project)
|
|
75
|
+
- [`install-plugin`](#install-plugin)
|
|
76
|
+
- [`install-unity`](#install-unity)
|
|
77
|
+
- [`open`](#open)
|
|
78
|
+
- [`run-tool`](#run-tool)
|
|
79
|
+
- [`setup-mcp`](#setup-mcp)
|
|
80
|
+
- [`setup-skills`](#setup-skills)
|
|
81
|
+
- [`remove-plugin`](#remove-plugin)
|
|
82
|
+
- [Global Options](#global-options)
|
|
79
83
|
- [Full Automation Example](#full-automation-example)
|
|
80
84
|
- [How It Works](#how-it-works)
|
|
85
|
+
- [Deterministic Port](#deterministic-port)
|
|
86
|
+
- [Plugin Installation](#plugin-installation)
|
|
87
|
+
- [Configuration File](#configuration-file)
|
|
88
|
+
- [Unity Hub Integration](#unity-hub-integration)
|
|
81
89
|
|
|
82
90
|

|
|
83
91
|
|
|
@@ -88,7 +96,7 @@ unity-mcp-cli install-plugin /path/to/unity/project
|
|
|
88
96
|
Configure MCP tools, prompts, and resources in `UserSettings/AI-Game-Developer-Config.json`.
|
|
89
97
|
|
|
90
98
|
```bash
|
|
91
|
-
|
|
99
|
+
unity-mcp-cli configure ./MyGame --list
|
|
92
100
|
```
|
|
93
101
|
|
|
94
102
|
| Option | Required | Description |
|
|
@@ -111,7 +119,7 @@ npx unity-mcp-cli configure ./MyGame --list
|
|
|
111
119
|
**Example — enable specific tools and disable all prompts:**
|
|
112
120
|
|
|
113
121
|
```bash
|
|
114
|
-
|
|
122
|
+
unity-mcp-cli configure ./MyGame \
|
|
115
123
|
--enable-tools gameobject-create,gameobject-find \
|
|
116
124
|
--disable-all-prompts
|
|
117
125
|
```
|
|
@@ -119,7 +127,7 @@ npx unity-mcp-cli configure ./MyGame \
|
|
|
119
127
|
**Example — enable everything:**
|
|
120
128
|
|
|
121
129
|
```bash
|
|
122
|
-
|
|
130
|
+
unity-mcp-cli configure ./MyGame \
|
|
123
131
|
--enable-all-tools \
|
|
124
132
|
--enable-all-prompts \
|
|
125
133
|
--enable-all-resources
|
|
@@ -132,7 +140,7 @@ npx unity-mcp-cli configure ./MyGame \
|
|
|
132
140
|
Create a new Unity project using the Unity Editor.
|
|
133
141
|
|
|
134
142
|
```bash
|
|
135
|
-
|
|
143
|
+
unity-mcp-cli create-project /path/to/new/project
|
|
136
144
|
```
|
|
137
145
|
|
|
138
146
|
| Option | Required | Description |
|
|
@@ -143,7 +151,7 @@ npx unity-mcp-cli create-project /path/to/new/project
|
|
|
143
151
|
**Example — create a project with a specific editor version:**
|
|
144
152
|
|
|
145
153
|
```bash
|
|
146
|
-
|
|
154
|
+
unity-mcp-cli create-project ./MyGame --unity 2022.3.62f1
|
|
147
155
|
```
|
|
148
156
|
|
|
149
157
|

|
|
@@ -153,7 +161,7 @@ npx unity-mcp-cli create-project ./MyGame --unity 2022.3.62f1
|
|
|
153
161
|
Install the Unity-MCP plugin into a Unity project's `Packages/manifest.json`.
|
|
154
162
|
|
|
155
163
|
```bash
|
|
156
|
-
|
|
164
|
+
unity-mcp-cli install-plugin ./MyGame
|
|
157
165
|
```
|
|
158
166
|
|
|
159
167
|
| Option | Required | Description |
|
|
@@ -169,7 +177,7 @@ This command:
|
|
|
169
177
|
**Example — install a specific plugin version:**
|
|
170
178
|
|
|
171
179
|
```bash
|
|
172
|
-
|
|
180
|
+
unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6
|
|
173
181
|
```
|
|
174
182
|
|
|
175
183
|
> After running this command, open the project in Unity Editor to complete the package installation.
|
|
@@ -181,7 +189,7 @@ npx unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6
|
|
|
181
189
|
Install a Unity Editor version via Unity Hub CLI.
|
|
182
190
|
|
|
183
191
|
```bash
|
|
184
|
-
|
|
192
|
+
unity-mcp-cli install-unity 6000.3.1f1
|
|
185
193
|
```
|
|
186
194
|
|
|
187
195
|
| Argument / Option | Required | Description |
|
|
@@ -194,7 +202,7 @@ If neither argument nor option is provided, the command installs the latest stab
|
|
|
194
202
|
**Example — install the editor version that a project needs:**
|
|
195
203
|
|
|
196
204
|
```bash
|
|
197
|
-
|
|
205
|
+
unity-mcp-cli install-unity --path ./MyGame
|
|
198
206
|
```
|
|
199
207
|
|
|
200
208
|

|
|
@@ -204,7 +212,7 @@ npx unity-mcp-cli install-unity --path ./MyGame
|
|
|
204
212
|
Open a Unity project in the Unity Editor. By default, sets MCP connection environment variables if connection options are provided. Use `--no-connect` to open without MCP connection.
|
|
205
213
|
|
|
206
214
|
```bash
|
|
207
|
-
|
|
215
|
+
unity-mcp-cli open ./MyGame
|
|
208
216
|
```
|
|
209
217
|
|
|
210
218
|
| Option | Env Variable | Required | Description |
|
|
@@ -225,7 +233,7 @@ The editor process is spawned in detached mode — the CLI returns immediately.
|
|
|
225
233
|
**Example — open with MCP connection:**
|
|
226
234
|
|
|
227
235
|
```bash
|
|
228
|
-
|
|
236
|
+
unity-mcp-cli open ./MyGame \
|
|
229
237
|
--url http://localhost:8080 \
|
|
230
238
|
--keep-connected
|
|
231
239
|
```
|
|
@@ -233,13 +241,13 @@ npx unity-mcp-cli open ./MyGame \
|
|
|
233
241
|
**Example — open without MCP connection (simple open):**
|
|
234
242
|
|
|
235
243
|
```bash
|
|
236
|
-
|
|
244
|
+
unity-mcp-cli open ./MyGame --no-connect
|
|
237
245
|
```
|
|
238
246
|
|
|
239
247
|
**Example — open with authentication and specific tools:**
|
|
240
248
|
|
|
241
249
|
```bash
|
|
242
|
-
|
|
250
|
+
unity-mcp-cli open ./MyGame \
|
|
243
251
|
--url http://my-server:8080 \
|
|
244
252
|
--token my-secret-token \
|
|
245
253
|
--auth required \
|
|
@@ -253,7 +261,7 @@ npx unity-mcp-cli open ./MyGame \
|
|
|
253
261
|
Execute an MCP tool directly via the HTTP API. The server URL and authorization token are **automatically resolved** from the project's config file (`UserSettings/AI-Game-Developer-Config.json`), based on the current connection mode (Custom or Cloud).
|
|
254
262
|
|
|
255
263
|
```bash
|
|
256
|
-
|
|
264
|
+
unity-mcp-cli run-tool gameobject-create ./MyGame --input '{"name":"Cube"}'
|
|
257
265
|
```
|
|
258
266
|
|
|
259
267
|
| Option | Required | Description |
|
|
@@ -265,10 +273,11 @@ npx unity-mcp-cli run-tool gameobject-create ./MyGame --input '{"name":"Cube"}'
|
|
|
265
273
|
| `--input <json>` | No | JSON string of tool arguments (defaults to `{}`) |
|
|
266
274
|
| `--input-file <file>` | No | Read JSON arguments from a file |
|
|
267
275
|
| `--raw` | No | Output raw JSON (no formatting, no spinner) |
|
|
276
|
+
| `--timeout <ms>` | No | Request timeout in milliseconds (default: 60000) |
|
|
268
277
|
|
|
269
278
|
**URL resolution priority:**
|
|
270
279
|
1. `--url` → use directly
|
|
271
|
-
2. Config file → `host` (Custom mode) or
|
|
280
|
+
2. Config file → `host` (Custom mode) or hardcoded cloud endpoint (Cloud mode)
|
|
272
281
|
3. Deterministic port from project path
|
|
273
282
|
|
|
274
283
|
**Authorization** is read automatically from the project config (`token` in Custom mode, `cloudToken` in Cloud mode). Use `--token` to override the config-derived token explicitly.
|
|
@@ -276,19 +285,75 @@ npx unity-mcp-cli run-tool gameobject-create ./MyGame --input '{"name":"Cube"}'
|
|
|
276
285
|
**Example — call a tool (URL and auth from config):**
|
|
277
286
|
|
|
278
287
|
```bash
|
|
279
|
-
|
|
288
|
+
unity-mcp-cli run-tool gameobject-find ./MyGame --input '{"query":"Player"}'
|
|
280
289
|
```
|
|
281
290
|
|
|
282
291
|
**Example — explicit URL override:**
|
|
283
292
|
|
|
284
293
|
```bash
|
|
285
|
-
|
|
294
|
+
unity-mcp-cli run-tool scene-save --url http://localhost:8080
|
|
286
295
|
```
|
|
287
296
|
|
|
288
297
|
**Example — pipe raw JSON output:**
|
|
289
298
|
|
|
290
299
|
```bash
|
|
291
|
-
|
|
300
|
+
unity-mcp-cli run-tool assets-list ./MyGame --raw | jq '.results'
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+

|
|
304
|
+
|
|
305
|
+
## `setup-mcp`
|
|
306
|
+
|
|
307
|
+
Write MCP config files for AI agents, enabling headless/CI setup without the Unity Editor UI. Supports all 14 agents (Claude Code, Cursor, Gemini, Codex, etc.).
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
unity-mcp-cli setup-mcp claude-code ./MyGame
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
| Option | Required | Description |
|
|
314
|
+
|---|---|---|
|
|
315
|
+
| `[agent-id]` | Yes | Agent to configure (use `--list` to see all) |
|
|
316
|
+
| `[path]` | No | Unity project path (defaults to cwd) |
|
|
317
|
+
| `--transport <transport>` | No | Transport method: `stdio` or `http` (default: `http`) |
|
|
318
|
+
| `--url <url>` | No | Server URL override (for http transport) |
|
|
319
|
+
| `--token <token>` | No | Auth token override |
|
|
320
|
+
| `--list` | No | List all available agent IDs |
|
|
321
|
+
|
|
322
|
+
**Example — list all supported agents:**
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
unity-mcp-cli setup-mcp --list
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Example — configure Cursor with stdio transport:**
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
unity-mcp-cli setup-mcp cursor ./MyGame --transport stdio
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+

|
|
335
|
+
|
|
336
|
+
## `setup-skills`
|
|
337
|
+
|
|
338
|
+
Generate skill files for an AI agent by calling the MCP server's system tool API. Requires Unity Editor to be running with the MCP plugin installed.
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
unity-mcp-cli setup-skills claude-code ./MyGame
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
| Option | Required | Description |
|
|
345
|
+
|---|---|---|
|
|
346
|
+
| `[agent-id]` | Yes | Agent to generate skills for (use `--list` to see all) |
|
|
347
|
+
| `[path]` | No | Unity project path (defaults to cwd) |
|
|
348
|
+
| `--url <url>` | No | Server URL override |
|
|
349
|
+
| `--token <token>` | No | Auth token override |
|
|
350
|
+
| `--list` | No | List all agents with skills support status |
|
|
351
|
+
| `--timeout <ms>` | No | Request timeout in milliseconds (default: 60000) |
|
|
352
|
+
|
|
353
|
+
**Example — list agents with skills support:**
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
unity-mcp-cli setup-skills --list
|
|
292
357
|
```
|
|
293
358
|
|
|
294
359
|

|
|
@@ -298,7 +363,7 @@ npx unity-mcp-cli run-tool assets-list ./MyGame --raw | jq '.results'
|
|
|
298
363
|
Remove the Unity-MCP plugin from a Unity project's `Packages/manifest.json`.
|
|
299
364
|
|
|
300
365
|
```bash
|
|
301
|
-
|
|
366
|
+
unity-mcp-cli remove-plugin ./MyGame
|
|
302
367
|
```
|
|
303
368
|
|
|
304
369
|
| Option | Required | Description |
|
|
@@ -327,7 +392,7 @@ These options are available on all commands:
|
|
|
327
392
|
**Example — run any command with verbose output:**
|
|
328
393
|
|
|
329
394
|
```bash
|
|
330
|
-
|
|
395
|
+
unity-mcp-cli install-plugin ./MyGame --verbose
|
|
331
396
|
```
|
|
332
397
|
|
|
333
398
|

|
|
@@ -338,16 +403,19 @@ Set up a complete Unity MCP project from scratch in one script:
|
|
|
338
403
|
|
|
339
404
|
```bash
|
|
340
405
|
# 1. Create a new Unity project
|
|
341
|
-
|
|
406
|
+
unity-mcp-cli create-project ./MyAIGame --unity 6000.3.1f1
|
|
342
407
|
|
|
343
408
|
# 2. Install the Unity-MCP plugin
|
|
344
|
-
|
|
409
|
+
unity-mcp-cli install-plugin ./MyAIGame
|
|
345
410
|
|
|
346
411
|
# 3. Enable all MCP tools
|
|
347
|
-
|
|
412
|
+
unity-mcp-cli configure ./MyAIGame --enable-all-tools
|
|
413
|
+
|
|
414
|
+
# 4. Configure Claude Code MCP integration
|
|
415
|
+
unity-mcp-cli setup-mcp claude-code ./MyAIGame
|
|
348
416
|
|
|
349
|
-
#
|
|
350
|
-
|
|
417
|
+
# 5. Open the project with MCP connection
|
|
418
|
+
unity-mcp-cli open ./MyAIGame \
|
|
351
419
|
--url http://localhost:8080 \
|
|
352
420
|
--keep-connected
|
|
353
421
|
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import * as ui from '../utils/ui.js';
|
|
3
|
+
import { verbose } from '../utils/ui.js';
|
|
4
|
+
import { resolveAndValidateProjectPath, resolveConnection } from '../utils/connection.js';
|
|
5
|
+
import { parseInput } from '../utils/input.js';
|
|
6
|
+
export const runSystemToolCommand = new Command('run-system-tool')
|
|
7
|
+
.description('Execute a system tool via the HTTP API (not exposed to MCP clients)')
|
|
8
|
+
.argument('<tool-name>', 'Name of the system tool to execute')
|
|
9
|
+
.argument('[path]', 'Unity project path (used for config and auto port detection)')
|
|
10
|
+
.option('--path <path>', 'Unity project path (config and auto port detection)')
|
|
11
|
+
.option('--url <url>', 'Direct server URL override (bypasses config)')
|
|
12
|
+
.option('--token <token>', 'Bearer token override (bypasses config)')
|
|
13
|
+
.option('--input <json>', 'JSON string of tool arguments')
|
|
14
|
+
.option('--input-file <file>', 'Read JSON arguments from file')
|
|
15
|
+
.option('--raw', 'Output raw JSON (no formatting)')
|
|
16
|
+
.option('--timeout <ms>', 'Request timeout in milliseconds (default: 60000)', '60000')
|
|
17
|
+
.action(async (toolName, positionalPath, options) => {
|
|
18
|
+
const projectPath = resolveAndValidateProjectPath(positionalPath, options);
|
|
19
|
+
const { url: baseUrl, token } = resolveConnection(projectPath, options);
|
|
20
|
+
const body = parseInput(options);
|
|
21
|
+
const endpoint = `${baseUrl}/api/system-tools/${encodeURIComponent(toolName)}`;
|
|
22
|
+
verbose(`System tool: ${toolName}`);
|
|
23
|
+
verbose(`Endpoint: ${endpoint}`);
|
|
24
|
+
verbose(`Body: ${body}`);
|
|
25
|
+
const headers = {
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
};
|
|
28
|
+
if (token) {
|
|
29
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
30
|
+
verbose(`Authorization header set (source: ${options.token ? '--token flag' : 'config'})`);
|
|
31
|
+
}
|
|
32
|
+
const authSource = options.token ? '--token flag' : 'config';
|
|
33
|
+
if (!options.raw) {
|
|
34
|
+
ui.heading('Run System Tool');
|
|
35
|
+
ui.label('Tool', toolName);
|
|
36
|
+
ui.label('URL', endpoint);
|
|
37
|
+
if (token) {
|
|
38
|
+
ui.label('Auth', `from ${authSource}`);
|
|
39
|
+
}
|
|
40
|
+
ui.divider();
|
|
41
|
+
}
|
|
42
|
+
const spinner = options.raw ? null : ui.startSpinner(`Calling ${toolName}...`);
|
|
43
|
+
const timeoutMs = parseInt(options.timeout ?? '60000', 10);
|
|
44
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
45
|
+
ui.error(`Invalid --timeout value: "${options.timeout}". Must be a positive integer (milliseconds).`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const controller = new AbortController();
|
|
49
|
+
const fetchTimeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetch(endpoint, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers,
|
|
54
|
+
body,
|
|
55
|
+
signal: controller.signal,
|
|
56
|
+
});
|
|
57
|
+
const responseText = await response.text();
|
|
58
|
+
let responseData;
|
|
59
|
+
try {
|
|
60
|
+
responseData = JSON.parse(responseText);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
responseData = responseText;
|
|
64
|
+
}
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
spinner?.stop();
|
|
67
|
+
if (options.raw) {
|
|
68
|
+
process.stdout.write(responseText);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
ui.error(`HTTP ${response.status}: ${response.statusText}`);
|
|
72
|
+
if (responseData) {
|
|
73
|
+
ui.info(typeof responseData === 'string'
|
|
74
|
+
? responseData
|
|
75
|
+
: JSON.stringify(responseData, null, 2));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
spinner?.success(`${toolName} completed`);
|
|
81
|
+
if (options.raw) {
|
|
82
|
+
process.stdout.write(responseText);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
ui.success('Response:');
|
|
86
|
+
console.log(typeof responseData === 'string'
|
|
87
|
+
? responseData
|
|
88
|
+
: JSON.stringify(responseData, null, 2));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
spinner?.stop();
|
|
93
|
+
const isTimeout = err instanceof Error && err.name === 'AbortError';
|
|
94
|
+
const cause = err instanceof Error && 'cause' in err ? err.cause : null;
|
|
95
|
+
const causeCode = cause?.code ?? '';
|
|
96
|
+
const rootMessage = cause?.message || causeCode || (err instanceof Error ? err.message : String(err));
|
|
97
|
+
const errorSignature = `${rootMessage} ${causeCode}`;
|
|
98
|
+
const isConnectionRefused = errorSignature.includes('ECONNREFUSED');
|
|
99
|
+
const isConnectionReset = errorSignature.includes('ECONNRESET');
|
|
100
|
+
const isNetworkError = errorSignature.includes('EAI_AGAIN') || errorSignature.includes('ENOTFOUND');
|
|
101
|
+
let displayMessage;
|
|
102
|
+
if (isTimeout) {
|
|
103
|
+
displayMessage = `System tool call timed out after ${timeoutMs / 1000} seconds: ${toolName}`;
|
|
104
|
+
}
|
|
105
|
+
else if (isConnectionRefused) {
|
|
106
|
+
displayMessage = `Connection refused at ${endpoint}. Is the MCP server running? Start Unity Editor with the MCP plugin first.`;
|
|
107
|
+
}
|
|
108
|
+
else if (isConnectionReset) {
|
|
109
|
+
displayMessage = `Connection was reset by the server at ${endpoint}. The server may have crashed or restarted.`;
|
|
110
|
+
}
|
|
111
|
+
else if (isNetworkError) {
|
|
112
|
+
displayMessage = `Cannot reach ${endpoint}. Check your network connection and server URL.`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
displayMessage = `${rootMessage}`;
|
|
116
|
+
if (cause && cause.message !== rootMessage) {
|
|
117
|
+
displayMessage += ` (${cause.message})`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (options.raw) {
|
|
121
|
+
process.stderr.write(displayMessage + '\n');
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
ui.error(`Failed to call system tool: ${displayMessage}`);
|
|
125
|
+
}
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
clearTimeout(fetchTimeout);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=run-system-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-system-tool.js","sourceRoot":"","sources":["../../src/commands/run-system-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;KAC/D,WAAW,CAAC,qEAAqE,CAAC;KAClF,QAAQ,CAAC,aAAa,EAAE,oCAAoC,CAAC;KAC7D,QAAQ,CAAC,QAAQ,EAAE,8DAA8D,CAAC;KAClF,MAAM,CAAC,eAAe,EAAE,qDAAqD,CAAC;KAC9E,MAAM,CAAC,aAAa,EAAE,8CAA8C,CAAC;KACrE,MAAM,CAAC,iBAAiB,EAAE,yCAAyC,CAAC;KACpE,MAAM,C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AI,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC;YAC1C,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,KAAK,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,86 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import * as path from 'path';
|
|
4
2
|
import * as ui from '../utils/ui.js';
|
|
5
3
|
import { verbose } from '../utils/ui.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
/**
|
|
9
|
-
* Resolve the project path from positional arg, --path option, or cwd.
|
|
10
|
-
*/
|
|
11
|
-
function resolveProjectPath(positionalPath, options) {
|
|
12
|
-
const resolved = path.resolve(positionalPath ?? options.path ?? process.cwd());
|
|
13
|
-
if ((positionalPath !== undefined || options.path !== undefined) && !fs.existsSync(resolved)) {
|
|
14
|
-
ui.error(`Project path does not exist: ${resolved}`);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
return resolved;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Resolve the server URL and auth token.
|
|
21
|
-
*
|
|
22
|
-
* URL priority:
|
|
23
|
-
* 1. --url flag (explicit override)
|
|
24
|
-
* 2. Config file connectionMode → Custom: host, Cloud: hardcoded cloud URL
|
|
25
|
-
* 3. Deterministic port from project path
|
|
26
|
-
*
|
|
27
|
-
* Token priority:
|
|
28
|
-
* 1. --token flag (explicit override)
|
|
29
|
-
* 2. Config file token
|
|
30
|
-
*/
|
|
31
|
-
function resolveConnection(projectPath, options) {
|
|
32
|
-
const config = readConfig(projectPath);
|
|
33
|
-
const fromConfig = config ? resolveConnectionFromConfig(config) : { url: undefined, token: undefined };
|
|
34
|
-
verbose(`Config loaded: connectionMode=${config?.connectionMode ?? 'N/A'}, configUrl=${fromConfig.url ?? 'N/A'}, hasToken=${!!fromConfig.token}`);
|
|
35
|
-
let url;
|
|
36
|
-
if (options.url) {
|
|
37
|
-
url = options.url.replace(/\/$/, '');
|
|
38
|
-
verbose(`Using explicit --url: ${url}`);
|
|
39
|
-
}
|
|
40
|
-
else if (fromConfig.url) {
|
|
41
|
-
url = fromConfig.url.replace(/\/$/, '');
|
|
42
|
-
verbose(`Using URL from config (${config?.connectionMode} mode): ${url}`);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const port = generatePortFromDirectory(projectPath);
|
|
46
|
-
url = `http://localhost:${port}`;
|
|
47
|
-
verbose(`Using deterministic port URL: ${url}`);
|
|
48
|
-
}
|
|
49
|
-
const token = options.token ?? fromConfig.token;
|
|
50
|
-
if (options.token) {
|
|
51
|
-
verbose('Using explicit --token');
|
|
52
|
-
}
|
|
53
|
-
return { url, token };
|
|
54
|
-
}
|
|
55
|
-
function parseInput(options) {
|
|
56
|
-
if (options.inputFile) {
|
|
57
|
-
const filePath = path.resolve(options.inputFile);
|
|
58
|
-
if (!fs.existsSync(filePath)) {
|
|
59
|
-
ui.error(`Input file does not exist: ${filePath}`);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
63
|
-
try {
|
|
64
|
-
JSON.parse(content);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
ui.error(`Input file does not contain valid JSON: ${filePath}`);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
return content;
|
|
71
|
-
}
|
|
72
|
-
if (options.input) {
|
|
73
|
-
try {
|
|
74
|
-
JSON.parse(options.input);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
ui.error('--input must be valid JSON');
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
return options.input;
|
|
81
|
-
}
|
|
82
|
-
return '{}';
|
|
83
|
-
}
|
|
4
|
+
import { resolveAndValidateProjectPath, resolveConnection } from '../utils/connection.js';
|
|
5
|
+
import { parseInput } from '../utils/input.js';
|
|
84
6
|
export const runToolCommand = new Command('run-tool')
|
|
85
7
|
.description('Execute an MCP tool via the HTTP API')
|
|
86
8
|
.argument('<tool-name>', 'Name of the MCP tool to execute')
|
|
@@ -91,8 +13,9 @@ export const runToolCommand = new Command('run-tool')
|
|
|
91
13
|
.option('--input <json>', 'JSON string of tool arguments')
|
|
92
14
|
.option('--input-file <file>', 'Read JSON arguments from file')
|
|
93
15
|
.option('--raw', 'Output raw JSON (no formatting)')
|
|
16
|
+
.option('--timeout <ms>', 'Request timeout in milliseconds (default: 60000)', '60000')
|
|
94
17
|
.action(async (toolName, positionalPath, options) => {
|
|
95
|
-
const projectPath =
|
|
18
|
+
const projectPath = resolveAndValidateProjectPath(positionalPath, options);
|
|
96
19
|
const { url: baseUrl, token } = resolveConnection(projectPath, options);
|
|
97
20
|
const body = parseInput(options);
|
|
98
21
|
const endpoint = `${baseUrl}/api/tools/${encodeURIComponent(toolName)}`;
|
|
@@ -117,8 +40,13 @@ export const runToolCommand = new Command('run-tool')
|
|
|
117
40
|
ui.divider();
|
|
118
41
|
}
|
|
119
42
|
const spinner = options.raw ? null : ui.startSpinner(`Calling ${toolName}...`);
|
|
43
|
+
const timeoutMs = parseInt(options.timeout ?? '60000', 10);
|
|
44
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
45
|
+
ui.error(`Invalid --timeout value: "${options.timeout}". Must be a positive integer (milliseconds).`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
120
48
|
const controller = new AbortController();
|
|
121
|
-
const fetchTimeout = setTimeout(() => controller.abort(),
|
|
49
|
+
const fetchTimeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
122
50
|
try {
|
|
123
51
|
const response = await fetch(endpoint, {
|
|
124
52
|
method: 'POST',
|
|
@@ -162,9 +90,33 @@ export const runToolCommand = new Command('run-tool')
|
|
|
162
90
|
}
|
|
163
91
|
catch (err) {
|
|
164
92
|
spinner?.stop();
|
|
165
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
166
93
|
const isTimeout = err instanceof Error && err.name === 'AbortError';
|
|
167
|
-
const
|
|
94
|
+
const cause = err instanceof Error && 'cause' in err ? err.cause : null;
|
|
95
|
+
const causeCode = cause?.code ?? '';
|
|
96
|
+
const rootMessage = cause?.message || causeCode || (err instanceof Error ? err.message : String(err));
|
|
97
|
+
const errorSignature = `${rootMessage} ${causeCode}`;
|
|
98
|
+
const isConnectionRefused = errorSignature.includes('ECONNREFUSED');
|
|
99
|
+
const isConnectionReset = errorSignature.includes('ECONNRESET');
|
|
100
|
+
const isNetworkError = errorSignature.includes('EAI_AGAIN') || errorSignature.includes('ENOTFOUND');
|
|
101
|
+
let displayMessage;
|
|
102
|
+
if (isTimeout) {
|
|
103
|
+
displayMessage = `Tool call timed out after ${timeoutMs / 1000} seconds: ${toolName}`;
|
|
104
|
+
}
|
|
105
|
+
else if (isConnectionRefused) {
|
|
106
|
+
displayMessage = `Connection refused at ${endpoint}. Is the MCP server running? Start Unity Editor with the MCP plugin first.`;
|
|
107
|
+
}
|
|
108
|
+
else if (isConnectionReset) {
|
|
109
|
+
displayMessage = `Connection was reset by the server at ${endpoint}. The server may have crashed or restarted.`;
|
|
110
|
+
}
|
|
111
|
+
else if (isNetworkError) {
|
|
112
|
+
displayMessage = `Cannot reach ${endpoint}. Check your network connection and server URL.`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
displayMessage = `${rootMessage}`;
|
|
116
|
+
if (cause && cause.message !== rootMessage) {
|
|
117
|
+
displayMessage += ` (${cause.message})`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
168
120
|
if (options.raw) {
|
|
169
121
|
process.stderr.write(displayMessage + '\n');
|
|
170
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-tool.js","sourceRoot":"","sources":["../../src/commands/run-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"run-tool.js","sourceRoot":"","sources":["../../src/commands/run-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KAClD,WAAW,CAAC,sCAAsC,CAAC;KACnD,QAAQ,CAAC,aAAa,EAAE,iCAAiC,CAAC;KAC1D,QAAQ,CAAC,QAAQ,EAAE,8DAA8D,CAAC;KAClF,MAAM,CAAC,eAAe,EAAE,qDAAqD,CAAC;KAC9E,MAAM,CAAC,aAAa,EAAE,8CAA8C,CAAC;KACrE,MAAM,CAAC,iBAAiB,EAAE,yCAAyC,CAAC;KACpE,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;KACzD,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,CAAC;KAC9D,MAAM,CAAC,OAAO,EAAE,iCAAiC,CAAC;KAClD,MAAM,CAAC,gBAAgB,EAAE,kDAAkD,EAAE,OAAO,CAAC;KACrF,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,cAAkC,EAAE,OAAuB,EAAE,EAAE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