@akiojin/unity-mcp-server 2.43.0 → 2.43.2
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/package.json
CHANGED
package/src/core/server.js
CHANGED
|
@@ -261,40 +261,41 @@ export async function startServer(options = {}) {
|
|
|
261
261
|
process.on('SIGTERM', stopWatch);
|
|
262
262
|
|
|
263
263
|
// Auto-initialize code index if DB doesn't exist
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
264
|
+
// DISABLED: Investigating Issue #168 - npx timeout with Claude Code
|
|
265
|
+
// (async () => {
|
|
266
|
+
// try {
|
|
267
|
+
// const { CodeIndex } = await import('./codeIndex.js');
|
|
268
|
+
// const index = new CodeIndex(unityConnection);
|
|
269
|
+
// const ready = await index.isReady();
|
|
270
|
+
|
|
271
|
+
// if (!ready) {
|
|
272
|
+
// if (index.disabled) {
|
|
273
|
+
// logger.warning(
|
|
274
|
+
// `[startup] Code index disabled: ${index.disableReason || 'SQLite native binding missing'}. Skipping auto-build.`
|
|
275
|
+
// );
|
|
276
|
+
// return;
|
|
277
|
+
// }
|
|
278
|
+
// logger.info('[startup] Code index DB not ready. Starting auto-build...');
|
|
279
|
+
// const { CodeIndexBuildToolHandler } = await import(
|
|
280
|
+
// '../handlers/script/CodeIndexBuildToolHandler.js'
|
|
281
|
+
// );
|
|
282
|
+
// const builder = new CodeIndexBuildToolHandler(unityConnection);
|
|
283
|
+
// const result = await builder.execute({});
|
|
284
|
+
|
|
285
|
+
// if (result.success) {
|
|
286
|
+
// logger.info(
|
|
287
|
+
// `[startup] Code index auto-build started: jobId=${result.jobId}. Use code_index_status to check progress.`
|
|
288
|
+
// );
|
|
289
|
+
// } else {
|
|
290
|
+
// logger.warning(`[startup] Code index auto-build failed: ${result.message}`);
|
|
291
|
+
// }
|
|
292
|
+
// } else {
|
|
293
|
+
// logger.info('[startup] Code index DB already exists. Skipping auto-build.');
|
|
294
|
+
// }
|
|
295
|
+
// } catch (e) {
|
|
296
|
+
// logger.warning(`[startup] Code index auto-init failed: ${e.message}`);
|
|
297
|
+
// }
|
|
298
|
+
// })();
|
|
298
299
|
|
|
299
300
|
// Handle shutdown
|
|
300
301
|
process.on('SIGINT', async () => {
|
|
@@ -11,10 +11,6 @@ function encodeContentLength(message) {
|
|
|
11
11
|
return header + json;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function encodeNdjson(message) {
|
|
15
|
-
return `${JSON.stringify(message)}\n`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
14
|
function parseJson(text) {
|
|
19
15
|
return JSONRPCMessageSchema.parse(JSON.parse(text));
|
|
20
16
|
}
|
|
@@ -63,8 +59,9 @@ export class HybridStdioServerTransport {
|
|
|
63
59
|
|
|
64
60
|
send(message) {
|
|
65
61
|
return new Promise(resolve => {
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
// Always use Content-Length framing for output (MCP protocol standard)
|
|
63
|
+
// Input remains hybrid (Content-Length or NDJSON) for client compatibility
|
|
64
|
+
const payload = encodeContentLength(message);
|
|
68
65
|
if (this._stdout.write(payload)) {
|
|
69
66
|
resolve();
|
|
70
67
|
} else {
|