diff --git a/package.json b/package.json index 30dfc6a..313b033 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ironclads/incus-mcp", - "version": "0.1.4", + "version": "0.1.5", "description": "MCP server for Incus container management", "main": "build/index.js", "type": "module", diff --git a/src/index.ts b/src/index.ts index a6af6a1..2bac497 100644 --- a/src/index.ts +++ b/src/index.ts @@ -132,11 +132,22 @@ class IncusServer { const output = await execIncusCommand(command); const instances = JSON.parse(output); + // 간단한 요약 형태로 변환하여 토큰 사용량 최적화 + const summary = instances.map((instance: any) => ({ + name: instance.name, + status: instance.status, + type: instance.type, + os: instance.config?.['image.os'] || 'Unknown', + ip: instance.state?.network?.eth0?.addresses?.find((addr: any) => addr.family === 'inet')?.address || 'No IP', + memory_usage: instance.state?.memory?.usage ? Math.round(instance.state.memory.usage / 1024 / 1024) + 'MB' : 'N/A', + processes: instance.state?.processes || 0 + })); + return { content: [ { type: 'text', - text: `Found ${instances.length} instances:\n${JSON.stringify(instances, null, 2)}`, + text: `Found ${instances.length} instances:\n${JSON.stringify(summary, null, 2)}`, }, ], };