@mks2508/coolify-mks-cli-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 (42) hide show
  1. package/dist/cli/index.js +11788 -0
  2. package/dist/coolify/config.d.ts +64 -0
  3. package/dist/coolify/config.d.ts.map +1 -0
  4. package/dist/coolify/index.d.ts +201 -0
  5. package/dist/coolify/index.d.ts.map +1 -0
  6. package/dist/coolify/types.d.ts +282 -0
  7. package/dist/coolify/types.d.ts.map +1 -0
  8. package/dist/index.cjs +29150 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +14 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +29127 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/server/sse.d.ts +11 -0
  15. package/dist/server/sse.d.ts.map +1 -0
  16. package/dist/server/sse.js +32 -0
  17. package/dist/server/stdio.d.ts +13 -0
  18. package/dist/server/stdio.d.ts.map +1 -0
  19. package/dist/server/stdio.js +18326 -0
  20. package/dist/tools/definitions.d.ts +13 -0
  21. package/dist/tools/definitions.d.ts.map +1 -0
  22. package/dist/tools/handlers.d.ts +19 -0
  23. package/dist/tools/handlers.d.ts.map +1 -0
  24. package/dist/utils/format.d.ts +38 -0
  25. package/dist/utils/format.d.ts.map +1 -0
  26. package/package.json +67 -0
  27. package/src/cli/commands/config.ts +83 -0
  28. package/src/cli/commands/deploy.ts +56 -0
  29. package/src/cli/commands/env.ts +60 -0
  30. package/src/cli/commands/list.ts +63 -0
  31. package/src/cli/commands/logs.ts +49 -0
  32. package/src/cli/commands/servers.ts +52 -0
  33. package/src/cli/index.ts +81 -0
  34. package/src/coolify/config.ts +113 -0
  35. package/src/coolify/index.ts +688 -0
  36. package/src/coolify/types.ts +297 -0
  37. package/src/index.ts +864 -0
  38. package/src/server/sse.ts +50 -0
  39. package/src/server/stdio.ts +52 -0
  40. package/src/tools/definitions.ts +435 -0
  41. package/src/tools/handlers.ts +605 -0
  42. package/src/utils/format.ts +104 -0
@@ -0,0 +1,297 @@
1
+ /**
2
+ * Coolify types for MCP server and CLI.
3
+ *
4
+ * Internal options use camelCase for consistency with TypeScript conventions.
5
+ * API response types use snake_case to match Coolify API responses.
6
+ *
7
+ * @module
8
+ */
9
+
10
+ /**
11
+ * Options for deploying to Coolify.
12
+ */
13
+ export interface ICoolifyDeployOptions {
14
+ /** Application UUID */
15
+ uuid?: string
16
+ /** Application tag */
17
+ tag?: string
18
+ /** Force rebuild without cache */
19
+ force?: boolean
20
+ /** Progress callback for deployment status updates */
21
+ onProgress?: IProgressCallback
22
+ }
23
+
24
+ /**
25
+ * Options for creating a Coolify application.
26
+ */
27
+ export interface ICoolifyAppOptions {
28
+ /** Application name */
29
+ name: string
30
+ /** Application description */
31
+ description?: string
32
+ /** Server UUID */
33
+ serverUuid: string
34
+ /** Destination UUID */
35
+ destinationUuid: string
36
+ /** GitHub repository URL */
37
+ githubRepoUrl: string
38
+ /** Git branch */
39
+ branch?: string
40
+ /** Build pack type */
41
+ buildPack?: 'dockerfile' | 'nixpacks' | 'static'
42
+ /** Environment variables */
43
+ envVars?: Record<string, string>
44
+ }
45
+
46
+ /**
47
+ * Options for updating a Coolify application.
48
+ */
49
+ export interface ICoolifyUpdateOptions {
50
+ /** Application name */
51
+ name?: string
52
+ /** Application description */
53
+ description?: string
54
+ /** Build pack type */
55
+ buildPack?: 'dockerfile' | 'nixpacks' | 'static'
56
+ /** Git branch */
57
+ gitBranch?: string
58
+ /** Ports to expose */
59
+ portsExposes?: string
60
+ /** Install command (nixpacks) */
61
+ installCommand?: string
62
+ /** Build command */
63
+ buildCommand?: string
64
+ /** Start command */
65
+ startCommand?: string
66
+ }
67
+
68
+ /**
69
+ * Options for retrieving application logs.
70
+ */
71
+ export interface ICoolifyLogsOptions {
72
+ /** Follow logs in real-time */
73
+ follow?: boolean
74
+ /** Number of lines to retrieve */
75
+ tail?: number
76
+ }
77
+
78
+ /**
79
+ * Result of a Coolify deployment.
80
+ */
81
+ export interface ICoolifyDeployResult {
82
+ /** Whether the deployment started successfully */
83
+ success: boolean
84
+ /** Deployment UUID */
85
+ deploymentUuid?: string
86
+ /** Resource UUID */
87
+ resourceUuid?: string
88
+ /** Error message if failed */
89
+ error?: string
90
+ }
91
+
92
+ /**
93
+ * Result of creating a Coolify application.
94
+ */
95
+ export interface ICoolifyAppResult {
96
+ /** Whether the application was created */
97
+ success: boolean
98
+ /** Application UUID */
99
+ uuid?: string
100
+ /** Error message if failed */
101
+ error?: string
102
+ }
103
+
104
+ /**
105
+ * Result of a delete operation.
106
+ */
107
+ export interface ICoolifyDeleteResult {
108
+ /** Whether the deletion was successful */
109
+ success: boolean
110
+ /** Optional message */
111
+ message?: string
112
+ }
113
+
114
+ /**
115
+ * Application logs response.
116
+ */
117
+ export interface ICoolifyLogs {
118
+ /** Log lines */
119
+ logs: string[]
120
+ /** Timestamp of log retrieval */
121
+ timestamp: string
122
+ }
123
+
124
+ /**
125
+ * Deployment record from API (snake_case).
126
+ */
127
+ export interface ICoolifyDeployment {
128
+ /** Deployment ID */
129
+ id: number
130
+ /** Deployment UUID */
131
+ uuid: string
132
+ /** Deployment status */
133
+ status: string
134
+ /** Application ID */
135
+ application_id?: number
136
+ /** Pull request ID if applicable */
137
+ pull_request_id?: number | null
138
+ /** Force rebuild flag */
139
+ force_rebuild?: boolean
140
+ /** Commit hash */
141
+ commit?: string | null
142
+ /** Rollback flag */
143
+ rollback?: boolean
144
+ /** Commit message */
145
+ commit_message?: string | null
146
+ /** Creation timestamp */
147
+ created_at: string
148
+ /** Update timestamp */
149
+ updated_at: string
150
+ }
151
+
152
+ /**
153
+ * Application details from API (snake_case).
154
+ */
155
+ export interface ICoolifyApplication {
156
+ /** Application UUID */
157
+ uuid: string
158
+ /** Application name */
159
+ name: string
160
+ /** Application description */
161
+ description?: string | null
162
+ /** Current status (e.g., "running:unknown", "stopped") */
163
+ status: string
164
+ /** FQDN if configured */
165
+ fqdn?: string | null
166
+ /** Git repository (e.g., "MKS2508/repo-name") */
167
+ git_repository?: string | null
168
+ /** Git branch */
169
+ git_branch?: string | null
170
+ /** Full git URL */
171
+ git_full_url?: string | null
172
+ /** Build pack type */
173
+ build_pack?: string | null
174
+ /** Ports exposed */
175
+ ports_exposes?: string | null
176
+ /** Server status (boolean) */
177
+ server_status?: boolean
178
+ /** Environment ID */
179
+ environment_id?: number
180
+ /** Destination info */
181
+ destination?: {
182
+ uuid: string
183
+ name: string
184
+ server?: {
185
+ uuid: string
186
+ name: string
187
+ ip: string
188
+ }
189
+ } | null
190
+ /** Install command */
191
+ install_command?: string | null
192
+ /** Build command */
193
+ build_command?: string | null
194
+ /** Start command */
195
+ start_command?: string | null
196
+ /** Creation timestamp */
197
+ created_at?: string
198
+ /** Update timestamp */
199
+ updated_at?: string
200
+ }
201
+
202
+ /**
203
+ * Server details from API (snake_case).
204
+ */
205
+ export interface ICoolifyServer {
206
+ /** Server UUID */
207
+ uuid: string
208
+ /** Server name */
209
+ name: string
210
+ /** Server description */
211
+ description?: string | null
212
+ /** Server IP address */
213
+ ip?: string
214
+ /** SSH port */
215
+ port?: number
216
+ /** Whether this is the Coolify host */
217
+ is_coolify_host?: boolean
218
+ /** Whether server is reachable */
219
+ is_reachable?: boolean
220
+ /** Whether server is usable */
221
+ is_usable?: boolean
222
+ /** Proxy configuration */
223
+ proxy?: {
224
+ redirect_enabled?: boolean
225
+ } | null
226
+ /** Server settings */
227
+ settings?: Record<string, unknown> | null
228
+ }
229
+
230
+ /**
231
+ * Destination (Docker network) from API (snake_case).
232
+ */
233
+ export interface ICoolifyDestination {
234
+ /** Destination UUID */
235
+ uuid: string
236
+ /** Destination name */
237
+ name: string
238
+ /** Network name */
239
+ network?: string
240
+ /** Server UUID */
241
+ server_uuid?: string
242
+ }
243
+
244
+ /**
245
+ * Project details from API (snake_case).
246
+ */
247
+ export interface ICoolifyProject {
248
+ /** Project UUID */
249
+ uuid: string
250
+ /** Project name */
251
+ name: string
252
+ /** Project description */
253
+ description?: string | null
254
+ /** Environments in this project */
255
+ environments?: ICoolifyEnvironment[]
256
+ }
257
+
258
+ /**
259
+ * Environment within a project from API (snake_case).
260
+ */
261
+ export interface ICoolifyEnvironment {
262
+ /** Environment ID */
263
+ id: number
264
+ /** Environment name */
265
+ name: string
266
+ /** Environment description */
267
+ description?: string | null
268
+ /** Project ID */
269
+ project_id: number
270
+ /** Creation timestamp */
271
+ created_at?: string
272
+ /** Update timestamp */
273
+ updated_at?: string
274
+ }
275
+
276
+ /**
277
+ * Team details from API (snake_case).
278
+ */
279
+ export interface ICoolifyTeam {
280
+ /** Team ID */
281
+ id: number
282
+ /** Team name */
283
+ name: string
284
+ /** Team description */
285
+ description?: string | null
286
+ /** Personal team flag */
287
+ personal_team?: boolean
288
+ }
289
+
290
+ /**
291
+ * Progress callback function type.
292
+ *
293
+ * @param percent - Progress percentage (0-100)
294
+ * @param message - Progress message
295
+ * @param step - Current step identifier
296
+ */
297
+ export type IProgressCallback = (percent: number, message: string, step?: string) => void