Update incus MCP server with enhanced functionality
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
13
src/index.ts
13
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)}`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user