mlgym-deploy 2.3.5 → 2.4.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.
- package/SECURITY-UPDATE-v2.4.0.md +104 -0
- package/index.js +404 -6269
- package/package.json +1 -1
- package/index-v2.js +0 -1062
- package/index-v3-explicit.js +0 -129
package/index-v3-explicit.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
-
import {
|
|
6
|
-
CallToolRequestSchema,
|
|
7
|
-
ListToolsRequestSchema
|
|
8
|
-
} from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
-
import axios from 'axios';
|
|
10
|
-
import fs from 'fs/promises';
|
|
11
|
-
import path from 'path';
|
|
12
|
-
import os from 'os';
|
|
13
|
-
import crypto from 'crypto';
|
|
14
|
-
|
|
15
|
-
// Import all helper functions from v2
|
|
16
|
-
const v2Module = await import('./index-v2.js');
|
|
17
|
-
|
|
18
|
-
// Configuration
|
|
19
|
-
const CONFIG = {
|
|
20
|
-
backend_url: process.env.GITLAB_BACKEND_URL || 'https://backend.eu.ezb.net',
|
|
21
|
-
gitlab_url: process.env.GITLAB_URL || 'https://git.mlgym.io',
|
|
22
|
-
coolify_url: process.env.COOLIFY_URL || 'https://coolify.eu.ezb.net',
|
|
23
|
-
config_file: path.join(os.homedir(), '.mlgym', 'config.json'),
|
|
24
|
-
mlgym_ini: path.join(os.homedir(), '.mlgym', 'mlgym.ini'),
|
|
25
|
-
terms_url: 'https://mlgym.io/terms',
|
|
26
|
-
privacy_url: 'https://mlgym.io/privacy',
|
|
27
|
-
docs_url: 'https://docs.mlgym.io'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Create MCP server
|
|
31
|
-
const server = new Server(
|
|
32
|
-
{
|
|
33
|
-
name: 'mlgym-cloud-deploy',
|
|
34
|
-
version: '3.1.0',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
capabilities: {
|
|
38
|
-
tools: {}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// Tool definitions with multiple variations for better discovery
|
|
44
|
-
const TOOLS = [
|
|
45
|
-
{
|
|
46
|
-
name: 'deploy_project',
|
|
47
|
-
description: 'Deploy project to cloud. PRIMARY DEPLOYMENT TOOL. Use this when user says: deploy, publish, host, ship, launch, or push project to cloud/web/online/internet. Deploys to MLGym cloud platform with GitLab CI/CD.',
|
|
48
|
-
inputSchema: {
|
|
49
|
-
type: 'object',
|
|
50
|
-
properties: {
|
|
51
|
-
action: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
enum: ['analyze', 'register', 'configure', 'deploy'],
|
|
54
|
-
description: 'Step in deployment flow',
|
|
55
|
-
default: 'analyze'
|
|
56
|
-
},
|
|
57
|
-
session_id: { type: 'string' },
|
|
58
|
-
local_path: { type: 'string', default: '.' },
|
|
59
|
-
user_email: { type: 'string' },
|
|
60
|
-
user_name: { type: 'string' },
|
|
61
|
-
accept_terms: { type: 'boolean' },
|
|
62
|
-
confirm_dockerfile: { type: 'boolean' },
|
|
63
|
-
custom_dockerfile: { type: 'string' },
|
|
64
|
-
region: { type: 'string', enum: ['eu-central', 'us-east', 'asia-pacific'] },
|
|
65
|
-
confirm_deployment: { type: 'boolean' }
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'deploy_to_cloud',
|
|
71
|
-
description: 'Alternative: Deploy to cloud hosting. Alias for deploy_project.',
|
|
72
|
-
inputSchema: {
|
|
73
|
-
type: 'object',
|
|
74
|
-
properties: {
|
|
75
|
-
action: { type: 'string', default: 'analyze' }
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'publish_online',
|
|
81
|
-
description: 'Alternative: Publish project online. Alias for deploy_project.',
|
|
82
|
-
inputSchema: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
properties: {
|
|
85
|
-
action: { type: 'string', default: 'analyze' }
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
// Handle list tools request
|
|
92
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
93
|
-
return { tools: TOOLS };
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// Handle tool execution - all tools route to the same handler
|
|
97
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
98
|
-
const { name, arguments: args } = request.params;
|
|
99
|
-
|
|
100
|
-
// All deployment tools use the same logic
|
|
101
|
-
if (name.includes('deploy') || name.includes('publish')) {
|
|
102
|
-
// Reuse the smart deploy logic from v2
|
|
103
|
-
// This is a simplified example - you'd import the actual functions
|
|
104
|
-
return {
|
|
105
|
-
content: [{
|
|
106
|
-
type: 'text',
|
|
107
|
-
text: JSON.stringify({
|
|
108
|
-
message: `Starting deployment flow with ${name}`,
|
|
109
|
-
next_step: 'Use action: "analyze" to begin',
|
|
110
|
-
tip: 'This will analyze your project and guide you through deployment'
|
|
111
|
-
}, null, 2)
|
|
112
|
-
}]
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// Start the server
|
|
120
|
-
async function main() {
|
|
121
|
-
const transport = new StdioServerTransport();
|
|
122
|
-
await server.connect(transport);
|
|
123
|
-
console.error('MLGym Cloud Deploy MCP Server v3.1.0 (Explicit) started');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
main().catch((error) => {
|
|
127
|
-
console.error('Server error:', error);
|
|
128
|
-
process.exit(1);
|
|
129
|
-
});
|