UNPKG

vme-mcp-server

Version:

An intelligent Model Context Protocol (MCP) server that transforms HPE VM Essentials (VME) infrastructure management into natural language conversations. Provision VMs, manage resources, and control your infrastructure through simple English commands with

49 lines (48 loc) 1.72 kB
import { parseVMIntent } from "../lib/intent-recognition.js"; import { generateSessionId, logInteraction } from "../lib/session.js"; export const parseIntentTool = { name: "parse_vm_intent", description: "Parse natural language VM requests into structured parameters with confidence scoring", inputSchema: { type: "object", properties: { naturalLanguageInput: { type: "string", description: "Natural language description of VM provisioning request" } }, required: ["naturalLanguageInput"] } }; export async function handleParseIntent(args) { const startTime = Date.now(); const { naturalLanguageInput } = args; const sessionId = generateSessionId(); const parsedIntent = parseVMIntent(naturalLanguageInput); const parseTime = Date.now() - startTime; // Log interaction for AI training (respects privacy settings) logInteraction({ session_id: sessionId, tool_name: 'parse_vm_intent', user_input: { naturalLanguageInput }, parsed_output: parsedIntent, success_metrics: { operation_success: parsedIntent.action !== 'unknown', confidence_score: parsedIntent.confidence, entities_extracted: Object.keys(parsedIntent.entities).length }, timing: { parse_duration_ms: parseTime, total_duration_ms: parseTime } }); return { content: [ { type: "text", text: JSON.stringify(parsedIntent, null, 2) } ], isError: parsedIntent.action === 'unknown' && parsedIntent.confidence < 0.3 }; }