@vibetools/dokploy-mcp 1.0.0 → 1.2.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/README.md +20 -14
- package/dist/api/client.d.ts +2 -0
- package/dist/api/client.js +44 -11
- package/dist/tools/_database.js +25 -6
- package/dist/tools/_factory.d.ts +2 -0
- package/dist/tools/_factory.js +21 -4
- package/dist/tools/application.js +219 -82
- package/dist/tools/backup.js +30 -0
- package/dist/tools/compose.js +273 -35
- package/dist/tools/deployment.js +82 -2
- package/dist/tools/docker.js +62 -2
- package/dist/tools/domain.js +15 -2
- package/dist/tools/environment.d.ts +2 -0
- package/dist/tools/environment.js +104 -0
- package/dist/tools/git-provider.d.ts +2 -0
- package/dist/tools/git-provider.js +22 -0
- package/dist/tools/github.d.ts +2 -0
- package/dist/tools/github.js +66 -0
- package/dist/tools/gitlab.d.ts +2 -0
- package/dist/tools/gitlab.js +98 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/mariadb.js +1 -1
- package/dist/tools/mongo.js +2 -1
- package/dist/tools/mounts.js +53 -9
- package/dist/tools/mysql.js +1 -1
- package/dist/tools/notification.d.ts +2 -0
- package/dist/tools/notification.js +559 -0
- package/dist/tools/patch.d.ts +2 -0
- package/dist/tools/patch.js +179 -0
- package/dist/tools/postgres.js +1 -1
- package/dist/tools/preview-deployment.d.ts +2 -0
- package/dist/tools/preview-deployment.js +50 -0
- package/dist/tools/project.js +32 -1
- package/dist/tools/redis.js +1 -1
- package/dist/tools/rollback.d.ts +2 -0
- package/dist/tools/rollback.js +28 -0
- package/dist/tools/schedule.d.ts +2 -0
- package/dist/tools/schedule.js +92 -0
- package/dist/tools/server.d.ts +2 -0
- package/dist/tools/server.js +192 -0
- package/dist/tools/settings.js +251 -0
- package/dist/tools/ssh-key.d.ts +2 -0
- package/dist/tools/ssh-key.js +74 -0
- package/dist/tools/user.js +75 -2
- package/dist/tools/volume-backups.d.ts +2 -0
- package/dist/tools/volume-backups.js +96 -0
- package/package.json +1 -1
package/dist/tools/settings.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { getTool, postTool } from './_factory.js';
|
|
3
3
|
// ── tools ────────────────────────────────────────────────────────────
|
|
4
|
+
const optionalServerId = z.string().optional().describe('Optional server ID');
|
|
5
|
+
const protocolSchema = z.enum(['tcp', 'udp', 'sctp']).describe('Port protocol');
|
|
4
6
|
const reloadServer = postTool({
|
|
5
7
|
name: 'dokploy_settings_reload_server',
|
|
6
8
|
title: 'Reload Server',
|
|
@@ -228,6 +230,231 @@ const updateTraefikFile = postTool({
|
|
|
228
230
|
.strict(),
|
|
229
231
|
endpoint: '/settings.updateTraefikFile',
|
|
230
232
|
});
|
|
233
|
+
const readTraefikEnv = getTool({
|
|
234
|
+
name: 'dokploy_settings_read_traefik_env',
|
|
235
|
+
title: 'Read Traefik Environment',
|
|
236
|
+
description: 'Read the Traefik environment configuration from Dokploy. Optionally scope the request to a specific server.',
|
|
237
|
+
schema: z
|
|
238
|
+
.object({
|
|
239
|
+
serverId: optionalServerId,
|
|
240
|
+
})
|
|
241
|
+
.strict(),
|
|
242
|
+
endpoint: '/settings.readTraefikEnv',
|
|
243
|
+
});
|
|
244
|
+
const writeTraefikEnv = postTool({
|
|
245
|
+
name: 'dokploy_settings_write_traefik_env',
|
|
246
|
+
title: 'Write Traefik Environment',
|
|
247
|
+
description: 'Write the Traefik environment configuration in Dokploy. Requires the environment content and optionally accepts a server ID.',
|
|
248
|
+
schema: z
|
|
249
|
+
.object({
|
|
250
|
+
env: z.string().describe('Traefik environment content'),
|
|
251
|
+
serverId: optionalServerId,
|
|
252
|
+
})
|
|
253
|
+
.strict(),
|
|
254
|
+
endpoint: '/settings.writeTraefikEnv',
|
|
255
|
+
});
|
|
256
|
+
const updateTraefikPorts = postTool({
|
|
257
|
+
name: 'dokploy_settings_update_traefik_ports',
|
|
258
|
+
title: 'Update Traefik Ports',
|
|
259
|
+
description: 'Update additional Traefik ports in Dokploy. Requires the list of additional ports and optionally accepts a server ID.',
|
|
260
|
+
schema: z
|
|
261
|
+
.object({
|
|
262
|
+
serverId: optionalServerId,
|
|
263
|
+
additionalPorts: z
|
|
264
|
+
.array(z
|
|
265
|
+
.object({
|
|
266
|
+
targetPort: z.number().describe('Target port'),
|
|
267
|
+
publishedPort: z.number().describe('Published port'),
|
|
268
|
+
protocol: protocolSchema,
|
|
269
|
+
})
|
|
270
|
+
.strict())
|
|
271
|
+
.describe('Additional Traefik ports'),
|
|
272
|
+
})
|
|
273
|
+
.strict(),
|
|
274
|
+
endpoint: '/settings.updateTraefikPorts',
|
|
275
|
+
});
|
|
276
|
+
const getTraefikPorts = getTool({
|
|
277
|
+
name: 'dokploy_settings_get_traefik_ports',
|
|
278
|
+
title: 'Get Traefik Ports',
|
|
279
|
+
description: 'Get Traefik ports configured in Dokploy. Optionally scope the request to a specific server.',
|
|
280
|
+
schema: z
|
|
281
|
+
.object({
|
|
282
|
+
serverId: optionalServerId,
|
|
283
|
+
})
|
|
284
|
+
.strict(),
|
|
285
|
+
endpoint: '/settings.getTraefikPorts',
|
|
286
|
+
});
|
|
287
|
+
const haveTraefikDashboardPortEnabled = getTool({
|
|
288
|
+
name: 'dokploy_settings_have_traefik_dashboard_port_enabled',
|
|
289
|
+
title: 'Check Traefik Dashboard Port',
|
|
290
|
+
description: 'Check whether the Traefik dashboard port is enabled in Dokploy. Optionally scope the request to a specific server.',
|
|
291
|
+
schema: z
|
|
292
|
+
.object({
|
|
293
|
+
serverId: optionalServerId,
|
|
294
|
+
})
|
|
295
|
+
.strict(),
|
|
296
|
+
endpoint: '/settings.haveTraefikDashboardPortEnabled',
|
|
297
|
+
});
|
|
298
|
+
const toggleDashboard = postTool({
|
|
299
|
+
name: 'dokploy_settings_toggle_dashboard',
|
|
300
|
+
title: 'Toggle Traefik Dashboard',
|
|
301
|
+
description: 'Enable or disable the Traefik dashboard in Dokploy. Optionally scope the request to a specific server.',
|
|
302
|
+
schema: z
|
|
303
|
+
.object({
|
|
304
|
+
enableDashboard: z.boolean().optional().describe('Whether to enable the dashboard'),
|
|
305
|
+
serverId: optionalServerId,
|
|
306
|
+
})
|
|
307
|
+
.strict(),
|
|
308
|
+
endpoint: '/settings.toggleDashboard',
|
|
309
|
+
});
|
|
310
|
+
const health = getTool({
|
|
311
|
+
name: 'dokploy_settings_health',
|
|
312
|
+
title: 'Get Dokploy Health',
|
|
313
|
+
description: 'Get the current health status of the Dokploy installation.',
|
|
314
|
+
schema: z.object({}).strict(),
|
|
315
|
+
endpoint: '/settings.health',
|
|
316
|
+
});
|
|
317
|
+
const getIp = getTool({
|
|
318
|
+
name: 'dokploy_settings_get_ip',
|
|
319
|
+
title: 'Get Server IP',
|
|
320
|
+
description: 'Get the server IP address known to Dokploy.',
|
|
321
|
+
schema: z.object({}).strict(),
|
|
322
|
+
endpoint: '/settings.getIp',
|
|
323
|
+
});
|
|
324
|
+
const updateServerIp = postTool({
|
|
325
|
+
name: 'dokploy_settings_update_server_ip',
|
|
326
|
+
title: 'Update Server IP',
|
|
327
|
+
description: 'Update the server IP address used by Dokploy.',
|
|
328
|
+
schema: z
|
|
329
|
+
.object({
|
|
330
|
+
serverIp: z.string().describe('Server IP address'),
|
|
331
|
+
})
|
|
332
|
+
.strict(),
|
|
333
|
+
endpoint: '/settings.updateServerIp',
|
|
334
|
+
});
|
|
335
|
+
const getWebServerSettings = getTool({
|
|
336
|
+
name: 'dokploy_settings_get_web_server_settings',
|
|
337
|
+
title: 'Get Web Server Settings',
|
|
338
|
+
description: 'Get web server settings configured in Dokploy.',
|
|
339
|
+
schema: z.object({}).strict(),
|
|
340
|
+
endpoint: '/settings.getWebServerSettings',
|
|
341
|
+
});
|
|
342
|
+
const getUpdateData = postTool({
|
|
343
|
+
name: 'dokploy_settings_get_update_data',
|
|
344
|
+
title: 'Get Update Data',
|
|
345
|
+
description: 'Get update metadata for the current Dokploy installation.',
|
|
346
|
+
schema: z.object({}).strict(),
|
|
347
|
+
endpoint: '/settings.getUpdateData',
|
|
348
|
+
});
|
|
349
|
+
const getReleaseTag = getTool({
|
|
350
|
+
name: 'dokploy_settings_get_release_tag',
|
|
351
|
+
title: 'Get Release Tag',
|
|
352
|
+
description: 'Get the latest Dokploy release tag visible to the current installation.',
|
|
353
|
+
schema: z.object({}).strict(),
|
|
354
|
+
endpoint: '/settings.getReleaseTag',
|
|
355
|
+
});
|
|
356
|
+
const cleanRedis = postTool({
|
|
357
|
+
name: 'dokploy_settings_clean_redis',
|
|
358
|
+
title: 'Clean Redis',
|
|
359
|
+
description: 'Clean Dokploy Redis data. This is a destructive maintenance action.',
|
|
360
|
+
schema: z.object({}).strict(),
|
|
361
|
+
endpoint: '/settings.cleanRedis',
|
|
362
|
+
annotations: { destructiveHint: true },
|
|
363
|
+
});
|
|
364
|
+
const reloadRedis = postTool({
|
|
365
|
+
name: 'dokploy_settings_reload_redis',
|
|
366
|
+
title: 'Reload Redis',
|
|
367
|
+
description: 'Reload Dokploy Redis.',
|
|
368
|
+
schema: z.object({}).strict(),
|
|
369
|
+
endpoint: '/settings.reloadRedis',
|
|
370
|
+
});
|
|
371
|
+
const cleanAllDeploymentQueue = postTool({
|
|
372
|
+
name: 'dokploy_settings_clean_all_deployment_queue',
|
|
373
|
+
title: 'Clean Deployment Queue',
|
|
374
|
+
description: 'Clear the Dokploy deployment queue. This is a destructive maintenance action.',
|
|
375
|
+
schema: z.object({}).strict(),
|
|
376
|
+
endpoint: '/settings.cleanAllDeploymentQueue',
|
|
377
|
+
annotations: { destructiveHint: true },
|
|
378
|
+
});
|
|
379
|
+
const updateLogCleanup = postTool({
|
|
380
|
+
name: 'dokploy_settings_update_log_cleanup',
|
|
381
|
+
title: 'Update Log Cleanup Schedule',
|
|
382
|
+
description: 'Update the Dokploy log cleanup schedule.',
|
|
383
|
+
schema: z
|
|
384
|
+
.object({
|
|
385
|
+
cronExpression: z.string().nullable().describe('Cron expression for log cleanup'),
|
|
386
|
+
})
|
|
387
|
+
.strict(),
|
|
388
|
+
endpoint: '/settings.updateLogCleanup',
|
|
389
|
+
});
|
|
390
|
+
const getLogCleanupStatus = getTool({
|
|
391
|
+
name: 'dokploy_settings_get_log_cleanup_status',
|
|
392
|
+
title: 'Get Log Cleanup Status',
|
|
393
|
+
description: 'Get the current Dokploy log cleanup configuration and status.',
|
|
394
|
+
schema: z.object({}).strict(),
|
|
395
|
+
endpoint: '/settings.getLogCleanupStatus',
|
|
396
|
+
});
|
|
397
|
+
const setupGpu = postTool({
|
|
398
|
+
name: 'dokploy_settings_setup_gpu',
|
|
399
|
+
title: 'Setup GPU',
|
|
400
|
+
description: 'Run Dokploy GPU setup. Optionally scope the request to a specific server.',
|
|
401
|
+
schema: z
|
|
402
|
+
.object({
|
|
403
|
+
serverId: optionalServerId,
|
|
404
|
+
})
|
|
405
|
+
.strict(),
|
|
406
|
+
endpoint: '/settings.setupGPU',
|
|
407
|
+
});
|
|
408
|
+
const checkGpuStatus = getTool({
|
|
409
|
+
name: 'dokploy_settings_check_gpu_status',
|
|
410
|
+
title: 'Check GPU Status',
|
|
411
|
+
description: 'Check Dokploy GPU status. Optionally scope the request to a specific server.',
|
|
412
|
+
schema: z
|
|
413
|
+
.object({
|
|
414
|
+
serverId: optionalServerId,
|
|
415
|
+
})
|
|
416
|
+
.strict(),
|
|
417
|
+
endpoint: '/settings.checkGPUStatus',
|
|
418
|
+
});
|
|
419
|
+
const isCloud = getTool({
|
|
420
|
+
name: 'dokploy_settings_is_cloud',
|
|
421
|
+
title: 'Check Cloud Mode',
|
|
422
|
+
description: 'Check whether the current Dokploy installation runs in cloud mode.',
|
|
423
|
+
schema: z.object({}).strict(),
|
|
424
|
+
endpoint: '/settings.isCloud',
|
|
425
|
+
});
|
|
426
|
+
const isUserSubscribed = getTool({
|
|
427
|
+
name: 'dokploy_settings_is_user_subscribed',
|
|
428
|
+
title: 'Check Subscription Status',
|
|
429
|
+
description: 'Check whether the current Dokploy user has an active subscription.',
|
|
430
|
+
schema: z.object({}).strict(),
|
|
431
|
+
endpoint: '/settings.isUserSubscribed',
|
|
432
|
+
});
|
|
433
|
+
const haveActivateRequests = getTool({
|
|
434
|
+
name: 'dokploy_settings_have_activate_requests',
|
|
435
|
+
title: 'Check Request Logging',
|
|
436
|
+
description: 'Check whether request handling features are enabled in Dokploy.',
|
|
437
|
+
schema: z.object({}).strict(),
|
|
438
|
+
endpoint: '/settings.haveActivateRequests',
|
|
439
|
+
});
|
|
440
|
+
const toggleRequests = postTool({
|
|
441
|
+
name: 'dokploy_settings_toggle_requests',
|
|
442
|
+
title: 'Toggle Requests',
|
|
443
|
+
description: 'Enable or disable request handling features in Dokploy.',
|
|
444
|
+
schema: z
|
|
445
|
+
.object({
|
|
446
|
+
enable: z.boolean().describe('Whether to enable requests'),
|
|
447
|
+
})
|
|
448
|
+
.strict(),
|
|
449
|
+
endpoint: '/settings.toggleRequests',
|
|
450
|
+
});
|
|
451
|
+
const getDokployCloudIps = getTool({
|
|
452
|
+
name: 'dokploy_settings_get_dokploy_cloud_ips',
|
|
453
|
+
title: 'Get Dokploy Cloud IPs',
|
|
454
|
+
description: 'Get Dokploy Cloud IP ranges.',
|
|
455
|
+
schema: z.object({}).strict(),
|
|
456
|
+
endpoint: '/settings.getDokployCloudIps',
|
|
457
|
+
});
|
|
231
458
|
// ── export ───────────────────────────────────────────────────────────
|
|
232
459
|
export const settingsTools = [
|
|
233
460
|
reloadServer,
|
|
@@ -255,4 +482,28 @@ export const settingsTools = [
|
|
|
255
482
|
getOpenApiDocument,
|
|
256
483
|
readTraefikFile,
|
|
257
484
|
updateTraefikFile,
|
|
485
|
+
readTraefikEnv,
|
|
486
|
+
writeTraefikEnv,
|
|
487
|
+
updateTraefikPorts,
|
|
488
|
+
getTraefikPorts,
|
|
489
|
+
haveTraefikDashboardPortEnabled,
|
|
490
|
+
toggleDashboard,
|
|
491
|
+
health,
|
|
492
|
+
getIp,
|
|
493
|
+
updateServerIp,
|
|
494
|
+
getWebServerSettings,
|
|
495
|
+
getUpdateData,
|
|
496
|
+
getReleaseTag,
|
|
497
|
+
cleanRedis,
|
|
498
|
+
reloadRedis,
|
|
499
|
+
cleanAllDeploymentQueue,
|
|
500
|
+
updateLogCleanup,
|
|
501
|
+
getLogCleanupStatus,
|
|
502
|
+
setupGpu,
|
|
503
|
+
checkGpuStatus,
|
|
504
|
+
isCloud,
|
|
505
|
+
isUserSubscribed,
|
|
506
|
+
haveActivateRequests,
|
|
507
|
+
toggleRequests,
|
|
508
|
+
getDokployCloudIps,
|
|
258
509
|
];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const nullableString = z.string().nullable().optional();
|
|
4
|
+
const all = getTool({
|
|
5
|
+
name: 'dokploy_ssh_key_all',
|
|
6
|
+
title: 'List SSH Keys',
|
|
7
|
+
description: 'List all SSH keys available in Dokploy. Returns stored keys together with their metadata and organization context.',
|
|
8
|
+
schema: z.object({}).strict(),
|
|
9
|
+
endpoint: '/sshKey.all',
|
|
10
|
+
});
|
|
11
|
+
const create = postTool({
|
|
12
|
+
name: 'dokploy_ssh_key_create',
|
|
13
|
+
title: 'Create SSH Key',
|
|
14
|
+
description: 'Create a new SSH key record in Dokploy. Requires the key pair and a name. Optionally set a description and organization ID.',
|
|
15
|
+
schema: z
|
|
16
|
+
.object({
|
|
17
|
+
name: z.string().min(1).describe('SSH key name'),
|
|
18
|
+
description: z.string().nullable().optional().describe('SSH key description'),
|
|
19
|
+
privateKey: z.string().describe('Private key content'),
|
|
20
|
+
publicKey: z.string().describe('Public key content'),
|
|
21
|
+
organizationId: z.string().optional().describe('Organization ID'),
|
|
22
|
+
})
|
|
23
|
+
.strict(),
|
|
24
|
+
endpoint: '/sshKey.create',
|
|
25
|
+
});
|
|
26
|
+
const generate = postTool({
|
|
27
|
+
name: 'dokploy_ssh_key_generate',
|
|
28
|
+
title: 'Generate SSH Key Pair',
|
|
29
|
+
description: 'Generate a new SSH key pair in Dokploy. Optionally specify the key type; supported values are rsa and ed25519.',
|
|
30
|
+
schema: z
|
|
31
|
+
.object({
|
|
32
|
+
type: z.enum(['rsa', 'ed25519']).optional().describe('SSH key type'),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
endpoint: '/sshKey.generate',
|
|
36
|
+
});
|
|
37
|
+
const one = getTool({
|
|
38
|
+
name: 'dokploy_ssh_key_one',
|
|
39
|
+
title: 'Get SSH Key',
|
|
40
|
+
description: 'Retrieve detailed information about a Dokploy SSH key by its ID.',
|
|
41
|
+
schema: z
|
|
42
|
+
.object({
|
|
43
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
endpoint: '/sshKey.one',
|
|
47
|
+
});
|
|
48
|
+
const remove = postTool({
|
|
49
|
+
name: 'dokploy_ssh_key_remove',
|
|
50
|
+
title: 'Remove SSH Key',
|
|
51
|
+
description: 'Permanently remove an SSH key from Dokploy. Requires the SSH key ID. This is a destructive action.',
|
|
52
|
+
schema: z
|
|
53
|
+
.object({
|
|
54
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
55
|
+
})
|
|
56
|
+
.strict(),
|
|
57
|
+
endpoint: '/sshKey.remove',
|
|
58
|
+
annotations: { destructiveHint: true },
|
|
59
|
+
});
|
|
60
|
+
const update = postTool({
|
|
61
|
+
name: 'dokploy_ssh_key_update',
|
|
62
|
+
title: 'Update SSH Key',
|
|
63
|
+
description: 'Update metadata for a Dokploy SSH key. Requires the SSH key ID and accepts optional name, description, and last-used timestamp changes.',
|
|
64
|
+
schema: z
|
|
65
|
+
.object({
|
|
66
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
67
|
+
name: z.string().min(1).optional().describe('SSH key name'),
|
|
68
|
+
description: nullableString.describe('SSH key description'),
|
|
69
|
+
lastUsedAt: nullableString.describe('Last used timestamp'),
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
endpoint: '/sshKey.update',
|
|
73
|
+
});
|
|
74
|
+
export const sshKeyTools = [all, create, generate, one, remove, update];
|
package/dist/tools/user.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { getTool } from './_factory.js';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
3
|
// ── tools ────────────────────────────────────────────────────────────
|
|
4
4
|
const all = getTool({
|
|
5
5
|
name: 'dokploy_user_all',
|
|
@@ -8,5 +8,78 @@ const all = getTool({
|
|
|
8
8
|
schema: z.object({}).strict(),
|
|
9
9
|
endpoint: '/user.all',
|
|
10
10
|
});
|
|
11
|
+
const session = getTool({
|
|
12
|
+
name: 'dokploy_user_session',
|
|
13
|
+
title: 'Get User Session',
|
|
14
|
+
description: 'Get the current authenticated user session from Dokploy, including session and identity metadata.',
|
|
15
|
+
schema: z.object({}).strict(),
|
|
16
|
+
endpoint: '/user.session',
|
|
17
|
+
});
|
|
18
|
+
const get = getTool({
|
|
19
|
+
name: 'dokploy_user_get',
|
|
20
|
+
title: 'Get Current User',
|
|
21
|
+
description: 'Get the current authenticated Dokploy user profile.',
|
|
22
|
+
schema: z.object({}).strict(),
|
|
23
|
+
endpoint: '/user.get',
|
|
24
|
+
});
|
|
25
|
+
const getPermissions = getTool({
|
|
26
|
+
name: 'dokploy_user_get_permissions',
|
|
27
|
+
title: 'Get Current User Permissions',
|
|
28
|
+
description: 'Get the current authenticated Dokploy user permissions.',
|
|
29
|
+
schema: z.object({}).strict(),
|
|
30
|
+
endpoint: '/user.getPermissions',
|
|
31
|
+
});
|
|
32
|
+
const haveRootAccess = getTool({
|
|
33
|
+
name: 'dokploy_user_have_root_access',
|
|
34
|
+
title: 'Check Root Access',
|
|
35
|
+
description: 'Check whether the current authenticated Dokploy user has root access.',
|
|
36
|
+
schema: z.object({}).strict(),
|
|
37
|
+
endpoint: '/user.haveRootAccess',
|
|
38
|
+
});
|
|
39
|
+
const createApiKey = postTool({
|
|
40
|
+
name: 'dokploy_user_create_api_key',
|
|
41
|
+
title: 'Create API Key',
|
|
42
|
+
description: 'Create a new Dokploy API key. Requires a name and organization metadata. Optionally configure expiration and rate limiting.',
|
|
43
|
+
schema: z
|
|
44
|
+
.object({
|
|
45
|
+
name: z.string().min(1).describe('API key name'),
|
|
46
|
+
prefix: z.string().optional().describe('API key prefix'),
|
|
47
|
+
expiresIn: z.number().optional().describe('Expiration interval'),
|
|
48
|
+
metadata: z
|
|
49
|
+
.object({
|
|
50
|
+
organizationId: z.string().describe('Organization ID'),
|
|
51
|
+
})
|
|
52
|
+
.strict()
|
|
53
|
+
.describe('API key metadata'),
|
|
54
|
+
rateLimitEnabled: z.boolean().optional().describe('Whether rate limiting is enabled'),
|
|
55
|
+
rateLimitTimeWindow: z.number().optional().describe('Rate limit time window'),
|
|
56
|
+
rateLimitMax: z.number().optional().describe('Rate limit max requests'),
|
|
57
|
+
remaining: z.number().optional().describe('Remaining requests'),
|
|
58
|
+
refillAmount: z.number().optional().describe('Rate limit refill amount'),
|
|
59
|
+
refillInterval: z.number().optional().describe('Rate limit refill interval'),
|
|
60
|
+
})
|
|
61
|
+
.strict(),
|
|
62
|
+
endpoint: '/user.createApiKey',
|
|
63
|
+
});
|
|
64
|
+
const deleteApiKey = postTool({
|
|
65
|
+
name: 'dokploy_user_delete_api_key',
|
|
66
|
+
title: 'Delete API Key',
|
|
67
|
+
description: 'Delete a Dokploy API key by its ID. This is a destructive action.',
|
|
68
|
+
schema: z
|
|
69
|
+
.object({
|
|
70
|
+
apiKeyId: z.string().describe('API key ID'),
|
|
71
|
+
})
|
|
72
|
+
.strict(),
|
|
73
|
+
endpoint: '/user.deleteApiKey',
|
|
74
|
+
annotations: { destructiveHint: true },
|
|
75
|
+
});
|
|
11
76
|
// ── export ───────────────────────────────────────────────────────────
|
|
12
|
-
export const userTools = [
|
|
77
|
+
export const userTools = [
|
|
78
|
+
all,
|
|
79
|
+
session,
|
|
80
|
+
get,
|
|
81
|
+
getPermissions,
|
|
82
|
+
haveRootAccess,
|
|
83
|
+
createApiKey,
|
|
84
|
+
deleteApiKey,
|
|
85
|
+
];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const serviceTypeSchema = z
|
|
4
|
+
.enum(['application', 'postgres', 'mysql', 'mariadb', 'mongo', 'redis', 'compose'])
|
|
5
|
+
.describe('Service type');
|
|
6
|
+
const nullableString = z.string().nullable().optional();
|
|
7
|
+
const nullableBoolean = z.boolean().nullable().optional();
|
|
8
|
+
const nullableNumber = z.number().nullable().optional();
|
|
9
|
+
const volumeBackupPayload = z
|
|
10
|
+
.object({
|
|
11
|
+
name: z.string().describe('Volume backup name'),
|
|
12
|
+
volumeName: z.string().describe('Docker volume name'),
|
|
13
|
+
prefix: z.string().describe('Backup file prefix'),
|
|
14
|
+
serviceType: serviceTypeSchema.optional(),
|
|
15
|
+
appName: z.string().optional().describe('App name'),
|
|
16
|
+
serviceName: nullableString.describe('Compose service name'),
|
|
17
|
+
turnOff: z.boolean().optional().describe('Whether to turn off the service during backup'),
|
|
18
|
+
cronExpression: z.string().describe('Cron expression'),
|
|
19
|
+
keepLatestCount: nullableNumber.describe('Number of backups to keep'),
|
|
20
|
+
enabled: nullableBoolean.describe('Whether the backup is enabled'),
|
|
21
|
+
applicationId: nullableString.describe('Application ID'),
|
|
22
|
+
postgresId: nullableString.describe('Postgres ID'),
|
|
23
|
+
mariadbId: nullableString.describe('MariaDB ID'),
|
|
24
|
+
mongoId: nullableString.describe('MongoDB ID'),
|
|
25
|
+
mysqlId: nullableString.describe('MySQL ID'),
|
|
26
|
+
redisId: nullableString.describe('Redis ID'),
|
|
27
|
+
composeId: nullableString.describe('Compose ID'),
|
|
28
|
+
createdAt: z.string().optional().describe('Creation timestamp'),
|
|
29
|
+
destinationId: z.string().describe('Destination ID'),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
const list = getTool({
|
|
33
|
+
name: 'dokploy_volume_backups_list',
|
|
34
|
+
title: 'List Volume Backups',
|
|
35
|
+
description: 'List volume backup configurations for a Dokploy service type. Requires the entity ID and volume backup type.',
|
|
36
|
+
schema: z
|
|
37
|
+
.object({
|
|
38
|
+
id: z.string().min(1).describe('Entity ID'),
|
|
39
|
+
volumeBackupType: serviceTypeSchema.describe('Volume backup type'),
|
|
40
|
+
})
|
|
41
|
+
.strict(),
|
|
42
|
+
endpoint: '/volumeBackups.list',
|
|
43
|
+
});
|
|
44
|
+
const one = getTool({
|
|
45
|
+
name: 'dokploy_volume_backups_one',
|
|
46
|
+
title: 'Get Volume Backup',
|
|
47
|
+
description: 'Retrieve a volume backup configuration by its ID.',
|
|
48
|
+
schema: z
|
|
49
|
+
.object({
|
|
50
|
+
volumeBackupId: z.string().min(1).describe('Volume backup ID'),
|
|
51
|
+
})
|
|
52
|
+
.strict(),
|
|
53
|
+
endpoint: '/volumeBackups.one',
|
|
54
|
+
});
|
|
55
|
+
const create = postTool({
|
|
56
|
+
name: 'dokploy_volume_backups_create',
|
|
57
|
+
title: 'Create Volume Backup',
|
|
58
|
+
description: 'Create a volume backup configuration in Dokploy. Requires the backup name, volume name, prefix, cron expression, and destination ID.',
|
|
59
|
+
schema: volumeBackupPayload,
|
|
60
|
+
endpoint: '/volumeBackups.create',
|
|
61
|
+
});
|
|
62
|
+
const update = postTool({
|
|
63
|
+
name: 'dokploy_volume_backups_update',
|
|
64
|
+
title: 'Update Volume Backup',
|
|
65
|
+
description: 'Update a volume backup configuration in Dokploy. Requires the volume backup ID together with the updated backup payload.',
|
|
66
|
+
schema: volumeBackupPayload
|
|
67
|
+
.extend({
|
|
68
|
+
volumeBackupId: z.string().min(1).describe('Volume backup ID'),
|
|
69
|
+
})
|
|
70
|
+
.strict(),
|
|
71
|
+
endpoint: '/volumeBackups.update',
|
|
72
|
+
});
|
|
73
|
+
const remove = postTool({
|
|
74
|
+
name: 'dokploy_volume_backups_delete',
|
|
75
|
+
title: 'Delete Volume Backup',
|
|
76
|
+
description: 'Delete a volume backup configuration from Dokploy. Requires the volume backup ID. This is a destructive action.',
|
|
77
|
+
schema: z
|
|
78
|
+
.object({
|
|
79
|
+
volumeBackupId: z.string().min(1).describe('Volume backup ID'),
|
|
80
|
+
})
|
|
81
|
+
.strict(),
|
|
82
|
+
endpoint: '/volumeBackups.delete',
|
|
83
|
+
annotations: { destructiveHint: true },
|
|
84
|
+
});
|
|
85
|
+
const runManually = postTool({
|
|
86
|
+
name: 'dokploy_volume_backups_run_manually',
|
|
87
|
+
title: 'Run Volume Backup Manually',
|
|
88
|
+
description: 'Trigger a volume backup immediately in Dokploy. Requires the volume backup ID.',
|
|
89
|
+
schema: z
|
|
90
|
+
.object({
|
|
91
|
+
volumeBackupId: z.string().min(1).describe('Volume backup ID'),
|
|
92
|
+
})
|
|
93
|
+
.strict(),
|
|
94
|
+
endpoint: '/volumeBackups.runManually',
|
|
95
|
+
});
|
|
96
|
+
export const volumeBackupsTools = [list, one, create, update, remove, runManually];
|