@akiojin/unity-mcp-server 2.41.3 → 2.41.4

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
@@ -332,6 +332,30 @@ npm uninstall -g @akiojin/unity-mcp-server
332
332
  npm install -g @akiojin/unity-mcp-server
333
333
  ```
334
334
 
335
+ ### Native Module (better-sqlite3) Issues
336
+
337
+ If you encounter errors related to `better-sqlite3` during installation or startup:
338
+
339
+ **Symptom**: Installation fails with `node-gyp` errors, or startup shows "Could not locate the bindings file."
340
+
341
+ **Cause**: The package includes prebuilt native binaries for supported platforms (Linux/macOS/Windows × x64/arm64 × Node 18/20/22). If your platform isn't supported or the prebuilt fails to load, the system falls back to WASM.
342
+
343
+ **Solution 1 - Use WASM fallback (recommended for unsupported platforms)**:
344
+
345
+ ```bash
346
+ # Skip native build and use sql.js WASM fallback
347
+ UNITY_MCP_SKIP_NATIVE_BUILD=1 npm install @akiojin/unity-mcp-server
348
+ ```
349
+
350
+ **Solution 2 - Force native rebuild**:
351
+
352
+ ```bash
353
+ # Force rebuild from source (requires build tools)
354
+ UNITY_MCP_FORCE_NATIVE=1 npm install @akiojin/unity-mcp-server
355
+ ```
356
+
357
+ **Note**: WASM fallback is fully functional but may have slightly slower performance for large codebases. Code index features work normally in either mode.
358
+
335
359
  ### MCP Client Shows "Capabilities: none"
336
360
 
337
361
  If your MCP client (Claude Code, Cursor, etc.) shows "Capabilities: none" despite successful connection:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akiojin/unity-mcp-server",
3
- "version": "2.41.3",
3
+ "version": "2.41.4",
4
4
  "description": "MCP server and Unity Editor bridge — enables AI assistants to control Unity for AI-assisted workflows",
5
5
  "type": "module",
6
6
  "main": "src/core/server.js",
@@ -1,18 +1,17 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
- import { fileURLToPath } from 'url';
4
3
  import { createRequire } from 'module';
5
4
  import initSqlJs from 'sql.js';
6
5
 
7
6
  // Create a lightweight better-sqlite3 compatible surface using sql.js (WASM)
8
7
  export async function createSqliteFallback(dbPath) {
8
+ // Use Node's module resolution to find sql.js regardless of package manager (npm, pnpm, yarn)
9
+ // require.resolve('sql.js') returns the main entry point (dist/sql-wasm.js)
10
+ // so we just need sql-wasm.wasm in the same directory
9
11
  const require = createRequire(import.meta.url);
10
- const moduleDir = path.dirname(fileURLToPath(import.meta.url));
11
- const pkgRoot = path.resolve(moduleDir, '..', '..');
12
- const wasmPath = require.resolve('sql.js/dist/sql-wasm.wasm', {
13
- // Resolve from package-local node_modules first, then workspace root
14
- paths: [path.join(pkgRoot, 'node_modules'), path.join(pkgRoot, '..', 'node_modules')]
15
- });
12
+ const sqlJsPath = require.resolve('sql.js');
13
+ const sqlJsDir = path.dirname(sqlJsPath);
14
+ const wasmPath = path.resolve(sqlJsDir, 'sql-wasm.wasm');
16
15
  const SQL = await initSqlJs({ locateFile: () => wasmPath });
17
16
 
18
17
  const loadDb = () => {