From 7c4343362bc5fb28305c2d2c90f7d0c03a29a0d7 Mon Sep 17 00:00:00 2001 From: kappa Date: Sun, 10 Aug 2025 20:53:25 +0900 Subject: [PATCH] Update incus MCP server with enhanced functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- package.json | 2 +- src/index.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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)}`, }, ], };