unity-mcp-cli 0.54.0 → 0.55.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 CHANGED
@@ -8,6 +8,21 @@
8
8
 
9
9
  <img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/promo/ai-developer-banner-glitch.gif" alt="AI Game Developer" title="Unity MCP CLI" width="100%">
10
10
 
11
+ <p>
12
+ <a href="https://claude.ai/download"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/claude-64.png" alt="Claude" title="Claude" height="36"></a>&nbsp;&nbsp;
13
+ <a href="https://openai.com/index/introducing-codex/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/codex-64.png" alt="Codex" title="Codex" height="36"></a>&nbsp;&nbsp;
14
+ <a href="https://www.cursor.com/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/cursor-64.png" alt="Cursor" title="Cursor" height="36"></a>&nbsp;&nbsp;
15
+ <a href="https://code.visualstudio.com/docs/copilot/overview"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/github-copilot-64.png" alt="GitHub Copilot" title="GitHub Copilot" height="36"></a>&nbsp;&nbsp;
16
+ <a href="https://gemini.google.com/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/gemini-64.png" alt="Gemini" title="Gemini" height="36"></a>&nbsp;&nbsp;
17
+ <a href="https://antigravity.google/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/antigravity-64.png" alt="Antigravity" title="Antigravity" height="36"></a>&nbsp;&nbsp;
18
+ <a href="https://code.visualstudio.com/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/vs-code-64.png" alt="VS Code" title="VS Code" height="36"></a>&nbsp;&nbsp;
19
+ <a href="https://www.jetbrains.com/rider/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/rider-64.png" alt="Rider" title="Rider" height="36"></a>&nbsp;&nbsp;
20
+ <a href="https://visualstudio.microsoft.com/"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/visual-studio-64.png" alt="Visual Studio" title="Visual Studio" height="36"></a>&nbsp;&nbsp;
21
+ <a href="https://github.com/anthropics/claude-code"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/open-code-64.png" alt="Open Code" title="Open Code" height="36"></a>&nbsp;&nbsp;
22
+ <a href="https://github.com/cline/cline"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/cline-64.png" alt="Cline" title="Cline" height="36"></a>&nbsp;&nbsp;
23
+ <a href="https://github.com/kilocode/kilo-code"><img src="https://github.com/IvanMurzak/Unity-MCP/raw/main/docs/img/mcp-clients/kilo-code-64.png" alt="Kilo Code" title="Kilo Code" height="36"></a>
24
+ </p>
25
+
11
26
  </div>
12
27
 
13
28
  <b>[中文](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.zh-CN.md) | [日本語](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.ja.md) | [Español](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.es.md)</b>
@@ -21,6 +36,7 @@ Cross-platform CLI tool for **[Unity MCP](https://github.com/IvanMurzak/Unity-MC
21
36
  - :white_check_mark: **Install plugin** — add Unity-MCP plugin to `manifest.json` with all required scoped registries
22
37
  - :white_check_mark: **Remove plugin** — remove Unity-MCP plugin from `manifest.json`
23
38
  - :white_check_mark: **Configure** — enable/disable MCP tools, prompts, and resources
39
+ - :white_check_mark: **Run tools** — execute MCP tools directly from the command line
24
40
  - :white_check_mark: **Open & Connect** — launch Unity with optional MCP environment variables for automated server connection
25
41
  - :white_check_mark: **Cross-platform** — Windows, macOS, and Linux
26
42
  - :white_check_mark: **CI-friendly** — auto-detects non-interactive terminals and disables spinners/colors
@@ -52,12 +68,13 @@ unity-mcp-cli install-plugin /path/to/unity/project
52
68
 
53
69
  - [Quick Start](#quick-start)
54
70
  - [Commands](#commands)
71
+ - [`configure`](#configure) — Configure MCP tools, prompts, and resources
55
72
  - [`create-project`](#create-project) — Create a new Unity project
73
+ - [`install-plugin`](#install-plugin) — Install Unity-MCP plugin into a project
56
74
  - [`install-unity`](#install-unity) — Install Unity Editor via Unity Hub
57
75
  - [`open`](#open) — Open a Unity project in the Editor
58
- - [`install-plugin`](#install-plugin) — Install Unity-MCP plugin into a project
59
76
  - [`remove-plugin`](#remove-plugin) — Remove Unity-MCP plugin from a project
60
- - [`configure`](#configure) — Configure MCP tools, prompts, and resources
77
+ - [`run-tool`](#run-tool) — Execute an MCP tool via the HTTP API
61
78
  - [Global Options](#global-options)
62
79
  - [Full Automation Example](#full-automation-example)
63
80
  - [How It Works](#how-it-works)
@@ -66,6 +83,50 @@ unity-mcp-cli install-plugin /path/to/unity/project
66
83
 
67
84
  # Commands
68
85
 
86
+ ## `configure`
87
+
88
+ Configure MCP tools, prompts, and resources in `UserSettings/AI-Game-Developer-Config.json`.
89
+
90
+ ```bash
91
+ npx unity-mcp-cli configure ./MyGame --list
92
+ ```
93
+
94
+ | Option | Required | Description |
95
+ |---|---|---|
96
+ | `[path]` | Yes | Path to the Unity project (positional or `--path`) |
97
+ | `--list` | No | List current configuration and exit |
98
+ | `--enable-tools <names>` | No | Enable specific tools (comma-separated) |
99
+ | `--disable-tools <names>` | No | Disable specific tools (comma-separated) |
100
+ | `--enable-all-tools` | No | Enable all tools |
101
+ | `--disable-all-tools` | No | Disable all tools |
102
+ | `--enable-prompts <names>` | No | Enable specific prompts (comma-separated) |
103
+ | `--disable-prompts <names>` | No | Disable specific prompts (comma-separated) |
104
+ | `--enable-all-prompts` | No | Enable all prompts |
105
+ | `--disable-all-prompts` | No | Disable all prompts |
106
+ | `--enable-resources <names>` | No | Enable specific resources (comma-separated) |
107
+ | `--disable-resources <names>` | No | Disable specific resources (comma-separated) |
108
+ | `--enable-all-resources` | No | Enable all resources |
109
+ | `--disable-all-resources` | No | Disable all resources |
110
+
111
+ **Example — enable specific tools and disable all prompts:**
112
+
113
+ ```bash
114
+ npx unity-mcp-cli configure ./MyGame \
115
+ --enable-tools gameobject-create,gameobject-find \
116
+ --disable-all-prompts
117
+ ```
118
+
119
+ **Example — enable everything:**
120
+
121
+ ```bash
122
+ npx unity-mcp-cli configure ./MyGame \
123
+ --enable-all-tools \
124
+ --enable-all-prompts \
125
+ --enable-all-resources
126
+ ```
127
+
128
+ ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
129
+
69
130
  ## `create-project`
70
131
 
71
132
  Create a new Unity project using the Unity Editor.
@@ -87,6 +148,34 @@ npx unity-mcp-cli create-project ./MyGame --unity 2022.3.62f1
87
148
 
88
149
  ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
89
150
 
151
+ ## `install-plugin`
152
+
153
+ Install the Unity-MCP plugin into a Unity project's `Packages/manifest.json`.
154
+
155
+ ```bash
156
+ npx unity-mcp-cli install-plugin ./MyGame
157
+ ```
158
+
159
+ | Option | Required | Description |
160
+ |---|---|---|
161
+ | `[path]` | Yes | Path to the Unity project (positional or `--path`) |
162
+ | `--plugin-version <version>` | No | Plugin version to install (defaults to latest from [OpenUPM](https://openupm.com/packages/com.ivanmurzak.unity.mcp/)) |
163
+
164
+ This command:
165
+ 1. Adds the **OpenUPM scoped registry** with all required scopes
166
+ 2. Adds `com.ivanmurzak.unity.mcp` to `dependencies`
167
+ 3. **Never downgrades** — if a higher version is already installed, it is preserved
168
+
169
+ **Example — install a specific plugin version:**
170
+
171
+ ```bash
172
+ npx unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6
173
+ ```
174
+
175
+ > After running this command, open the project in Unity Editor to complete the package installation.
176
+
177
+ ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
178
+
90
179
  ## `install-unity`
91
180
 
92
181
  Install a Unity Editor version via Unity Hub CLI.
@@ -159,31 +248,48 @@ npx unity-mcp-cli open ./MyGame \
159
248
 
160
249
  ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
161
250
 
162
- ## `install-plugin`
251
+ ## `run-tool`
163
252
 
164
- Install the Unity-MCP plugin into a Unity project's `Packages/manifest.json`.
253
+ 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).
165
254
 
166
255
  ```bash
167
- npx unity-mcp-cli install-plugin ./MyGame
256
+ npx unity-mcp-cli run-tool gameobject-create ./MyGame --input '{"name":"Cube"}'
168
257
  ```
169
258
 
170
259
  | Option | Required | Description |
171
260
  |---|---|---|
172
- | `[path]` | Yes | Path to the Unity project (positional or `--path`) |
173
- | `--plugin-version <version>` | No | Plugin version to install (defaults to latest from [OpenUPM](https://openupm.com/packages/com.ivanmurzak.unity.mcp/)) |
261
+ | `<tool-name>` | Yes | Name of the MCP tool to execute |
262
+ | `[path]` | No | Unity project path (positional or `--path`) — used to read config and detect port |
263
+ | `--url <url>` | No | Direct server URL override (bypasses config) |
264
+ | `--token <token>` | No | Bearer token override (bypasses config) |
265
+ | `--input <json>` | No | JSON string of tool arguments (defaults to `{}`) |
266
+ | `--input-file <file>` | No | Read JSON arguments from a file |
267
+ | `--raw` | No | Output raw JSON (no formatting, no spinner) |
174
268
 
175
- This command:
176
- 1. Adds the **OpenUPM scoped registry** with all required scopes
177
- 2. Adds `com.ivanmurzak.unity.mcp` to `dependencies`
178
- 3. **Never downgrades** if a higher version is already installed, it is preserved
269
+ **URL resolution priority:**
270
+ 1. `--url` use directly
271
+ 2. Config file → `host` (Custom mode) or `cloudServerUrl` (Cloud mode)
272
+ 3. Deterministic port from project path
179
273
 
180
- **Example install a specific plugin version:**
274
+ **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.
275
+
276
+ **Example — call a tool (URL and auth from config):**
181
277
 
182
278
  ```bash
183
- npx unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6
279
+ npx unity-mcp-cli run-tool gameobject-find ./MyGame --input '{"query":"Player"}'
184
280
  ```
185
281
 
186
- > After running this command, open the project in Unity Editor to complete the package installation.
282
+ **Example explicit URL override:**
283
+
284
+ ```bash
285
+ npx unity-mcp-cli run-tool scene-save --url http://localhost:8080
286
+ ```
287
+
288
+ **Example — pipe raw JSON output:**
289
+
290
+ ```bash
291
+ npx unity-mcp-cli run-tool assets-list ./MyGame --raw | jq '.results'
292
+ ```
187
293
 
188
294
  ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
189
295
 
@@ -208,50 +314,6 @@ This command:
208
314
 
209
315
  ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
210
316
 
211
- ## `configure`
212
-
213
- Configure MCP tools, prompts, and resources in `UserSettings/AI-Game-Developer-Config.json`.
214
-
215
- ```bash
216
- npx unity-mcp-cli configure ./MyGame --list
217
- ```
218
-
219
- | Option | Required | Description |
220
- |---|---|---|
221
- | `[path]` | Yes | Path to the Unity project (positional or `--path`) |
222
- | `--list` | No | List current configuration and exit |
223
- | `--enable-tools <names>` | No | Enable specific tools (comma-separated) |
224
- | `--disable-tools <names>` | No | Disable specific tools (comma-separated) |
225
- | `--enable-all-tools` | No | Enable all tools |
226
- | `--disable-all-tools` | No | Disable all tools |
227
- | `--enable-prompts <names>` | No | Enable specific prompts (comma-separated) |
228
- | `--disable-prompts <names>` | No | Disable specific prompts (comma-separated) |
229
- | `--enable-all-prompts` | No | Enable all prompts |
230
- | `--disable-all-prompts` | No | Disable all prompts |
231
- | `--enable-resources <names>` | No | Enable specific resources (comma-separated) |
232
- | `--disable-resources <names>` | No | Disable specific resources (comma-separated) |
233
- | `--enable-all-resources` | No | Enable all resources |
234
- | `--disable-all-resources` | No | Disable all resources |
235
-
236
- **Example — enable specific tools and disable all prompts:**
237
-
238
- ```bash
239
- npx unity-mcp-cli configure ./MyGame \
240
- --enable-tools gameobject-create,gameobject-find \
241
- --disable-all-prompts
242
- ```
243
-
244
- **Example — enable everything:**
245
-
246
- ```bash
247
- npx unity-mcp-cli configure ./MyGame \
248
- --enable-all-tools \
249
- --enable-all-prompts \
250
- --enable-all-resources
251
- ```
252
-
253
- ![AI Game Developer — Unity MCP](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/promo/hazzard-divider.svg?raw=true)
254
-
255
317
  ## Global Options
256
318
 
257
319
  These options are available on all commands:
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const runToolCommand: Command;
@@ -0,0 +1,180 @@
1
+ import { Command } from 'commander';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ import * as ui from '../utils/ui.js';
5
+ import { verbose } from '../utils/ui.js';
6
+ import { generatePortFromDirectory } from '../utils/port.js';
7
+ import { readConfig, resolveConnectionFromConfig } from '../utils/config.js';
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: cloudServerUrl
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
+ }
84
+ export const runToolCommand = new Command('run-tool')
85
+ .description('Execute an MCP tool via the HTTP API')
86
+ .argument('<tool-name>', 'Name of the MCP tool to execute')
87
+ .argument('[path]', 'Unity project path (used for config and auto port detection)')
88
+ .option('--path <path>', 'Unity project path (config and auto port detection)')
89
+ .option('--url <url>', 'Direct server URL override (bypasses config)')
90
+ .option('--token <token>', 'Bearer token override (bypasses config)')
91
+ .option('--input <json>', 'JSON string of tool arguments')
92
+ .option('--input-file <file>', 'Read JSON arguments from file')
93
+ .option('--raw', 'Output raw JSON (no formatting)')
94
+ .action(async (toolName, positionalPath, options) => {
95
+ const projectPath = resolveProjectPath(positionalPath, options);
96
+ const { url: baseUrl, token } = resolveConnection(projectPath, options);
97
+ const body = parseInput(options);
98
+ const endpoint = `${baseUrl}/api/tools/${encodeURIComponent(toolName)}`;
99
+ verbose(`Tool: ${toolName}`);
100
+ verbose(`Endpoint: ${endpoint}`);
101
+ verbose(`Body: ${body}`);
102
+ const headers = {
103
+ 'Content-Type': 'application/json',
104
+ };
105
+ if (token) {
106
+ headers['Authorization'] = `Bearer ${token}`;
107
+ verbose(`Authorization header set (source: ${options.token ? '--token flag' : 'config'})`);
108
+ }
109
+ const authSource = options.token ? '--token flag' : 'config';
110
+ if (!options.raw) {
111
+ ui.heading('Run Tool');
112
+ ui.label('Tool', toolName);
113
+ ui.label('URL', endpoint);
114
+ if (token) {
115
+ ui.label('Auth', `from ${authSource}`);
116
+ }
117
+ ui.divider();
118
+ }
119
+ const spinner = options.raw ? null : ui.startSpinner(`Calling ${toolName}...`);
120
+ const controller = new AbortController();
121
+ const fetchTimeout = setTimeout(() => controller.abort(), 30000);
122
+ try {
123
+ const response = await fetch(endpoint, {
124
+ method: 'POST',
125
+ headers,
126
+ body,
127
+ signal: controller.signal,
128
+ });
129
+ const responseText = await response.text();
130
+ let responseData;
131
+ try {
132
+ responseData = JSON.parse(responseText);
133
+ }
134
+ catch {
135
+ responseData = responseText;
136
+ }
137
+ if (!response.ok) {
138
+ spinner?.stop();
139
+ if (options.raw) {
140
+ process.stdout.write(responseText);
141
+ }
142
+ else {
143
+ ui.error(`HTTP ${response.status}: ${response.statusText}`);
144
+ if (responseData) {
145
+ ui.info(typeof responseData === 'string'
146
+ ? responseData
147
+ : JSON.stringify(responseData, null, 2));
148
+ }
149
+ }
150
+ process.exit(1);
151
+ }
152
+ spinner?.success(`${toolName} completed`);
153
+ if (options.raw) {
154
+ process.stdout.write(responseText);
155
+ }
156
+ else {
157
+ ui.success('Response:');
158
+ console.log(typeof responseData === 'string'
159
+ ? responseData
160
+ : JSON.stringify(responseData, null, 2));
161
+ }
162
+ }
163
+ catch (err) {
164
+ spinner?.stop();
165
+ const message = err instanceof Error ? err.message : String(err);
166
+ const isTimeout = err instanceof Error && err.name === 'AbortError';
167
+ const displayMessage = isTimeout ? `Tool call timed out after 30 seconds: ${toolName}` : message;
168
+ if (options.raw) {
169
+ process.stderr.write(displayMessage + '\n');
170
+ }
171
+ else {
172
+ ui.error(`Failed to call tool: ${displayMessage}`);
173
+ }
174
+ process.exit(1);
175
+ }
176
+ finally {
177
+ clearTimeout(fetchTimeout);
178
+ }
179
+ });
180
+ //# sourceMappingURL=run-tool.js.map
@@ -0,0 +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,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAW7E;;GAEG;AACH,SAAS,kBAAkB,CAAC,cAAkC,EAAE,OAAuB;IACrF,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/E,IAAI,CAAC,cAA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AAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,SAAS,GAAG,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC;QACpE,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,yCAAyC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QACjG,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,wBAAwB,cAAc,EAAE,CAAC,CAAC;QACrD,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"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import { openCommand } from './commands/open.js';
6
6
  import { installPluginCommand } from './commands/install-plugin.js';
7
7
  import { configureCommand } from './commands/configure.js';
8
8
  import { removePluginCommand } from './commands/remove-plugin.js';
9
+ import { runToolCommand } from './commands/run-tool.js';
9
10
  import { configureStyledHelp, error as uiError, setVerbose } from './utils/ui.js';
10
11
  const require = createRequire(import.meta.url);
11
12
  const pkg = require('../package.json');
@@ -23,6 +24,7 @@ const subcommands = [
23
24
  installUnityCommand,
24
25
  openCommand,
25
26
  removePluginCommand,
27
+ runToolCommand,
26
28
  ];
27
29
  for (const cmd of subcommands) {
28
30
  cmd.option('-v, --verbose', 'Enable verbose diagnostic output');
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,E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C,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -11,7 +11,7 @@ export interface UnityConnectionConfig {
11
11
  keepServerRunning?: boolean;
12
12
  transportMethod?: string;
13
13
  authOption?: string;
14
- connectionMode?: string;
14
+ connectionMode?: string | number;
15
15
  cloudServerUrl?: string;
16
16
  cloudToken?: string;
17
17
  tools?: McpFeature[];
@@ -49,3 +49,19 @@ export declare function updateFeatures(config: UnityConnectionConfig, featureTyp
49
49
  enableAll?: boolean;
50
50
  disableAll?: boolean;
51
51
  }): void;
52
+ /**
53
+ * Determine whether the config is in Cloud mode.
54
+ * Handles both string ("Cloud") and legacy integer (1) representations
55
+ * of the ConnectionMode enum.
56
+ */
57
+ export declare function isCloudMode(config: UnityConnectionConfig): boolean;
58
+ /**
59
+ * Resolve the server URL and auth token from a project config based on connectionMode.
60
+ * - Custom mode (string "Custom" or integer 0): uses `host` and `token`
61
+ * - Cloud mode (string "Cloud" or integer 1): uses `cloudServerUrl` and `cloudToken`
62
+ * Returns undefined values when the config or relevant fields are not set.
63
+ */
64
+ export declare function resolveConnectionFromConfig(config: UnityConnectionConfig): {
65
+ url: string | undefined;
66
+ token: string | undefined;
67
+ };
@@ -115,4 +115,30 @@ export function updateFeatures(config, featureType, options) {
115
115
  }
116
116
  config[featureType] = features;
117
117
  }
118
+ /**
119
+ * Determine whether the config is in Cloud mode.
120
+ * Handles both string ("Cloud") and legacy integer (1) representations
121
+ * of the ConnectionMode enum.
122
+ */
123
+ export function isCloudMode(config) {
124
+ const mode = config.connectionMode;
125
+ return mode === 'Cloud' || mode === 1;
126
+ }
127
+ /**
128
+ * Resolve the server URL and auth token from a project config based on connectionMode.
129
+ * - Custom mode (string "Custom" or integer 0): uses `host` and `token`
130
+ * - Cloud mode (string "Cloud" or integer 1): uses `cloudServerUrl` and `cloudToken`
131
+ * Returns undefined values when the config or relevant fields are not set.
132
+ */
133
+ export function resolveConnectionFromConfig(config) {
134
+ const cloud = isCloudMode(config);
135
+ const rawCloudUrl = config.cloudServerUrl?.replace(/\/$/, '');
136
+ const cloudUrl = rawCloudUrl
137
+ ? rawCloudUrl.endsWith('/mcp') ? rawCloudUrl : rawCloudUrl + '/mcp'
138
+ : undefined;
139
+ return {
140
+ url: cloud ? cloudUrl : config.host,
141
+ token: cloud ? config.cloudToken : config.token,
142
+ };
143
+ }
118
144
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,oBAAoB,GAAG,4CAA4C,CAAC;AAyB1E,SAAS,aAAa,CAAC,WAAmB;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,MAAM,IAAI,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;IACpD,OAAO;QACL,IAAI,EAAE,oBAAoB,IAAI,EAAE;QAChC,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,KAAK;QAChB,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,gBAAgB;QACjC,UAAU,EAAE,MAAM;QAClB,cAAc,EAAE,QAAQ;QACxB,cAAc,EAAE,qBAAqB;QACrC,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,WAAmB;IAC5C,MAAM,UAAU,GAAG,aAAa,CAAC,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