@vibetools/dokploy-mcp 0.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.
Files changed (68) hide show
  1. package/README.md +692 -0
  2. package/dist/api/client.d.ts +11 -0
  3. package/dist/api/client.js +103 -0
  4. package/dist/cli/index.d.ts +1 -0
  5. package/dist/cli/index.js +48 -0
  6. package/dist/cli/setup.d.ts +1 -0
  7. package/dist/cli/setup.js +112 -0
  8. package/dist/config/resolver.d.ts +38 -0
  9. package/dist/config/resolver.js +290 -0
  10. package/dist/config/types.d.ts +25 -0
  11. package/dist/config/types.js +33 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +25 -0
  14. package/dist/server.d.ts +2 -0
  15. package/dist/server.js +17 -0
  16. package/dist/tools/_factory.d.ts +53 -0
  17. package/dist/tools/_factory.js +86 -0
  18. package/dist/tools/admin.d.ts +2 -0
  19. package/dist/tools/admin.js +61 -0
  20. package/dist/tools/application.d.ts +2 -0
  21. package/dist/tools/application.js +464 -0
  22. package/dist/tools/auth.d.ts +2 -0
  23. package/dist/tools/auth.js +150 -0
  24. package/dist/tools/backup.d.ts +2 -0
  25. package/dist/tools/backup.js +103 -0
  26. package/dist/tools/certificates.d.ts +2 -0
  27. package/dist/tools/certificates.js +54 -0
  28. package/dist/tools/cluster.d.ts +2 -0
  29. package/dist/tools/cluster.js +38 -0
  30. package/dist/tools/compose.d.ts +2 -0
  31. package/dist/tools/compose.js +213 -0
  32. package/dist/tools/deployment.d.ts +2 -0
  33. package/dist/tools/deployment.js +27 -0
  34. package/dist/tools/destination.d.ts +2 -0
  35. package/dist/tools/destination.js +78 -0
  36. package/dist/tools/docker.d.ts +2 -0
  37. package/dist/tools/docker.js +50 -0
  38. package/dist/tools/domain.d.ts +2 -0
  39. package/dist/tools/domain.js +134 -0
  40. package/dist/tools/index.d.ts +2 -0
  41. package/dist/tools/index.js +48 -0
  42. package/dist/tools/mariadb.d.ts +2 -0
  43. package/dist/tools/mariadb.js +170 -0
  44. package/dist/tools/mongo.d.ts +2 -0
  45. package/dist/tools/mongo.js +168 -0
  46. package/dist/tools/mounts.d.ts +2 -0
  47. package/dist/tools/mounts.js +65 -0
  48. package/dist/tools/mysql.d.ts +2 -0
  49. package/dist/tools/mysql.js +170 -0
  50. package/dist/tools/port.d.ts +2 -0
  51. package/dist/tools/port.js +54 -0
  52. package/dist/tools/postgres.d.ts +2 -0
  53. package/dist/tools/postgres.js +169 -0
  54. package/dist/tools/project.d.ts +2 -0
  55. package/dist/tools/project.js +94 -0
  56. package/dist/tools/redirects.d.ts +2 -0
  57. package/dist/tools/redirects.js +53 -0
  58. package/dist/tools/redis.d.ts +2 -0
  59. package/dist/tools/redis.js +167 -0
  60. package/dist/tools/registry.d.ts +2 -0
  61. package/dist/tools/registry.js +81 -0
  62. package/dist/tools/security.d.ts +2 -0
  63. package/dist/tools/security.js +48 -0
  64. package/dist/tools/settings.d.ts +2 -0
  65. package/dist/tools/settings.js +258 -0
  66. package/dist/tools/user.d.ts +2 -0
  67. package/dist/tools/user.js +12 -0
  68. package/package.json +64 -0
@@ -0,0 +1,464 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── tools ────────────────────────────────────────────────────────────
4
+ const create = postTool({
5
+ name: 'dokploy_application_create',
6
+ title: 'Create Application',
7
+ description: 'Create a new application within a Dokploy project. Requires a project ID and application name. Optionally specify a custom app name, description, and target server for deployment. Returns the created application object with its generated ID.',
8
+ schema: z
9
+ .object({
10
+ name: z.string().min(1).describe('The name of the application'),
11
+ projectId: z.string().min(1).describe('The project ID to create the application in'),
12
+ appName: z.string().optional().describe('Custom app name (auto-generated if not provided)'),
13
+ description: z.string().nullable().optional().describe('Application description'),
14
+ serverId: z.string().nullable().optional().describe('Target server ID for deployment'),
15
+ })
16
+ .strict(),
17
+ endpoint: '/application.create',
18
+ });
19
+ const one = getTool({
20
+ name: 'dokploy_application_one',
21
+ title: 'Get Application Details',
22
+ description: 'Retrieve detailed information about a single Dokploy application by its unique ID. Returns the full application object including its configuration, build settings, source provider, environment variables, resource limits, deployment status, and associated domains.',
23
+ schema: z
24
+ .object({
25
+ applicationId: z.string().min(1).describe('The unique application ID'),
26
+ })
27
+ .strict(),
28
+ endpoint: '/application.one',
29
+ });
30
+ const update = postTool({
31
+ name: 'dokploy_application_update',
32
+ title: 'Update Application',
33
+ description: "Update an existing application's configuration in Dokploy. Requires the application ID and accepts a wide range of optional fields including name, environment variables, resource limits (CPU and memory), build settings, Docker Swarm configuration, and deployment options. Only provided fields are modified; omitted fields remain unchanged.",
34
+ schema: z
35
+ .object({
36
+ applicationId: z.string().min(1).describe('The unique application ID'),
37
+ name: z.string().optional().describe('Application name'),
38
+ appName: z.string().optional().describe('Internal app name'),
39
+ description: z.string().nullable().optional().describe('Application description'),
40
+ env: z.string().nullable().optional().describe('Environment variables'),
41
+ buildArgs: z.string().nullable().optional().describe('Docker build arguments'),
42
+ memoryReservation: z.number().nullable().optional().describe('Memory reservation in bytes'),
43
+ memoryLimit: z.number().nullable().optional().describe('Memory limit in bytes'),
44
+ cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
45
+ cpuLimit: z.number().nullable().optional().describe('CPU limit'),
46
+ title: z.string().nullable().optional().describe('Display title'),
47
+ enabled: z.boolean().optional().describe('Whether the application is enabled'),
48
+ subtitle: z.string().nullable().optional().describe('Display subtitle'),
49
+ command: z.string().nullable().optional().describe('Custom start command'),
50
+ publishDirectory: z
51
+ .string()
52
+ .nullable()
53
+ .optional()
54
+ .describe('Publish directory for static builds'),
55
+ dockerfile: z.string().nullable().optional().describe('Dockerfile path or content'),
56
+ dockerContextPath: z.string().optional().describe('Docker build context path'),
57
+ dockerBuildStage: z.string().optional().describe('Docker multi-stage build target'),
58
+ replicas: z.number().optional().describe('Number of replicas to run'),
59
+ applicationStatus: z.string().optional().describe('Application status'),
60
+ buildType: z.string().optional().describe('Build type'),
61
+ autoDeploy: z.boolean().optional().describe('Whether auto-deploy is enabled'),
62
+ createdAt: z.string().optional().describe('Creation timestamp'),
63
+ registryId: z.string().nullable().optional().describe('Docker registry ID'),
64
+ projectId: z.string().optional().describe('Project ID'),
65
+ sourceType: z.string().optional().describe('Source type (github, docker, git, etc.)'),
66
+ healthCheckSwarm: z
67
+ .record(z.string(), z.any())
68
+ .nullable()
69
+ .optional()
70
+ .describe('Swarm health check configuration'),
71
+ restartPolicySwarm: z
72
+ .record(z.string(), z.any())
73
+ .nullable()
74
+ .optional()
75
+ .describe('Swarm restart policy configuration'),
76
+ placementSwarm: z
77
+ .record(z.string(), z.any())
78
+ .nullable()
79
+ .optional()
80
+ .describe('Swarm placement configuration'),
81
+ updateConfigSwarm: z
82
+ .record(z.string(), z.any())
83
+ .nullable()
84
+ .optional()
85
+ .describe('Swarm update configuration'),
86
+ rollbackConfigSwarm: z
87
+ .record(z.string(), z.any())
88
+ .nullable()
89
+ .optional()
90
+ .describe('Swarm rollback configuration'),
91
+ modeSwarm: z
92
+ .record(z.string(), z.any())
93
+ .nullable()
94
+ .optional()
95
+ .describe('Swarm mode configuration'),
96
+ labelsSwarm: z
97
+ .record(z.string(), z.any())
98
+ .nullable()
99
+ .optional()
100
+ .describe('Swarm labels configuration'),
101
+ networkSwarm: z.array(z.any()).nullable().optional().describe('Swarm network configuration'),
102
+ resourcesSwarm: z
103
+ .record(z.string(), z.any())
104
+ .nullable()
105
+ .optional()
106
+ .describe('Swarm resources configuration'),
107
+ })
108
+ .strict(),
109
+ endpoint: '/application.update',
110
+ });
111
+ const deleteApp = postTool({
112
+ name: 'dokploy_application_delete',
113
+ title: 'Delete Application',
114
+ description: 'Permanently delete an application from Dokploy. This action is irreversible and will remove all associated data including deployments, logs, environment variables, and domain configurations. Requires the application ID.',
115
+ schema: z
116
+ .object({
117
+ applicationId: z.string().min(1).describe('The unique application ID to delete'),
118
+ })
119
+ .strict(),
120
+ endpoint: '/application.delete',
121
+ annotations: { destructiveHint: true },
122
+ });
123
+ const move = postTool({
124
+ name: 'dokploy_application_move',
125
+ title: 'Move Application',
126
+ description: 'Move an application from its current project to a different Dokploy project. Requires both the application ID and the target project ID. The application retains all its configuration and deployment settings after the move.',
127
+ schema: z
128
+ .object({
129
+ applicationId: z.string().min(1).describe('The unique application ID to move'),
130
+ targetProjectId: z.string().min(1).describe('The target project ID'),
131
+ })
132
+ .strict(),
133
+ endpoint: '/application.move',
134
+ });
135
+ const deploy = postTool({
136
+ name: 'dokploy_application_deploy',
137
+ title: 'Deploy Application',
138
+ description: 'Trigger a new deployment for an application in Dokploy. Builds the application from its configured source (GitHub, Docker image, Git, etc.) and deploys it to the target server. Requires the application ID. Returns deployment status information.',
139
+ schema: z
140
+ .object({
141
+ applicationId: z.string().min(1).describe('The unique application ID to deploy'),
142
+ })
143
+ .strict(),
144
+ endpoint: '/application.deploy',
145
+ });
146
+ const redeploy = postTool({
147
+ name: 'dokploy_application_redeploy',
148
+ title: 'Redeploy Application',
149
+ description: 'Force a full redeploy of an application in Dokploy, rebuilding it from source and restarting all containers. Unlike a regular deploy, this always triggers a fresh build regardless of whether the source has changed. Requires the application ID.',
150
+ schema: z
151
+ .object({
152
+ applicationId: z.string().min(1).describe('The unique application ID to redeploy'),
153
+ })
154
+ .strict(),
155
+ endpoint: '/application.redeploy',
156
+ });
157
+ const start = postTool({
158
+ name: 'dokploy_application_start',
159
+ title: 'Start Application',
160
+ description: 'Start a previously stopped application in Dokploy. Brings up the application containers using the last successful deployment configuration. Requires the application ID. The application must have been deployed at least once before it can be started.',
161
+ schema: z
162
+ .object({
163
+ applicationId: z.string().min(1).describe('The unique application ID to start'),
164
+ })
165
+ .strict(),
166
+ endpoint: '/application.start',
167
+ });
168
+ const stop = postTool({
169
+ name: 'dokploy_application_stop',
170
+ title: 'Stop Application',
171
+ description: 'Stop a running application in Dokploy, shutting down all its containers. The application configuration and data are preserved and it can be restarted later. Requires the application ID. This is a destructive action as it causes downtime.',
172
+ schema: z
173
+ .object({
174
+ applicationId: z.string().min(1).describe('The unique application ID to stop'),
175
+ })
176
+ .strict(),
177
+ endpoint: '/application.stop',
178
+ annotations: { destructiveHint: true },
179
+ });
180
+ const cancelDeployment = postTool({
181
+ name: 'dokploy_application_cancel_deployment',
182
+ title: 'Cancel Deployment',
183
+ description: 'Cancel an in-progress deployment for an application in Dokploy. Stops the current build or deployment process and leaves the application in its previous state. Requires the application ID. Useful when a deployment is stuck or was triggered accidentally.',
184
+ schema: z
185
+ .object({
186
+ applicationId: z.string().min(1).describe('The unique application ID'),
187
+ })
188
+ .strict(),
189
+ endpoint: '/application.cancelDeployment',
190
+ });
191
+ const reload = postTool({
192
+ name: 'dokploy_application_reload',
193
+ title: 'Reload Application',
194
+ description: 'Reload an application in Dokploy without performing a full redeploy. Restarts the application containers using the existing built image, which is faster than a complete rebuild. Requires both the application ID and the app name.',
195
+ schema: z
196
+ .object({
197
+ applicationId: z.string().min(1).describe('The unique application ID'),
198
+ appName: z.string().min(1).describe('The app name to reload'),
199
+ })
200
+ .strict(),
201
+ endpoint: '/application.reload',
202
+ });
203
+ const markRunning = postTool({
204
+ name: 'dokploy_application_mark_running',
205
+ title: 'Mark Application Running',
206
+ description: 'Manually mark an application as running in Dokploy. This is an administrative action used to correct the application status when it becomes out of sync with the actual container state. Requires the application ID.',
207
+ schema: z
208
+ .object({
209
+ applicationId: z.string().min(1).describe('The unique application ID'),
210
+ })
211
+ .strict(),
212
+ endpoint: '/application.markRunning',
213
+ });
214
+ const cleanQueues = postTool({
215
+ name: 'dokploy_application_clean_queues',
216
+ title: 'Clean Deployment Queues',
217
+ description: 'Clean the deployment queues for an application in Dokploy. Removes any pending or stuck deployment jobs from the queue. Requires the application ID. Useful when deployments are queued but not processing correctly.',
218
+ schema: z
219
+ .object({
220
+ applicationId: z.string().min(1).describe('The unique application ID'),
221
+ })
222
+ .strict(),
223
+ endpoint: '/application.cleanQueues',
224
+ annotations: { destructiveHint: true },
225
+ });
226
+ const refreshToken = postTool({
227
+ name: 'dokploy_application_refresh_token',
228
+ title: 'Refresh Webhook Token',
229
+ description: 'Refresh the webhook token for an application in Dokploy. Generates a new unique token used for triggering deployments via webhook URLs. The previous token will be invalidated immediately. Requires the application ID.',
230
+ schema: z
231
+ .object({
232
+ applicationId: z.string().min(1).describe('The unique application ID'),
233
+ })
234
+ .strict(),
235
+ endpoint: '/application.refreshToken',
236
+ });
237
+ const saveBuildType = postTool({
238
+ name: 'dokploy_application_save_build_type',
239
+ title: 'Save Build Type',
240
+ description: 'Set the build type and related build settings for an application in Dokploy. Requires the application ID and a build type (dockerfile, heroku, nixpacks, buildpacks, or docker). Optionally configure the Docker build context path and multi-stage build target stage.',
241
+ schema: z
242
+ .object({
243
+ applicationId: z.string().min(1).describe('The unique application ID'),
244
+ buildType: z
245
+ .enum(['dockerfile', 'heroku', 'nixpacks', 'buildpacks', 'docker'])
246
+ .describe('The build type to use'),
247
+ dockerContextPath: z.string().optional().describe('Docker build context path'),
248
+ dockerBuildStage: z.string().optional().describe('Docker multi-stage build target'),
249
+ })
250
+ .strict(),
251
+ endpoint: '/application.saveBuildType',
252
+ });
253
+ const saveEnvironment = postTool({
254
+ name: 'dokploy_application_save_environment',
255
+ title: 'Save Environment Variables',
256
+ description: 'Save environment variables and Docker build arguments for an application in Dokploy. Requires the application ID. Environment variables are set at runtime while build arguments are available during the Docker build process. Both fields accept newline-separated key=value pairs.',
257
+ schema: z
258
+ .object({
259
+ applicationId: z.string().min(1).describe('The unique application ID'),
260
+ env: z.string().nullable().optional().describe('Environment variables'),
261
+ buildArgs: z.string().nullable().optional().describe('Docker build arguments'),
262
+ })
263
+ .strict(),
264
+ endpoint: '/application.saveEnvironment',
265
+ });
266
+ const saveGithubProvider = postTool({
267
+ name: 'dokploy_application_save_github_provider',
268
+ title: 'Configure GitHub Provider',
269
+ description: 'Configure a GitHub repository as the source for an application in Dokploy. Requires the application ID and the GitHub repository owner. Optionally specify the repository name, branch, build path, GitHub App installation ID, submodule support, watch paths for auto-deploy, and trigger type (push or tag).',
270
+ schema: z
271
+ .object({
272
+ applicationId: z.string().min(1).describe('The unique application ID'),
273
+ owner: z.string().min(1).describe('GitHub repository owner'),
274
+ repository: z.string().optional().describe('GitHub repository name'),
275
+ branch: z.string().optional().describe('Branch to deploy from'),
276
+ buildPath: z.string().optional().describe('Build path within the repo'),
277
+ githubId: z.number().optional().describe('GitHub App installation ID'),
278
+ enableSubmodules: z.boolean().optional().describe('Whether to initialize git submodules'),
279
+ watchPaths: z
280
+ .array(z.string())
281
+ .optional()
282
+ .describe('Paths to watch for auto-deploy triggers'),
283
+ triggerType: z
284
+ .enum(['push', 'tag'])
285
+ .optional()
286
+ .describe('Event type that triggers deployment'),
287
+ })
288
+ .strict(),
289
+ endpoint: '/application.saveGithubProvider',
290
+ });
291
+ const saveGitlabProvider = postTool({
292
+ name: 'dokploy_application_save_gitlab_provider',
293
+ title: 'Configure GitLab Provider',
294
+ description: 'Configure a GitLab repository as the source for an application in Dokploy. Requires the application ID. Optionally specify the GitLab branch, build path, repository owner and name, integration ID, project ID, path namespace, submodule support, and watch paths for auto-deploy triggers.',
295
+ schema: z
296
+ .object({
297
+ applicationId: z.string().min(1).describe('The unique application ID'),
298
+ gitlabBranch: z.string().optional().describe('GitLab branch'),
299
+ gitlabBuildPath: z.string().optional().describe('Build path within the repo'),
300
+ gitlabOwner: z.string().optional().describe('GitLab repository owner'),
301
+ gitlabRepository: z.string().optional().describe('GitLab repository name'),
302
+ gitlabId: z.number().optional().describe('GitLab integration ID'),
303
+ gitlabProjectId: z.number().optional().describe('GitLab project ID'),
304
+ gitlabPathNamespace: z.string().optional().describe('GitLab path namespace'),
305
+ enableSubmodules: z.boolean().optional().describe('Whether to initialize git submodules'),
306
+ watchPaths: z
307
+ .array(z.string())
308
+ .optional()
309
+ .describe('Paths to watch for auto-deploy triggers'),
310
+ })
311
+ .strict(),
312
+ endpoint: '/application.saveGitlabProvider',
313
+ });
314
+ const saveBitbucketProvider = postTool({
315
+ name: 'dokploy_application_save_bitbucket_provider',
316
+ title: 'Configure Bitbucket Provider',
317
+ description: 'Configure a Bitbucket repository as the source for an application in Dokploy. Requires the application ID. Optionally specify the Bitbucket branch, build path, repository owner and name, integration ID, submodule support, and watch paths for auto-deploy triggers.',
318
+ schema: z
319
+ .object({
320
+ applicationId: z.string().min(1).describe('The unique application ID'),
321
+ bitbucketBranch: z.string().optional().describe('Bitbucket branch'),
322
+ bitbucketBuildPath: z.string().optional().describe('Build path within the repo'),
323
+ bitbucketOwner: z.string().optional().describe('Bitbucket repository owner'),
324
+ bitbucketRepository: z.string().optional().describe('Bitbucket repository name'),
325
+ bitbucketId: z.string().optional().describe('Bitbucket integration ID'),
326
+ enableSubmodules: z.boolean().optional().describe('Whether to initialize git submodules'),
327
+ watchPaths: z
328
+ .array(z.string())
329
+ .optional()
330
+ .describe('Paths to watch for auto-deploy triggers'),
331
+ })
332
+ .strict(),
333
+ endpoint: '/application.saveBitbucketProvider',
334
+ });
335
+ const saveGiteaProvider = postTool({
336
+ name: 'dokploy_application_save_gitea_provider',
337
+ title: 'Configure Gitea Provider',
338
+ description: 'Configure a Gitea repository as the source for an application in Dokploy. Requires the application ID. Optionally specify the Gitea branch, build path, repository owner and name, integration ID, submodule support, and watch paths for auto-deploy triggers.',
339
+ schema: z
340
+ .object({
341
+ applicationId: z.string().min(1).describe('The unique application ID'),
342
+ giteaBranch: z.string().optional().describe('Gitea branch'),
343
+ giteaBuildPath: z.string().optional().describe('Build path within the repo'),
344
+ giteaOwner: z.string().optional().describe('Gitea repository owner'),
345
+ giteaRepository: z.string().optional().describe('Gitea repository name'),
346
+ giteaId: z.number().optional().describe('Gitea integration ID'),
347
+ enableSubmodules: z.boolean().optional().describe('Whether to initialize git submodules'),
348
+ watchPaths: z
349
+ .array(z.string())
350
+ .optional()
351
+ .describe('Paths to watch for auto-deploy triggers'),
352
+ })
353
+ .strict(),
354
+ endpoint: '/application.saveGiteaProvider',
355
+ });
356
+ const saveGitProvider = postTool({
357
+ name: 'dokploy_application_save_git_provider',
358
+ title: 'Configure Custom Git Provider',
359
+ description: 'Configure a custom Git repository as the source for an application in Dokploy. Requires the application ID. Optionally specify the Git URL, branch, build path, SSH key ID for authentication, submodule support, and watch paths for auto-deploy triggers. Supports any Git-compatible repository.',
360
+ schema: z
361
+ .object({
362
+ applicationId: z.string().min(1).describe('The unique application ID'),
363
+ customGitUrl: z.string().optional().describe('Custom Git repository URL'),
364
+ customGitBranch: z.string().optional().describe('Branch to deploy from'),
365
+ customGitBuildPath: z.string().optional().describe('Build path within the repo'),
366
+ customGitSSHKeyId: z.string().nullable().optional().describe('SSH key ID for authentication'),
367
+ enableSubmodules: z.boolean().optional().describe('Whether to initialize git submodules'),
368
+ watchPaths: z
369
+ .array(z.string())
370
+ .optional()
371
+ .describe('Paths to watch for auto-deploy triggers'),
372
+ })
373
+ .strict(),
374
+ endpoint: '/application.saveGitProvider',
375
+ });
376
+ const saveDockerProvider = postTool({
377
+ name: 'dokploy_application_save_docker_provider',
378
+ title: 'Configure Docker Provider',
379
+ description: 'Configure a Docker image as the source for an application in Dokploy. Requires the application ID and a Docker image name (e.g., nginx:latest). Optionally provide registry credentials (username and password) for pulling from private registries.',
380
+ schema: z
381
+ .object({
382
+ applicationId: z.string().min(1).describe('The unique application ID'),
383
+ dockerImage: z.string().min(1).describe('Docker image name (e.g., nginx:latest)'),
384
+ username: z.string().optional().describe('Registry username for private images'),
385
+ password: z.string().optional().describe('Registry password for private images'),
386
+ })
387
+ .strict(),
388
+ endpoint: '/application.saveDockerProvider',
389
+ });
390
+ const disconnectGitProvider = postTool({
391
+ name: 'dokploy_application_disconnect_git_provider',
392
+ title: 'Disconnect Git Provider',
393
+ description: 'Disconnect the current Git provider from an application in Dokploy. Removes the source repository configuration (GitHub, GitLab, Bitbucket, Gitea, or custom Git) from the application. Requires the application ID. The application will need a new source configured before it can be deployed again.',
394
+ schema: z
395
+ .object({
396
+ applicationId: z.string().min(1).describe('The unique application ID'),
397
+ })
398
+ .strict(),
399
+ endpoint: '/application.disconnectGitProvider',
400
+ annotations: { destructiveHint: true },
401
+ });
402
+ const readAppMonitoring = getTool({
403
+ name: 'dokploy_application_read_app_monitoring',
404
+ title: 'Read Application Monitoring',
405
+ description: 'Read monitoring data for an application in Dokploy. Returns resource usage metrics including CPU utilization, memory consumption, network I/O, and disk usage. Requires the app name (not the application ID). Useful for monitoring application health and performance.',
406
+ schema: z
407
+ .object({
408
+ appName: z.string().min(1).describe('The app name to read monitoring for'),
409
+ })
410
+ .strict(),
411
+ endpoint: '/application.readAppMonitoring',
412
+ });
413
+ const readTraefikConfig = getTool({
414
+ name: 'dokploy_application_read_traefik_config',
415
+ title: 'Read Traefik Configuration',
416
+ description: 'Read the Traefik reverse proxy configuration for an application in Dokploy. Returns the current Traefik routing rules, middleware settings, and TLS configuration associated with the application. Requires the application ID.',
417
+ schema: z
418
+ .object({
419
+ applicationId: z.string().min(1).describe('The unique application ID'),
420
+ })
421
+ .strict(),
422
+ endpoint: '/application.readTraefikConfig',
423
+ });
424
+ const updateTraefikConfig = postTool({
425
+ name: 'dokploy_application_update_traefik_config',
426
+ title: 'Update Traefik Configuration',
427
+ description: 'Update the Traefik reverse proxy configuration for an application in Dokploy. Requires the application ID and the new Traefik configuration content as a string. Allows customization of routing rules, middleware, TLS settings, and other Traefik-specific options.',
428
+ schema: z
429
+ .object({
430
+ applicationId: z.string().min(1).describe('The unique application ID'),
431
+ traefikConfig: z.string().min(1).describe('The new Traefik configuration content'),
432
+ })
433
+ .strict(),
434
+ endpoint: '/application.updateTraefikConfig',
435
+ });
436
+ // ── export ───────────────────────────────────────────────────────────
437
+ export const applicationTools = [
438
+ create,
439
+ one,
440
+ update,
441
+ deleteApp,
442
+ move,
443
+ deploy,
444
+ redeploy,
445
+ start,
446
+ stop,
447
+ cancelDeployment,
448
+ reload,
449
+ markRunning,
450
+ cleanQueues,
451
+ refreshToken,
452
+ saveBuildType,
453
+ saveEnvironment,
454
+ saveGithubProvider,
455
+ saveGitlabProvider,
456
+ saveBitbucketProvider,
457
+ saveGiteaProvider,
458
+ saveGitProvider,
459
+ saveDockerProvider,
460
+ disconnectGitProvider,
461
+ readAppMonitoring,
462
+ readTraefikConfig,
463
+ updateTraefikConfig,
464
+ ];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const authTools: ToolDefinition[];
@@ -0,0 +1,150 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── tools ────────────────────────────────────────────────────────────
4
+ const createAdmin = postTool({
5
+ name: 'dokploy_auth_create_admin',
6
+ title: 'Create Admin Account',
7
+ description: 'Create the initial admin account for a fresh Dokploy installation. Requires an email address and a password (minimum 8 characters). This should only be called once during initial setup. Returns the created admin account details.',
8
+ schema: z.object({
9
+ email: z.string().email().describe('Email address for the admin account'),
10
+ password: z.string().min(8).describe('Password for the admin account (min 8 characters)'),
11
+ }).strict(),
12
+ endpoint: '/auth.createAdmin',
13
+ });
14
+ const createUser = postTool({
15
+ name: 'dokploy_auth_create_user',
16
+ title: 'Create User Account',
17
+ description: 'Create a new user account from an invitation token and password. The user must have received an invitation email containing a token and ID. Requires the invitation token, user/invitation ID, and a password (minimum 8 characters). Returns the created user account details.',
18
+ schema: z.object({
19
+ password: z.string().min(8).describe('Password for the new user (min 8 characters)'),
20
+ id: z.string().min(1).describe('The invitation or user ID'),
21
+ token: z.string().min(1).describe('The invitation token'),
22
+ }).strict(),
23
+ endpoint: '/auth.createUser',
24
+ });
25
+ const login = postTool({
26
+ name: 'dokploy_auth_login',
27
+ title: 'Login',
28
+ description: 'Log in to Dokploy with an email address and password. If the account has two-factor authentication enabled, a subsequent call to verify_login_2fa will be required. Returns a session token or a 2FA challenge depending on account configuration.',
29
+ schema: z.object({
30
+ email: z.string().email().describe('Email address of the account'),
31
+ password: z.string().min(8).describe('Account password (min 8 characters)'),
32
+ }).strict(),
33
+ endpoint: '/auth.login',
34
+ });
35
+ const get = getTool({
36
+ name: 'dokploy_auth_get',
37
+ title: 'Get Current User',
38
+ description: "Get the currently authenticated user's profile information. No parameters required. Returns the user's email, role, 2FA status, and other profile fields associated with the active session.",
39
+ schema: z.object({}).strict(),
40
+ endpoint: '/auth.get',
41
+ });
42
+ const logout = postTool({
43
+ name: 'dokploy_auth_logout',
44
+ title: 'Logout',
45
+ description: 'Log out the current user session and invalidate the active authentication token. No parameters required. Returns a confirmation that the session has been terminated.',
46
+ schema: z.object({}).strict(),
47
+ endpoint: '/auth.logout',
48
+ });
49
+ const update = postTool({
50
+ name: 'dokploy_auth_update',
51
+ title: 'Update Current User',
52
+ description: "Update the currently authenticated user's profile information. Accepts optional fields including email, password, role, profile image URL, and 2FA enabled status. Fields set to null will be cleared. Returns the updated user profile.",
53
+ schema: z.object({
54
+ email: z.string().email().nullable().describe('New email address, or null to clear'),
55
+ password: z.string().nullable().describe('New password, or null to keep current'),
56
+ id: z.string().min(1).optional().describe('The auth ID to update'),
57
+ rol: z.enum(['admin', 'user']).optional().describe('Role to assign: admin or user'),
58
+ image: z.string().optional().describe('Profile image URL'),
59
+ is2FAEnabled: z.boolean().optional().describe('Whether two-factor authentication is enabled'),
60
+ }).strict(),
61
+ endpoint: '/auth.update',
62
+ });
63
+ const generateToken = postTool({
64
+ name: 'dokploy_auth_generate_token',
65
+ title: 'Generate API Token',
66
+ description: 'Generate a new API token for the currently authenticated user. The token can be used for programmatic API access via the x-api-key header. No parameters required. Returns the generated token string.',
67
+ schema: z.object({}).strict(),
68
+ endpoint: '/auth.generateToken',
69
+ });
70
+ const one = getTool({
71
+ name: 'dokploy_auth_one',
72
+ title: 'Get User Auth Info',
73
+ description: "Get a specific user's authentication information by their auth ID. Requires the auth ID of the target user. Returns the user's email, role, 2FA status, and other auth-related fields.",
74
+ schema: z.object({
75
+ id: z.string().min(1).describe('The auth ID of the user to retrieve'),
76
+ }).strict(),
77
+ endpoint: '/auth.one',
78
+ });
79
+ const updateByAdmin = postTool({
80
+ name: 'dokploy_auth_update_by_admin',
81
+ title: 'Update User as Admin',
82
+ description: "Update any user's profile information with admin privileges. Requires the target user's auth ID and accepts fields including email, password, role, profile image URL, and 2FA enabled status. Fields set to null will be cleared. Returns the updated user profile.",
83
+ schema: z.object({
84
+ id: z.string().min(1).describe('The auth ID of the user to update'),
85
+ email: z.string().email().nullable().describe('New email address, or null to clear'),
86
+ password: z.string().nullable().describe('New password, or null to keep current'),
87
+ rol: z.enum(['admin', 'user']).optional().describe('Role to assign: admin or user'),
88
+ image: z.string().optional().describe('Profile image URL'),
89
+ is2FAEnabled: z.boolean().optional().describe('Whether two-factor authentication is enabled'),
90
+ }).strict(),
91
+ endpoint: '/auth.updateByAdmin',
92
+ });
93
+ const generate2FASecret = getTool({
94
+ name: 'dokploy_auth_generate_2fa_secret',
95
+ title: 'Generate 2FA Secret',
96
+ description: 'Generate a new two-factor authentication secret for the current user. This is the first step in setting up 2FA with an authenticator app. No parameters required. Returns the secret key and a QR code URL that can be scanned by an authenticator app.',
97
+ schema: z.object({}).strict(),
98
+ endpoint: '/auth.generate2FASecret',
99
+ });
100
+ const verify2FASetup = postTool({
101
+ name: 'dokploy_auth_verify_2fa_setup',
102
+ title: 'Verify 2FA Setup',
103
+ description: 'Verify and complete the two-factor authentication setup by providing a PIN from the authenticator app. Requires the 6-digit PIN and the 2FA secret that was generated during setup. Returns a confirmation that 2FA has been successfully enabled on the account.',
104
+ schema: z.object({
105
+ pin: z.string().min(6).describe('The 6-digit PIN from the authenticator app'),
106
+ secret: z.string().min(1).describe('The 2FA secret to verify against'),
107
+ }).strict(),
108
+ endpoint: '/auth.verify2FASetup',
109
+ });
110
+ const verifyLogin2FA = postTool({
111
+ name: 'dokploy_auth_verify_login_2fa',
112
+ title: 'Verify 2FA Login',
113
+ description: 'Verify a two-factor authentication PIN during the login process. This is called after a successful login attempt on an account with 2FA enabled. Requires the 6-digit PIN from the authenticator app and the auth ID of the user. Returns the authenticated session token.',
114
+ schema: z.object({
115
+ pin: z.string().min(6).describe('The 6-digit PIN from the authenticator app'),
116
+ id: z.string().min(1).describe('The auth ID of the user logging in'),
117
+ }).strict(),
118
+ endpoint: '/auth.verifyLogin2FA',
119
+ });
120
+ const disable2FA = postTool({
121
+ name: 'dokploy_auth_disable_2fa',
122
+ title: 'Disable 2FA',
123
+ description: "Disable two-factor authentication for the currently authenticated user's account. No parameters required. Returns a confirmation that 2FA has been removed from the account. Future logins will no longer require a 2FA PIN.",
124
+ schema: z.object({}).strict(),
125
+ endpoint: '/auth.disable2FA',
126
+ });
127
+ const verifyToken = postTool({
128
+ name: 'dokploy_auth_verify_token',
129
+ title: 'Verify Auth Token',
130
+ description: 'Verify the validity of the current authentication token. No parameters required. Returns whether the token is valid and has not expired. Useful for checking if a session is still active before making other API calls.',
131
+ schema: z.object({}).strict(),
132
+ endpoint: '/auth.verifyToken',
133
+ });
134
+ // ── export ───────────────────────────────────────────────────────────
135
+ export const authTools = [
136
+ createAdmin,
137
+ createUser,
138
+ login,
139
+ get,
140
+ logout,
141
+ update,
142
+ generateToken,
143
+ one,
144
+ updateByAdmin,
145
+ generate2FASecret,
146
+ verify2FASetup,
147
+ verifyLogin2FA,
148
+ disable2FA,
149
+ verifyToken,
150
+ ];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const backupTools: ToolDefinition[];