mlgym-deploy 3.3.42 → 3.3.43
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/ADD_TO_CURSOR_SETTINGS.json +1 -1
- package/ADD_TO_CURSOR_SETTINGS.json.example +28 -0
- package/CHANGELOG-v3.3.42.md +707 -0
- package/Dockerfile +7 -0
- package/README.md +35 -0
- package/claude-desktop-config.json +1 -1
- package/claude-desktop-config.json.example +8 -0
- package/cursor-config.json +1 -1
- package/cursor-config.json.example +13 -0
- package/docs/CURSOR_SETUP.md +204 -0
- package/index.js +9 -4
- package/mcp.json.example +13 -0
- package/package.json +7 -3
- package/tests/TEST_RESULTS.md +518 -0
- package/tests/archived/README.md +71 -0
- package/{deploy-hello-world.sh → tests/archived/deploy-hello-world.sh} +9 -6
- package/tests/deploy_dollie_test.sh +11 -7
- package/tests/misc/check-sdk-version.js +50 -0
- package/tests/mlgym_auth_login_test.sh +13 -9
- package/tests/mlgym_deploy_logs_test.sh +339 -0
- package/tests/mlgym_deploy_test.sh +341 -0
- package/tests/mlgym_status_test.sh +281 -0
- package/tests/mlgym_user_create_test.sh +35 -29
- package/tests/run-all-tests.sh +135 -41
- package/CURSOR_SETUP.md +0 -119
- package/index.js.backup-atomic +0 -1358
- /package/{DEBUG.md → docs/DEBUG.md} +0 -0
- /package/{SECURITY-UPDATE-v2.4.0.md → tests/archived/SECURITY-UPDATE-v2.4.0.md} +0 -0
- /package/{cursor-integration.js → tests/archived/cursor-integration.js} +0 -0
- /package/tests/{mlgym_auth_logout_test.sh → archived/mlgym_auth_logout_test.sh} +0 -0
- /package/tests/{mlgym_deployments_test.sh → archived/mlgym_deployments_test.sh} +0 -0
- /package/tests/{mlgym_project_init_test.sh → archived/mlgym_project_init_test.sh} +0 -0
- /package/tests/{mlgym_projects_get_test.sh → archived/mlgym_projects_get_test.sh} +0 -0
- /package/tests/{mlgym_projects_list_test.sh → archived/mlgym_projects_list_test.sh} +0 -0
package/README.md
CHANGED
|
@@ -32,12 +32,47 @@ Configure in your MCP client settings:
|
|
|
32
32
|
|
|
33
33
|
## Configuration
|
|
34
34
|
|
|
35
|
+
### For Published Package (Production)
|
|
36
|
+
|
|
35
37
|
Set the backend URL via environment variable:
|
|
36
38
|
|
|
37
39
|
```bash
|
|
38
40
|
export MLGYM_BACKEND_URL=https://backend.eu.ezb.net
|
|
39
41
|
```
|
|
40
42
|
|
|
43
|
+
### For Local Development
|
|
44
|
+
|
|
45
|
+
When developing locally, you'll need to configure the MCP server with absolute paths. Configuration files are user-specific and not tracked in git.
|
|
46
|
+
|
|
47
|
+
1. **Copy example files** to create your local config:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cp cursor-config.json.example cursor-config.json
|
|
51
|
+
cp mcp.json.example mcp.json
|
|
52
|
+
cp claude-desktop-config.json.example claude-desktop-config.json
|
|
53
|
+
cp ADD_TO_CURSOR_SETTINGS.json.example ADD_TO_CURSOR_SETTINGS.json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Update the path** in your config file with your absolute path:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"gitlab-backend": {
|
|
62
|
+
"command": "node",
|
|
63
|
+
"args": ["/your/absolute/path/to/gitlab_backend/mcp-server/index.js"],
|
|
64
|
+
"env": {
|
|
65
|
+
"GITLAB_BACKEND_URL": "https://backend.eu.ezb.net",
|
|
66
|
+
"GITLAB_URL": "https://git.mlgym.io",
|
|
67
|
+
"COOLIFY_URL": "https://coolify.eu.ezb.net"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Note:** Absolute paths are required because the IDE launches the MCP server from its own working directory, not the project directory. Relative paths won't work.
|
|
75
|
+
|
|
41
76
|
## License
|
|
42
77
|
|
|
43
78
|
MIT
|
package/cursor-config.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcp.servers": {
|
|
3
3
|
"gitlab-backend": {
|
|
4
4
|
"command": "node",
|
|
5
|
-
"args": ["/home/
|
|
5
|
+
"args": ["/home/sreedhar/Work/Projects/mlgym/gitlab_backend/mcp-server/index.js"],
|
|
6
6
|
"env": {
|
|
7
7
|
"GITLAB_BACKEND_URL": "https://backend.eu.ezb.net",
|
|
8
8
|
"GITLAB_URL": "https://git.mlgym.io",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcp.servers": {
|
|
3
|
+
"gitlab-backend": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": ["/path/to/your/gitlab_backend/mcp-server/index.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"GITLAB_BACKEND_URL": "https://backend.eu.ezb.net",
|
|
8
|
+
"GITLAB_URL": "https://git.mlgym.io",
|
|
9
|
+
"COOLIFY_URL": "https://coolify.eu.ezb.net"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# MCP Setup Guide for Cursor IDE
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
✅ Node.js installed
|
|
5
|
+
✅ MCP dependencies installed (already done)
|
|
6
|
+
✅ Cursor IDE with MCP support
|
|
7
|
+
|
|
8
|
+
## Setup Instructions
|
|
9
|
+
|
|
10
|
+
### 1. Configure MCP in Cursor
|
|
11
|
+
|
|
12
|
+
Open Cursor Settings (Cmd/Ctrl+,) and add the MCP server configuration:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"mcp.servers": {
|
|
17
|
+
"mlgym-deploy": {
|
|
18
|
+
"command": "node",
|
|
19
|
+
"args": ["${workspaceFolder}/mcp-server/index.js"],
|
|
20
|
+
"env": {
|
|
21
|
+
"GITLAB_BACKEND_URL": "https://backend.eu.ezb.net",
|
|
22
|
+
"GITLAB_URL": "https://git.mlgym.io",
|
|
23
|
+
"COOLIFY_URL": "https://coolify.eu.ezb.net"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Using MCP Tools in Cursor
|
|
31
|
+
|
|
32
|
+
Once MCP is configured, you can use these commands directly in Cursor chat:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
@mcp mlgym_user_create - Create a new user account
|
|
36
|
+
@mcp mlgym_auth_login - Login with existing credentials
|
|
37
|
+
@mcp mlgym_deploy - Deploy a project (recommended)
|
|
38
|
+
@mcp mlgym_status - Check deployment status
|
|
39
|
+
@mcp mlgym_deploy_logs - View deployment logs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. MCP Tool Details
|
|
43
|
+
|
|
44
|
+
#### mlgym_user_create
|
|
45
|
+
Creates a complete user account with:
|
|
46
|
+
- GitLab account
|
|
47
|
+
- Coolify account
|
|
48
|
+
- SSH key generation and registration
|
|
49
|
+
- Authentication token storage
|
|
50
|
+
|
|
51
|
+
**Parameters:**
|
|
52
|
+
- `email` (required): User email address
|
|
53
|
+
- `name` (required): User full name
|
|
54
|
+
- `password` (required): User password (min 8 characters)
|
|
55
|
+
- `accept_terms` (required): Must be `true`
|
|
56
|
+
|
|
57
|
+
**Example:**
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"email": "user@example.com",
|
|
61
|
+
"name": "John Doe",
|
|
62
|
+
"password": "SecurePass123!",
|
|
63
|
+
"accept_terms": true
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### mlgym_auth_login
|
|
68
|
+
Login with existing user credentials to get authentication token.
|
|
69
|
+
|
|
70
|
+
**Parameters:**
|
|
71
|
+
- `email` (required): Email address
|
|
72
|
+
- `password` (required): Password
|
|
73
|
+
|
|
74
|
+
**Example:**
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"email": "user@example.com",
|
|
78
|
+
"password": "SecurePass123!"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### mlgym_deploy (RECOMMENDED)
|
|
83
|
+
Complete deployment workflow in one call. Automatically authenticates (uses cached token if available), analyzes project, creates GitLab repo, and deploys to Coolify.
|
|
84
|
+
|
|
85
|
+
**Parameters:**
|
|
86
|
+
- `project_name` (required): Project name (lowercase alphanumeric with hyphens, e.g., "my-app")
|
|
87
|
+
- `project_description` (required): Brief project description (min 10 characters)
|
|
88
|
+
- `email` (optional): Email for authentication (if not already authenticated)
|
|
89
|
+
- `password` (optional): Password (if not already authenticated)
|
|
90
|
+
- `hostname` (optional): Custom hostname
|
|
91
|
+
- `local_path` (optional): Local project directory path (defaults to current directory)
|
|
92
|
+
- `project_type` (optional): Override auto-detected type (nodejs, python, static, go)
|
|
93
|
+
- `framework` (optional): Override auto-detected framework (nextjs, express, react, vue, flask, fastapi, html)
|
|
94
|
+
|
|
95
|
+
**Example:**
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"project_name": "my-awesome-app",
|
|
99
|
+
"project_description": "A simple Node.js application",
|
|
100
|
+
"email": "user@example.com",
|
|
101
|
+
"password": "SecurePass123!",
|
|
102
|
+
"local_path": "."
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### Other Available Tools
|
|
107
|
+
|
|
108
|
+
- **mlgym_status**: Check deployment status and project configuration
|
|
109
|
+
- **mlgym_deploy_logs**: View deployment logs (requires project_name)
|
|
110
|
+
- **mlgym_set_env_vars**: Set environment variables for deployment
|
|
111
|
+
- **mlgym_set_health_check**: Configure health check endpoints
|
|
112
|
+
- **mlgym_set_domain**: Set custom domain for deployment
|
|
113
|
+
- **mlgym_set_deployment_commands**: Configure build/start commands
|
|
114
|
+
- **mlgym_deploy_manual**: Manual deployment trigger
|
|
115
|
+
- **mlgym_set_options**: Configure deployment options
|
|
116
|
+
- **mlgym_rollback**: Rollback to previous deployment
|
|
117
|
+
- **mlgym_help**: Get help on available tools
|
|
118
|
+
|
|
119
|
+
### 4. Typical Workflow
|
|
120
|
+
|
|
121
|
+
#### First-time User
|
|
122
|
+
1. Create account: `@mcp mlgym_user_create`
|
|
123
|
+
2. Deploy project: `@mcp mlgym_deploy` (includes authentication)
|
|
124
|
+
|
|
125
|
+
#### Existing User
|
|
126
|
+
1. Login: `@mcp mlgym_auth_login` (or use credentials in mlgym_deploy)
|
|
127
|
+
2. Deploy project: `@mcp mlgym_deploy`
|
|
128
|
+
3. Check status: `@mcp mlgym_status`
|
|
129
|
+
4. View logs: `@mcp mlgym_deploy_logs`
|
|
130
|
+
|
|
131
|
+
### 5. Testing MCP Connection
|
|
132
|
+
|
|
133
|
+
Test that MCP is working:
|
|
134
|
+
```bash
|
|
135
|
+
# Test the MCP server directly
|
|
136
|
+
node mcp-server/index.js
|
|
137
|
+
|
|
138
|
+
# Should output the MCP protocol initialization message
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 6. Authentication
|
|
142
|
+
|
|
143
|
+
MCP stores authentication tokens in `~/.mlgym/mcp_config.json` automatically after:
|
|
144
|
+
- First user creation (`mlgym_user_create`)
|
|
145
|
+
- Successful login (`mlgym_auth_login`)
|
|
146
|
+
- Successful deployment with credentials (`mlgym_deploy`)
|
|
147
|
+
|
|
148
|
+
### 7. Troubleshooting
|
|
149
|
+
|
|
150
|
+
If MCP tools don't appear in Cursor:
|
|
151
|
+
1. Restart Cursor after configuration
|
|
152
|
+
2. Check the MCP server is accessible:
|
|
153
|
+
```bash
|
|
154
|
+
node mcp-server/index.js
|
|
155
|
+
```
|
|
156
|
+
3. Verify settings in Cursor preferences (look for "mcp.servers")
|
|
157
|
+
4. Check Cursor logs for MCP errors (View → Output → MCP)
|
|
158
|
+
5. Ensure you're using Cursor with MCP support (latest version)
|
|
159
|
+
|
|
160
|
+
### 8. Debug Mode
|
|
161
|
+
|
|
162
|
+
Debug logging is enabled by default. To see detailed output:
|
|
163
|
+
```bash
|
|
164
|
+
# Start Cursor from terminal to see MCP logs
|
|
165
|
+
cd ~/your-project
|
|
166
|
+
cursor .
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
See [DEBUG.md](./DEBUG.md) for more details on debug logging.
|
|
170
|
+
|
|
171
|
+
## Environment Variables
|
|
172
|
+
|
|
173
|
+
The MCP server uses these production endpoints:
|
|
174
|
+
- **Backend**: https://backend.eu.ezb.net
|
|
175
|
+
- **GitLab**: https://git.mlgym.io
|
|
176
|
+
- **Coolify**: https://coolify.eu.ezb.net
|
|
177
|
+
|
|
178
|
+
These are pre-configured in the MCP server configuration.
|
|
179
|
+
|
|
180
|
+
## Quick Test
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# In Cursor terminal, test user creation
|
|
184
|
+
echo '{
|
|
185
|
+
"jsonrpc": "2.0",
|
|
186
|
+
"method": "tools/call",
|
|
187
|
+
"params": {
|
|
188
|
+
"name": "mlgym_user_create",
|
|
189
|
+
"arguments": {
|
|
190
|
+
"email": "test@example.com",
|
|
191
|
+
"name": "Test User",
|
|
192
|
+
"password": "TestPass123!",
|
|
193
|
+
"accept_terms": true
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"id": 1
|
|
197
|
+
}' | node mcp-server/index.js
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Additional Resources
|
|
201
|
+
|
|
202
|
+
- [Debug Guide](./DEBUG.md) - Enable and configure debug logging
|
|
203
|
+
- [Test Results](../tests/TEST_RESULTS.md) - Current test coverage and results
|
|
204
|
+
- Production Backend: https://backend.eu.ezb.net
|
package/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import crypto from 'crypto';
|
|
|
18
18
|
const execAsync = promisify(exec);
|
|
19
19
|
|
|
20
20
|
// Current version of this MCP server - INCREMENT FOR WORKFLOW FIXES
|
|
21
|
-
const CURRENT_VERSION = '3.3.
|
|
21
|
+
const CURRENT_VERSION = '3.3.43'; // Add embedded contact info (operations@stratus5.com) and hide infrastructure URLs from help
|
|
22
22
|
const PACKAGE_NAME = 'mlgym-deploy';
|
|
23
23
|
|
|
24
24
|
// Debug logging configuration - ENABLED BY DEFAULT
|
|
@@ -90,7 +90,13 @@ const CONFIG = {
|
|
|
90
90
|
backend_url: process.env.MLGYM_API_ENDPOINT || 'https://backend.eu.ezb.net',
|
|
91
91
|
gitlab_url: 'https://git.mlgym.io',
|
|
92
92
|
coolify_url: 'https://coolify.eu.ezb.net',
|
|
93
|
-
config_file: path.join(os.homedir(), '.mlgym', 'mcp_config.json')
|
|
93
|
+
config_file: path.join(os.homedir(), '.mlgym', 'mcp_config.json'),
|
|
94
|
+
|
|
95
|
+
// Contact information (user-facing)
|
|
96
|
+
contact: {
|
|
97
|
+
support_email: 'operations@stratus5.com',
|
|
98
|
+
docs_url: 'https://mlgym.info'
|
|
99
|
+
}
|
|
94
100
|
};
|
|
95
101
|
|
|
96
102
|
// Helper to load/save authentication
|
|
@@ -4619,8 +4625,7 @@ Examples show both what users say AND the tool call that gets executed.
|
|
|
4619
4625
|
💡 Most parameters are optional with sensible defaults
|
|
4620
4626
|
|
|
4621
4627
|
📚 Documentation: https://mlgym.info
|
|
4622
|
-
|
|
4623
|
-
📊 Dashboard: https://platform.mlgym.info
|
|
4628
|
+
📧 Support: operations@stratus5.com
|
|
4624
4629
|
`;
|
|
4625
4630
|
|
|
4626
4631
|
return {
|
package/mcp.json.example
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"gitlab-backend": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": ["/path/to/your/gitlab_backend/mcp-server/index.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"GITLAB_BACKEND_URL": "https://backend.eu.ezb.net",
|
|
8
|
+
"GITLAB_URL": "https://git.mlgym.io",
|
|
9
|
+
"COOLIFY_URL": "https://coolify.eu.ezb.net"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mlgym-deploy",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.43",
|
|
4
4
|
"description": "MCP server for MLGym - Complete deployment management: deploy, configure, monitor, and rollback applications",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,13 +20,17 @@
|
|
|
20
20
|
],
|
|
21
21
|
"author": "MLGym Team",
|
|
22
22
|
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
23
26
|
"repository": {
|
|
24
27
|
"type": "git",
|
|
25
28
|
"url": "git@code.stratus5.com:chka/gitlab_backend.git"
|
|
26
29
|
},
|
|
27
30
|
"dependencies": {
|
|
28
|
-
"@modelcontextprotocol/sdk": "^
|
|
29
|
-
"axios": "^1.6.0"
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
32
|
+
"axios": "^1.6.0",
|
|
33
|
+
"package": "*"
|
|
30
34
|
},
|
|
31
35
|
"mcp": {
|
|
32
36
|
"name": "MLGym Deploy",
|