vme-mcp-server 0.1.10 → 0.1.13
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/README.md +38 -8
- package/dist/README.md +69 -13
- package/dist/lib/api-utils.js +41 -32
- package/dist/lib/capability-cache.js +4 -8
- package/dist/lib/capability-discovery.js +12 -16
- package/dist/lib/intent-recognition.js +3 -7
- package/dist/lib/name-resolver.js +4 -8
- package/dist/lib/session.js +9 -14
- package/dist/lib/vm-parsing.js +2 -7
- package/dist/server.js +83 -33
- package/dist/server_old.js +18 -23
- package/dist/tools/check-capability.js +4 -8
- package/dist/tools/create-vm.js +24 -28
- package/dist/tools/discover-capabilities.js +4 -8
- package/dist/tools/export-training-data.js +8 -12
- package/dist/tools/get-cache-status.js +5 -9
- package/dist/tools/get-resources.js +4 -8
- package/dist/tools/index.js +35 -56
- package/dist/tools/parse-intent.js +7 -11
- package/dist/tools/provide-feedback.js +5 -9
- package/dist/tools/query-resources.js +4 -8
- package/dist/types/interfaces.js +1 -2
- package/package.json +3 -3
package/dist/tools/index.js
CHANGED
@@ -1,68 +1,47 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
const create_vm_js_1 = require("./create-vm.js");
|
6
|
-
const export_training_data_js_1 = require("./export-training-data.js");
|
7
|
-
const provide_feedback_js_1 = require("./provide-feedback.js");
|
1
|
+
import { parseIntentTool, handleParseIntent } from "./parse-intent.js";
|
2
|
+
import { createVMTool, handleCreateVM } from "./create-vm.js";
|
3
|
+
import { exportTrainingDataTool, handleExportTrainingData } from "./export-training-data.js";
|
4
|
+
import { provideFeedbackTool, handleProvideFeedback } from "./provide-feedback.js";
|
8
5
|
// Sprint 2: Capability Discovery Tools
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
import { discoverCapabilitiesTool, handleDiscoverCapabilities } from "./discover-capabilities.js";
|
7
|
+
import { checkCapabilityTool, handleCheckCapability } from "./check-capability.js";
|
8
|
+
import { getCacheStatusTool, handleGetCacheStatus } from "./get-cache-status.js";
|
9
|
+
import { queryResourcesTool, handleQueryResources } from "./query-resources.js";
|
13
10
|
// Re-export for external use
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
var export_training_data_js_2 = require("./export-training-data.js");
|
24
|
-
Object.defineProperty(exports, "exportTrainingDataTool", { enumerable: true, get: function () { return export_training_data_js_2.exportTrainingDataTool; } });
|
25
|
-
Object.defineProperty(exports, "handleExportTrainingData", { enumerable: true, get: function () { return export_training_data_js_2.handleExportTrainingData; } });
|
26
|
-
var provide_feedback_js_2 = require("./provide-feedback.js");
|
27
|
-
Object.defineProperty(exports, "provideFeedbackTool", { enumerable: true, get: function () { return provide_feedback_js_2.provideFeedbackTool; } });
|
28
|
-
Object.defineProperty(exports, "handleProvideFeedback", { enumerable: true, get: function () { return provide_feedback_js_2.handleProvideFeedback; } });
|
29
|
-
var discover_capabilities_js_2 = require("./discover-capabilities.js");
|
30
|
-
Object.defineProperty(exports, "discoverCapabilitiesTool", { enumerable: true, get: function () { return discover_capabilities_js_2.discoverCapabilitiesTool; } });
|
31
|
-
Object.defineProperty(exports, "handleDiscoverCapabilities", { enumerable: true, get: function () { return discover_capabilities_js_2.handleDiscoverCapabilities; } });
|
32
|
-
var check_capability_js_2 = require("./check-capability.js");
|
33
|
-
Object.defineProperty(exports, "checkCapabilityTool", { enumerable: true, get: function () { return check_capability_js_2.checkCapabilityTool; } });
|
34
|
-
Object.defineProperty(exports, "handleCheckCapability", { enumerable: true, get: function () { return check_capability_js_2.handleCheckCapability; } });
|
35
|
-
var get_cache_status_js_2 = require("./get-cache-status.js");
|
36
|
-
Object.defineProperty(exports, "getCacheStatusTool", { enumerable: true, get: function () { return get_cache_status_js_2.getCacheStatusTool; } });
|
37
|
-
Object.defineProperty(exports, "handleGetCacheStatus", { enumerable: true, get: function () { return get_cache_status_js_2.handleGetCacheStatus; } });
|
38
|
-
var query_resources_js_2 = require("./query-resources.js");
|
39
|
-
Object.defineProperty(exports, "queryResourcesTool", { enumerable: true, get: function () { return query_resources_js_2.queryResourcesTool; } });
|
40
|
-
Object.defineProperty(exports, "handleQueryResources", { enumerable: true, get: function () { return query_resources_js_2.handleQueryResources; } });
|
11
|
+
export { getResourcesTool, handleGetResources } from "./get-resources.js";
|
12
|
+
export { parseIntentTool, handleParseIntent } from "./parse-intent.js";
|
13
|
+
export { createVMTool, handleCreateVM } from "./create-vm.js";
|
14
|
+
export { exportTrainingDataTool, handleExportTrainingData } from "./export-training-data.js";
|
15
|
+
export { provideFeedbackTool, handleProvideFeedback } from "./provide-feedback.js";
|
16
|
+
export { discoverCapabilitiesTool, handleDiscoverCapabilities } from "./discover-capabilities.js";
|
17
|
+
export { checkCapabilityTool, handleCheckCapability } from "./check-capability.js";
|
18
|
+
export { getCacheStatusTool, handleGetCacheStatus } from "./get-cache-status.js";
|
19
|
+
export { queryResourcesTool, handleQueryResources } from "./query-resources.js";
|
41
20
|
// Collect all tool definitions
|
42
|
-
|
21
|
+
export const allTools = [
|
43
22
|
// Sprint 1.5 tools
|
44
23
|
// getResourcesTool, // DISABLED - caused 37K+ token responses, replaced by Sprint 2 capability discovery
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
24
|
+
parseIntentTool,
|
25
|
+
createVMTool,
|
26
|
+
exportTrainingDataTool,
|
27
|
+
provideFeedbackTool,
|
49
28
|
// Sprint 2 capability discovery tools
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
29
|
+
discoverCapabilitiesTool,
|
30
|
+
checkCapabilityTool,
|
31
|
+
getCacheStatusTool,
|
32
|
+
queryResourcesTool
|
54
33
|
];
|
55
34
|
// Export tool handlers map for easy lookup
|
56
|
-
|
35
|
+
export const toolHandlers = {
|
57
36
|
// Sprint 1.5 handlers
|
58
37
|
// get_resources: handleGetResources, // DISABLED - caused 37K+ token responses
|
59
|
-
parse_vm_intent:
|
60
|
-
create_vm:
|
61
|
-
export_training_data:
|
62
|
-
provide_feedback:
|
38
|
+
parse_vm_intent: handleParseIntent,
|
39
|
+
create_vm: handleCreateVM,
|
40
|
+
export_training_data: handleExportTrainingData,
|
41
|
+
provide_feedback: handleProvideFeedback,
|
63
42
|
// Sprint 2 capability discovery handlers
|
64
|
-
discover_capabilities:
|
65
|
-
check_capability:
|
66
|
-
get_cache_status:
|
67
|
-
query_resources:
|
43
|
+
discover_capabilities: handleDiscoverCapabilities,
|
44
|
+
check_capability: handleCheckCapability,
|
45
|
+
get_cache_status: handleGetCacheStatus,
|
46
|
+
query_resources: handleQueryResources
|
68
47
|
};
|
@@ -1,9 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
const intent_recognition_js_1 = require("../lib/intent-recognition.js");
|
5
|
-
const session_js_1 = require("../lib/session.js");
|
6
|
-
exports.parseIntentTool = {
|
1
|
+
import { parseVMIntent } from "../lib/intent-recognition.js";
|
2
|
+
import { generateSessionId, logInteraction } from "../lib/session.js";
|
3
|
+
export const parseIntentTool = {
|
7
4
|
name: "parse_vm_intent",
|
8
5
|
description: "Parse natural language VM requests into structured parameters with confidence scoring",
|
9
6
|
inputSchema: {
|
@@ -17,14 +14,14 @@ exports.parseIntentTool = {
|
|
17
14
|
required: ["naturalLanguageInput"]
|
18
15
|
}
|
19
16
|
};
|
20
|
-
async function handleParseIntent(args) {
|
17
|
+
export async function handleParseIntent(args) {
|
21
18
|
const startTime = Date.now();
|
22
19
|
const { naturalLanguageInput } = args;
|
23
|
-
const sessionId =
|
24
|
-
const parsedIntent =
|
20
|
+
const sessionId = generateSessionId();
|
21
|
+
const parsedIntent = parseVMIntent(naturalLanguageInput);
|
25
22
|
const parseTime = Date.now() - startTime;
|
26
23
|
// Log interaction for AI training (respects privacy settings)
|
27
|
-
|
24
|
+
logInteraction({
|
28
25
|
session_id: sessionId,
|
29
26
|
tool_name: 'parse_vm_intent',
|
30
27
|
user_input: { naturalLanguageInput },
|
@@ -49,4 +46,3 @@ async function handleParseIntent(args) {
|
|
49
46
|
isError: parsedIntent.action === 'unknown' && parsedIntent.confidence < 0.3
|
50
47
|
};
|
51
48
|
}
|
52
|
-
exports.handleParseIntent = handleParseIntent;
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.handleProvideFeedback = exports.provideFeedbackTool = void 0;
|
4
|
-
const session_js_1 = require("../lib/session.js");
|
5
|
-
exports.provideFeedbackTool = {
|
1
|
+
import { generateSessionId, logInteraction } from "../lib/session.js";
|
2
|
+
export const provideFeedbackTool = {
|
6
3
|
name: "provide_feedback",
|
7
4
|
description: "Provide feedback on intent parsing accuracy to improve future predictions",
|
8
5
|
inputSchema: {
|
@@ -28,11 +25,11 @@ exports.provideFeedbackTool = {
|
|
28
25
|
required: ["original_input", "feedback_notes"]
|
29
26
|
}
|
30
27
|
};
|
31
|
-
async function handleProvideFeedback(args) {
|
28
|
+
export async function handleProvideFeedback(args) {
|
32
29
|
const { original_input, parsed_result, correct_interpretation, feedback_notes } = args;
|
33
|
-
const sessionId =
|
30
|
+
const sessionId = generateSessionId();
|
34
31
|
// Log feedback for future model improvements
|
35
|
-
|
32
|
+
logInteraction({
|
36
33
|
session_id: sessionId,
|
37
34
|
tool_name: 'provide_feedback',
|
38
35
|
user_input: { original_input, feedback_notes },
|
@@ -58,4 +55,3 @@ async function handleProvideFeedback(args) {
|
|
58
55
|
isError: false
|
59
56
|
};
|
60
57
|
}
|
61
|
-
exports.handleProvideFeedback = handleProvideFeedback;
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.handleQueryResources = exports.queryResourcesTool = void 0;
|
4
|
-
const api_utils_js_1 = require("../lib/api-utils.js");
|
5
|
-
exports.queryResourcesTool = {
|
1
|
+
import { api } from "../lib/api-utils.js";
|
2
|
+
export const queryResourcesTool = {
|
6
3
|
name: "query_resources",
|
7
4
|
description: "Query actual infrastructure resources (VMs, cluster nodes, networks) with natural language. Supports network placement queries. ⚡ TIP: Run discover_capabilities first to learn available OS types, groups, and statuses in your environment.",
|
8
5
|
inputSchema: {
|
@@ -280,7 +277,7 @@ function formatResponse(parsedQuery, results, totalCount, detailLevel = 2) {
|
|
280
277
|
query_summary: `Showing ${limitedResults.length} of ${results.length} ${resource} matching criteria`
|
281
278
|
};
|
282
279
|
}
|
283
|
-
async function handleQueryResources(args) {
|
280
|
+
export async function handleQueryResources(args) {
|
284
281
|
try {
|
285
282
|
const { natural_query, limit = 10, detail_level = 2 } = args;
|
286
283
|
if (!natural_query || typeof natural_query !== 'string') {
|
@@ -308,7 +305,7 @@ async function handleQueryResources(args) {
|
|
308
305
|
};
|
309
306
|
const endpoint = endpointMap[parsedQuery.resource];
|
310
307
|
// Query the VME API
|
311
|
-
const response = await
|
308
|
+
const response = await api.get(endpoint);
|
312
309
|
// Extract data array from response
|
313
310
|
let rawData = [];
|
314
311
|
if (parsedQuery.resource === 'instances' && response.data.instances) {
|
@@ -368,4 +365,3 @@ async function handleQueryResources(args) {
|
|
368
365
|
};
|
369
366
|
}
|
370
367
|
}
|
371
|
-
exports.handleQueryResources = handleQueryResources;
|
package/dist/types/interfaces.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vme-mcp-server",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.13",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/server.js",
|
6
6
|
"bin": {
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"start": "node dist/server.js",
|
12
12
|
"dev": "tsx watch src/server.ts",
|
13
13
|
"prepare": "husky install",
|
14
|
-
"prepublishOnly": "npm run build &&
|
14
|
+
"prepublishOnly": "npm run build && chmod +x dist/server.js && cp README-NPM.md dist/README.md",
|
15
15
|
"test": "npm run test:critical",
|
16
16
|
"test:unit": "mocha tests/unit/*.test.js",
|
17
17
|
"test:binary": "mocha tests/binary/*.test.js",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"test:all": "mocha tests/**/*.test.js",
|
23
23
|
"test:coverage": "nyc mocha tests/**/*.test.js",
|
24
24
|
"lint": "echo 'Linting not configured yet'",
|
25
|
-
"precommit": "npm run lint && npm run test:critical && npm run build"
|
25
|
+
"precommit": "npm run lint && npm run test:critical && npm run build && npm run test:package"
|
26
26
|
},
|
27
27
|
"keywords": [
|
28
28
|
"mcp",
|