Skip to content

Commit 8eed02e

Browse files
chore(release): merge v2.40.6 to main
Automated merge of release branch for version 2.40.6 🤖 Generated with GitHub Actions
2 parents b44e138 + f20c07f commit 8eed02e

File tree

6 files changed

+28
-5
lines changed

6 files changed

+28
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2.40.6](https://github.com/akiojin/unity-mcp-server/compare/v2.40.5...v2.40.6) (2025-11-19)
2+
3+
4+
### Bug Fixes
5+
6+
* skip native rebuild by default to avoid first-run timeout ([60eb8fa](https://github.com/akiojin/unity-mcp-server/commit/60eb8fa1c7f68f79e674614f33d307738c3a8725))
7+
18
## [2.40.5](https://github.com/akiojin/unity-mcp-server/compare/v2.40.4...v2.40.5) (2025-11-19)
29

310

README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ sequenceDiagram
195195

196196
ネイティブ拡張(`better-sqlite3` など)は **MCPサーバーを動かすOS上で依存関係をインストールしたとき** にのみ正しく構築されます。以下を必ず実施してください。
197197

198-
> 初回 npx 実行の注意: 対応する prebuilt が無い環境では、最初の `npx @akiojin/unity-mcp-server@latest` で `better-sqlite3` のビルドに 60〜90 秒かかる場合があります。MCP クライアントの既定タイムアウト(30 秒)にかからないよう、事前に `npx -y @akiojin/unity-mcp-server@latest --help` でキャッシュを温めるか、`MCP_TIMEOUT=90000` などタイムアウトを延長して起動してください。2回目以降はキャッシュが効くため高速に起動します
198+
> 初回 npx 実行の注意: 対応する prebuilt が無い環境では、最初の `npx @akiojin/unity-mcp-server@latest` で `better-sqlite3` のビルドに 60〜90 秒かかる場合があります。MCP クライアントの既定タイムアウト(30 秒)にかからないよう、事前に `npx -y @akiojin/unity-mcp-server@latest --help` でキャッシュを温めるか、`MCP_TIMEOUT=90000` などタイムアウトを延長して起動してください。初回ビルド待ちを避けるため、初期設定ではネイティブ再ビルドをスキップしています。ネイティブを強制したい場合は `UNITY_MCP_SKIP_NATIVE_BUILD=0` または `UNITY_MCP_FORCE_NATIVE=1` を指定してインストールしてください
199199

200200
- **基本ルール**: `.mcp.json` で `"command": "node"`(例: `node bin/unity-mcp-server serve`)を使う場合は、MCPサーバーを動かすマシン/コンテナ内で本パッケージが展開されているディレクトリで `npm ci` を実行してから MCP クライアントを起動します。
201201
- **`npx` 実行**: README の例(`npx @akiojin/unity-mcp-server@latest`)は起動時に依存をダウンロードします。サポート対象の Node.js(18.x / 20.x / 22.x)では追加作業なしで利用できます。Node.js 23 以上はサポート外であり、サーバー起動時に拒否されます。

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Installation
209209

210210
You must install the MCP server's dependencies **on the same OS where the server runs** so that native modules such as `better-sqlite3` are built for the correct platform.
211211

212-
> First-time install note (npx): On environments without a matching prebuilt `better-sqlite3`, the very first `npx @akiojin/unity-mcp-server@latest` may spend 60–90s compiling the native addon. To avoid MCP client timeouts (default 30s), either warm the cache once with `npx -y @akiojin/unity-mcp-server@latest --help` or start your client with a higher timeout (e.g. `MCP_TIMEOUT=90000`). Subsequent runs use the warmed cache and start quickly.
212+
> First-time install note (npx): On environments without a matching prebuilt `better-sqlite3`, the very first `npx @akiojin/unity-mcp-server@latest` can spend 60–90s compiling the native addon. To avoid MCP client timeouts (default 30s), either warm the cache once with `npx -y @akiojin/unity-mcp-server@latest --help` or start your client with a higher timeout (e.g. `MCP_TIMEOUT=90000`). By default we now **skip native rebuild** to keep first-run fast; to force native build set `UNITY_MCP_SKIP_NATIVE_BUILD=0` or `UNITY_MCP_FORCE_NATIVE=1` before install.
213213

214214
- **General rule**: if your `.mcp.json` uses `"command": "node"` (e.g. `node bin/unity-mcp-server serve`), run `npm install` (or `npm ci`) inside the directory where the package lives _on that machine/container_ before launching the MCP client.
215215
- **`npx` launch**: the README example above (`npx @akiojin/unity-mcp-server@latest`) downloads dependencies at runtime and works on the supported Node.js versions (18.x / 20.x / 22.x). Node.js 23+ is not supported; the server exits early with a version error.

UnityMCPServer/Packages/unity-mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.akiojin.unity-mcp-server",
33
"displayName": "Unity MCP Server",
4-
"version": "2.40.5",
4+
"version": "2.40.6",
55
"unity": "6000.0",
66
"description": "Unity MCP Server bridge and tooling for AI-assisted development (screenshots, video capture, scene analysis, input automation).",
77
"keywords": [

mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@akiojin/unity-mcp-server",
3-
"version": "2.40.5",
3+
"version": "2.40.6",
44
"description": "MCP server and Unity Editor bridge — enables AI assistants to control Unity for AI-assisted workflows",
55
"type": "module",
66
"main": "src/core/server.js",

mcp-server/scripts/ensure-better-sqlite3.mjs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,30 @@ const bindingPath = resolve(
1111
'Release',
1212
'better_sqlite3.node'
1313
);
14+
// Default: skip native rebuild to avoid first-time npx timeouts; set UNITY_MCP_SKIP_NATIVE_BUILD=0 to allow.
15+
const skipNative = process.env.UNITY_MCP_SKIP_NATIVE_BUILD !== '0';
16+
const forceNative = process.env.UNITY_MCP_FORCE_NATIVE === '1';
1417

1518
function main() {
1619
if (process.env.SKIP_SQLITE_REBUILD) {
1720
console.log('[postinstall] SKIP_SQLITE_REBUILD set, skipping better-sqlite3 check');
1821
return;
1922
}
2023

21-
if (existsSync(bindingPath)) {
24+
if (skipNative && !forceNative) {
25+
console.log(
26+
'[postinstall] UNITY_MCP_SKIP_NATIVE_BUILD=1 -> skipping better-sqlite3 rebuild (will rely on fallback/sql.js if missing)'
27+
);
28+
return;
29+
}
30+
31+
if (forceNative) {
32+
console.log(
33+
'[postinstall] UNITY_MCP_FORCE_NATIVE=1 -> forcing better-sqlite3 rebuild even if binding exists'
34+
);
35+
}
36+
37+
if (!forceNative && existsSync(bindingPath)) {
2238
return;
2339
}
2440

0 commit comments

Comments
 (0)