@iyulab/mloop-mcp 0.1.0

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.
Files changed (62) hide show
  1. package/README.md +178 -0
  2. package/build/executor.d.ts +36 -0
  3. package/build/executor.d.ts.map +1 -0
  4. package/build/executor.js +106 -0
  5. package/build/executor.js.map +1 -0
  6. package/build/index.d.ts +8 -0
  7. package/build/index.d.ts.map +1 -0
  8. package/build/index.js +27 -0
  9. package/build/index.js.map +1 -0
  10. package/build/server.d.ts +9 -0
  11. package/build/server.d.ts.map +1 -0
  12. package/build/server.js +34 -0
  13. package/build/server.js.map +1 -0
  14. package/build/tools/compare.d.ts +53 -0
  15. package/build/tools/compare.d.ts.map +1 -0
  16. package/build/tools/compare.js +66 -0
  17. package/build/tools/compare.js.map +1 -0
  18. package/build/tools/evaluate.d.ts +56 -0
  19. package/build/tools/evaluate.d.ts.map +1 -0
  20. package/build/tools/evaluate.js +85 -0
  21. package/build/tools/evaluate.js.map +1 -0
  22. package/build/tools/index.d.ts +44 -0
  23. package/build/tools/index.d.ts.map +1 -0
  24. package/build/tools/index.js +27 -0
  25. package/build/tools/index.js.map +1 -0
  26. package/build/tools/info.d.ts +42 -0
  27. package/build/tools/info.d.ts.map +1 -0
  28. package/build/tools/info.js +56 -0
  29. package/build/tools/info.js.map +1 -0
  30. package/build/tools/list.d.ts +49 -0
  31. package/build/tools/list.d.ts.map +1 -0
  32. package/build/tools/list.js +66 -0
  33. package/build/tools/list.js.map +1 -0
  34. package/build/tools/predict.d.ts +63 -0
  35. package/build/tools/predict.d.ts.map +1 -0
  36. package/build/tools/predict.js +82 -0
  37. package/build/tools/predict.js.map +1 -0
  38. package/build/tools/promote.d.ts +56 -0
  39. package/build/tools/promote.d.ts.map +1 -0
  40. package/build/tools/promote.js +72 -0
  41. package/build/tools/promote.js.map +1 -0
  42. package/build/tools/serve.d.ts +49 -0
  43. package/build/tools/serve.d.ts.map +1 -0
  44. package/build/tools/serve.js +79 -0
  45. package/build/tools/serve.js.map +1 -0
  46. package/build/tools/status.d.ts +35 -0
  47. package/build/tools/status.d.ts.map +1 -0
  48. package/build/tools/status.js +51 -0
  49. package/build/tools/status.js.map +1 -0
  50. package/build/tools/train.d.ts +78 -0
  51. package/build/tools/train.d.ts.map +1 -0
  52. package/build/tools/train.js +101 -0
  53. package/build/tools/train.js.map +1 -0
  54. package/build/utils/errors.d.ts +28 -0
  55. package/build/utils/errors.d.ts.map +1 -0
  56. package/build/utils/errors.js +59 -0
  57. package/build/utils/errors.js.map +1 -0
  58. package/build/utils/parser.d.ts +23 -0
  59. package/build/utils/parser.d.ts.map +1 -0
  60. package/build/utils/parser.js +98 -0
  61. package/build/utils/parser.js.map +1 -0
  62. package/package.json +49 -0
@@ -0,0 +1,98 @@
1
+ /**
2
+ * CLI output parsing utilities
3
+ */
4
+ import { stripAnsi } from './errors.js';
5
+ /**
6
+ * Parse CLI output and clean it for MCP response
7
+ */
8
+ export function parseCliOutput(output) {
9
+ return stripAnsi(output).trim();
10
+ }
11
+ /**
12
+ * Try to parse JSON from CLI output
13
+ * Returns null if parsing fails
14
+ */
15
+ export function tryParseJson(output) {
16
+ try {
17
+ const cleaned = stripAnsi(output).trim();
18
+ return JSON.parse(cleaned);
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ }
24
+ /**
25
+ * Extract table data from CLI output
26
+ * Parses simple table format with headers
27
+ */
28
+ export function parseTable(output) {
29
+ const lines = stripAnsi(output).trim().split('\n');
30
+ if (lines.length < 2)
31
+ return [];
32
+ const headerLine = lines[0];
33
+ if (!headerLine)
34
+ return [];
35
+ // Find column boundaries from header separators (usually --- or ═══)
36
+ const separatorLine = lines[1];
37
+ if (!separatorLine || !separatorLine.match(/^[-─═]+/)) {
38
+ // No separator line, try simple space-separated
39
+ return parseSpaceSeparatedTable(lines);
40
+ }
41
+ const headers = headerLine.split(/\s{2,}/).map(h => h.trim()).filter(Boolean);
42
+ const results = [];
43
+ for (let i = 2; i < lines.length; i++) {
44
+ const line = lines[i];
45
+ if (!line || line.trim() === '')
46
+ continue;
47
+ const values = line.split(/\s{2,}/).map(v => v.trim());
48
+ const row = {};
49
+ headers.forEach((header, idx) => {
50
+ row[header] = values[idx] ?? '';
51
+ });
52
+ results.push(row);
53
+ }
54
+ return results;
55
+ }
56
+ /**
57
+ * Parse simple space-separated table
58
+ */
59
+ function parseSpaceSeparatedTable(lines) {
60
+ if (lines.length < 1)
61
+ return [];
62
+ const headerLine = lines[0];
63
+ if (!headerLine)
64
+ return [];
65
+ const headers = headerLine.split(/\s+/).map(h => h.trim()).filter(Boolean);
66
+ const results = [];
67
+ for (let i = 1; i < lines.length; i++) {
68
+ const line = lines[i];
69
+ if (!line || line.trim() === '')
70
+ continue;
71
+ const values = line.split(/\s+/).map(v => v.trim());
72
+ const row = {};
73
+ headers.forEach((header, idx) => {
74
+ row[header] = values[idx] ?? '';
75
+ });
76
+ results.push(row);
77
+ }
78
+ return results;
79
+ }
80
+ /**
81
+ * Extract key-value pairs from CLI output
82
+ * Handles formats like "Key: Value" or "Key = Value"
83
+ */
84
+ export function parseKeyValues(output) {
85
+ const result = {};
86
+ const lines = stripAnsi(output).trim().split('\n');
87
+ for (const line of lines) {
88
+ // Match "Key: Value" or "Key = Value" patterns
89
+ const match = line.match(/^([^:=]+)[:\s=]+(.+)$/);
90
+ if (match && match[1] && match[2]) {
91
+ const key = match[1].trim();
92
+ const value = match[2].trim();
93
+ result[key] = value;
94
+ }
95
+ }
96
+ return result;
97
+ }
98
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/utils/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC,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AC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,MAAM,GAAG,GAA2B,EAAE,CAAC;QAEvC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,+CAA+C;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAClD,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@iyulab/mloop-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for MLoop CLI - ML.NET MLOps tool",
5
+ "type": "module",
6
+ "main": "build/index.js",
7
+ "bin": {
8
+ "mloop-mcp": "build/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "watch": "tsc --watch",
13
+ "start": "node build/index.js",
14
+ "dev": "npm run build && npm run start",
15
+ "clean": "rimraf build",
16
+ "prepublishOnly": "npm run clean && npm run build"
17
+ },
18
+ "keywords": [
19
+ "mcp",
20
+ "mloop",
21
+ "ml.net",
22
+ "mlops",
23
+ "automl",
24
+ "machine-learning"
25
+ ],
26
+ "author": "iyulab",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/iyulab/MLoop.git",
31
+ "directory": "mcp"
32
+ },
33
+ "engines": {
34
+ "node": ">=18.0.0"
35
+ },
36
+ "dependencies": {
37
+ "@modelcontextprotocol/sdk": "^1.0.0",
38
+ "zod": "^3.25.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^22.0.0",
42
+ "rimraf": "^6.0.0",
43
+ "typescript": "^5.7.0"
44
+ },
45
+ "files": [
46
+ "build",
47
+ "README.md"
48
+ ]
49
+ }