@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,134 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── tools ────────────────────────────────────────────────────────────
4
+ const create = postTool({
5
+ name: 'dokploy_domain_create',
6
+ title: 'Create Domain',
7
+ description: 'Create a new domain configuration for an application or compose service. Requires the hostname, HTTPS setting, and certificate type. Optionally specify path-based routing, a target port, and the application or compose service to attach it to. Returns the created domain object.',
8
+ schema: z
9
+ .object({
10
+ host: z.string().min(1).describe('The domain hostname (e.g., app.example.com)'),
11
+ https: z.boolean().describe('Whether to enable HTTPS'),
12
+ certificateType: z.enum(['letsencrypt', 'none', 'custom']).describe('SSL certificate type'),
13
+ stripPath: z.boolean().describe('Whether to strip the path prefix when forwarding'),
14
+ path: z.string().optional().describe('URL path prefix for routing'),
15
+ port: z.number().nullable().optional().describe('Target port on the container'),
16
+ applicationId: z.string().optional().describe('Application ID to attach the domain to'),
17
+ composeId: z.string().optional().describe('Compose service ID to attach the domain to'),
18
+ serviceName: z.string().optional().describe('Service name within a compose deployment'),
19
+ customCertResolver: z
20
+ .string()
21
+ .nullable()
22
+ .optional()
23
+ .describe('Custom certificate resolver name'),
24
+ domainType: z.string().optional().describe('Domain type'),
25
+ previewDeploymentId: z.string().optional().describe('Preview deployment ID'),
26
+ internalPath: z.string().optional().describe('Internal path for routing'),
27
+ })
28
+ .strict(),
29
+ endpoint: '/domain.create',
30
+ });
31
+ const one = getTool({
32
+ name: 'dokploy_domain_one',
33
+ title: 'Get Domain',
34
+ description: 'Get detailed information about a single domain by its ID. Returns the full domain configuration including hostname, HTTPS settings, certificate type, routing rules, and the associated application or compose service.',
35
+ schema: z
36
+ .object({
37
+ domainId: z.string().min(1).describe('The unique domain ID'),
38
+ })
39
+ .strict(),
40
+ endpoint: '/domain.one',
41
+ });
42
+ const byApplicationId = getTool({
43
+ name: 'dokploy_domain_by_application_id',
44
+ title: 'List Domains by Application',
45
+ description: 'List all domains attached to a specific application. Requires the application ID. Returns an array of domain objects with their hostnames, HTTPS settings, certificate types, and routing configurations.',
46
+ schema: z
47
+ .object({
48
+ applicationId: z.string().min(1).describe('The unique application ID'),
49
+ })
50
+ .strict(),
51
+ endpoint: '/domain.byApplicationId',
52
+ });
53
+ const byComposeId = getTool({
54
+ name: 'dokploy_domain_by_compose_id',
55
+ title: 'List Domains by Compose Service',
56
+ description: 'List all domains attached to a specific compose service. Requires the compose service ID. Returns an array of domain objects with their hostnames, HTTPS settings, certificate types, and routing configurations.',
57
+ schema: z
58
+ .object({
59
+ composeId: z.string().min(1).describe('The unique compose service ID'),
60
+ })
61
+ .strict(),
62
+ endpoint: '/domain.byComposeId',
63
+ });
64
+ const update = postTool({
65
+ name: 'dokploy_domain_update',
66
+ title: 'Update Domain',
67
+ description: 'Update an existing domain configuration. Requires the domain ID along with the hostname, HTTPS setting, certificate type, and strip path option. Optionally modify the path prefix, port, certificate resolver, service name, and routing settings. Returns the updated domain object.',
68
+ schema: z
69
+ .object({
70
+ domainId: z.string().min(1).describe('The unique domain ID'),
71
+ host: z.string().min(1).describe('The domain hostname'),
72
+ https: z.boolean().describe('Whether to enable HTTPS'),
73
+ certificateType: z.enum(['letsencrypt', 'none', 'custom']).describe('SSL certificate type'),
74
+ stripPath: z.boolean().describe('Whether to strip the path prefix'),
75
+ path: z.string().optional().describe('URL path prefix for routing'),
76
+ port: z.number().nullable().optional().describe('Target port on the container'),
77
+ customCertResolver: z
78
+ .string()
79
+ .nullable()
80
+ .optional()
81
+ .describe('Custom certificate resolver name'),
82
+ serviceName: z.string().optional().describe('Service name within a compose deployment'),
83
+ domainType: z.string().optional().describe('Domain type'),
84
+ internalPath: z.string().optional().describe('Internal path for routing'),
85
+ })
86
+ .strict(),
87
+ endpoint: '/domain.update',
88
+ });
89
+ const deleteDomain = postTool({
90
+ name: 'dokploy_domain_delete',
91
+ title: 'Delete Domain',
92
+ description: 'Permanently delete a domain configuration. This removes the domain routing and any associated SSL certificates. This action is irreversible. Requires the domain ID.',
93
+ schema: z
94
+ .object({
95
+ domainId: z.string().min(1).describe('The unique domain ID to delete'),
96
+ })
97
+ .strict(),
98
+ endpoint: '/domain.delete',
99
+ annotations: { destructiveHint: true },
100
+ });
101
+ const validateDomain = postTool({
102
+ name: 'dokploy_domain_validate',
103
+ title: 'Validate Domain DNS',
104
+ description: "Validate that a domain's DNS records are correctly configured and pointing to the expected server. Requires the domain name and optionally accepts the expected server IP address. Returns the validation result indicating whether DNS resolution matches.",
105
+ schema: z
106
+ .object({
107
+ domain: z.string().min(1).describe('The domain name to validate'),
108
+ serverIp: z.string().optional().describe('Expected server IP address for DNS validation'),
109
+ })
110
+ .strict(),
111
+ endpoint: '/domain.validateDomain',
112
+ });
113
+ const generateDomain = postTool({
114
+ name: 'dokploy_domain_generate',
115
+ title: 'Generate Domain',
116
+ description: "Generate a default domain for an application using the server's configured base domain. This automatically creates and attaches a subdomain to the specified application. Requires the application ID. Returns the generated domain configuration.",
117
+ schema: z
118
+ .object({
119
+ applicationId: z.string().min(1).describe('The unique application ID'),
120
+ })
121
+ .strict(),
122
+ endpoint: '/domain.generateDomain',
123
+ });
124
+ // ── export ───────────────────────────────────────────────────────────
125
+ export const domainTools = [
126
+ create,
127
+ one,
128
+ byApplicationId,
129
+ byComposeId,
130
+ update,
131
+ deleteDomain,
132
+ validateDomain,
133
+ generateDomain,
134
+ ];
@@ -0,0 +1,2 @@
1
+ import type { ToolDefinition } from './_factory.js';
2
+ export declare const allTools: ToolDefinition[];
@@ -0,0 +1,48 @@
1
+ import { adminTools } from './admin.js';
2
+ import { applicationTools } from './application.js';
3
+ import { backupTools } from './backup.js';
4
+ import { certificatesTools } from './certificates.js';
5
+ import { clusterTools } from './cluster.js';
6
+ import { composeTools } from './compose.js';
7
+ import { deploymentTools } from './deployment.js';
8
+ import { destinationTools } from './destination.js';
9
+ import { dockerTools } from './docker.js';
10
+ import { domainTools } from './domain.js';
11
+ import { mariadbTools } from './mariadb.js';
12
+ import { mongoTools } from './mongo.js';
13
+ import { mountsTools } from './mounts.js';
14
+ import { mysqlTools } from './mysql.js';
15
+ import { portTools } from './port.js';
16
+ import { postgresTools } from './postgres.js';
17
+ import { projectTools } from './project.js';
18
+ import { redirectsTools } from './redirects.js';
19
+ import { redisTools } from './redis.js';
20
+ import { registryTools } from './registry.js';
21
+ import { securityTools } from './security.js';
22
+ import { settingsTools } from './settings.js';
23
+ import { userTools } from './user.js';
24
+ export const allTools = [
25
+ ...projectTools,
26
+ ...applicationTools,
27
+ ...composeTools,
28
+ ...domainTools,
29
+ ...postgresTools,
30
+ ...mysqlTools,
31
+ ...mariadbTools,
32
+ ...mongoTools,
33
+ ...redisTools,
34
+ ...deploymentTools,
35
+ ...dockerTools,
36
+ ...certificatesTools,
37
+ ...registryTools,
38
+ ...destinationTools,
39
+ ...backupTools,
40
+ ...mountsTools,
41
+ ...portTools,
42
+ ...redirectsTools,
43
+ ...securityTools,
44
+ ...clusterTools,
45
+ ...settingsTools,
46
+ ...adminTools,
47
+ ...userTools,
48
+ ];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const mariadbTools: ToolDefinition[];
@@ -0,0 +1,170 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── helpers ──────────────────────────────────────────────────────────
4
+ const mdbId = z.string().min(1).describe('Unique MariaDB database ID');
5
+ const DB = 'mariadb';
6
+ // ── tools ────────────────────────────────────────────────────────────
7
+ const one = getTool({
8
+ name: `dokploy_${DB}_one`,
9
+ title: 'Get MariaDB Details',
10
+ description: 'Retrieve the full configuration and status details of a MariaDB database managed by Dokploy. Requires the unique MariaDB database ID. Returns all metadata including name, image, resource limits, environment variables, and current application status.',
11
+ schema: z.object({ mariadbId: mdbId }).strict(),
12
+ endpoint: `${DB}.one`,
13
+ });
14
+ const create = postTool({
15
+ name: `dokploy_${DB}_create`,
16
+ title: 'Create MariaDB Database',
17
+ description: 'Create a new MariaDB database instance inside a Dokploy project. Requires a display name, app-level identifier, database name, user credentials, root password, and the target project ID. Optionally specify a Docker image, description, or remote server. Returns the newly created database record.',
18
+ schema: z
19
+ .object({
20
+ name: z.string().min(1).describe('Display name for the database'),
21
+ appName: z.string().min(1).describe('Unique app-level identifier'),
22
+ databaseName: z.string().min(1).describe('Name of the database to create'),
23
+ databaseUser: z.string().min(1).describe('Database user'),
24
+ databasePassword: z.string().min(1).describe('Database password'),
25
+ databaseRootPassword: z.string().min(1).describe('Root password for MariaDB'),
26
+ projectId: z.string().min(1).describe('Project ID to create the database in'),
27
+ dockerImage: z.string().optional().describe('Docker image (default: mariadb:11)'),
28
+ description: z.string().nullable().optional().describe('Optional description'),
29
+ serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
30
+ })
31
+ .strict(),
32
+ endpoint: `${DB}.create`,
33
+ });
34
+ const update = postTool({
35
+ name: `dokploy_${DB}_update`,
36
+ title: 'Update MariaDB Database',
37
+ description: 'Update the configuration of an existing MariaDB database in Dokploy. Requires the MariaDB database ID and accepts optional fields such as name, Docker image, resource limits (memory and CPU), custom start command, environment variables, and external port. Returns the updated database configuration.',
38
+ schema: z
39
+ .object({
40
+ mariadbId: mdbId,
41
+ name: z.string().min(1).optional().describe('Display name'),
42
+ appName: z.string().min(1).optional().describe('App-level identifier'),
43
+ description: z.string().nullable().optional().describe('Description'),
44
+ dockerImage: z.string().optional().describe('Docker image'),
45
+ memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
46
+ memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
47
+ cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
48
+ cpuLimit: z.number().nullable().optional().describe('CPU limit'),
49
+ command: z.string().nullable().optional().describe('Custom start command'),
50
+ env: z.string().nullable().optional().describe('Environment variables'),
51
+ externalPort: z.number().nullable().optional().describe('External port'),
52
+ })
53
+ .strict(),
54
+ endpoint: `${DB}.update`,
55
+ });
56
+ const remove = postTool({
57
+ name: `dokploy_${DB}_remove`,
58
+ title: 'Remove MariaDB Database',
59
+ description: 'Permanently delete a MariaDB database from Dokploy. Requires the MariaDB database ID. This is a destructive operation that removes the container, all associated data, and configuration. Returns the operation status confirming deletion.',
60
+ schema: z.object({ mariadbId: mdbId }).strict(),
61
+ endpoint: `${DB}.remove`,
62
+ annotations: { destructiveHint: true },
63
+ });
64
+ const move = postTool({
65
+ name: `dokploy_${DB}_move`,
66
+ title: 'Move MariaDB Database',
67
+ description: 'Move a MariaDB database from its current project to a different project within Dokploy. Requires the MariaDB database ID and the destination project ID. The database configuration and data remain intact during the move. Returns the operation status.',
68
+ schema: z
69
+ .object({
70
+ mariadbId: mdbId,
71
+ targetProjectId: z.string().min(1).describe('Destination project ID'),
72
+ })
73
+ .strict(),
74
+ endpoint: `${DB}.move`,
75
+ });
76
+ const deploy = postTool({
77
+ name: `dokploy_${DB}_deploy`,
78
+ title: 'Deploy MariaDB Database',
79
+ description: 'Deploy a MariaDB database in Dokploy, pulling the configured Docker image and starting the container. Requires the MariaDB database ID. This triggers a full deployment lifecycle including image pull, container creation, and startup. Returns the deployment operation status.',
80
+ schema: z.object({ mariadbId: mdbId }).strict(),
81
+ endpoint: `${DB}.deploy`,
82
+ });
83
+ const start = postTool({
84
+ name: `dokploy_${DB}_start`,
85
+ title: 'Start MariaDB Database',
86
+ description: 'Start a previously stopped MariaDB database container in Dokploy. Requires the MariaDB database ID. The container will resume with its existing data and configuration. Returns the operation status.',
87
+ schema: z.object({ mariadbId: mdbId }).strict(),
88
+ endpoint: `${DB}.start`,
89
+ });
90
+ const stop = postTool({
91
+ name: `dokploy_${DB}_stop`,
92
+ title: 'Stop MariaDB Database',
93
+ description: 'Stop a currently running MariaDB database container in Dokploy. Requires the MariaDB database ID. The container will be gracefully stopped but its data and configuration are preserved for future restarts. Returns the operation status.',
94
+ schema: z.object({ mariadbId: mdbId }).strict(),
95
+ endpoint: `${DB}.stop`,
96
+ annotations: { destructiveHint: true },
97
+ });
98
+ const reload = postTool({
99
+ name: `dokploy_${DB}_reload`,
100
+ title: 'Reload MariaDB Database',
101
+ description: 'Reload the MariaDB database container in Dokploy without performing a full rebuild. Requires the MariaDB database ID and the app-level identifier. This restarts the container with its current configuration. Returns the operation status.',
102
+ schema: z
103
+ .object({
104
+ mariadbId: mdbId,
105
+ appName: z.string().min(1).describe('App-level identifier'),
106
+ })
107
+ .strict(),
108
+ endpoint: `${DB}.reload`,
109
+ });
110
+ const rebuild = postTool({
111
+ name: `dokploy_${DB}_rebuild`,
112
+ title: 'Rebuild MariaDB Database',
113
+ description: 'Rebuild the MariaDB database container from scratch in Dokploy. Requires the MariaDB database ID. This tears down the existing container and recreates it using the current configuration, which is useful when the container state has become inconsistent. Returns the operation status.',
114
+ schema: z.object({ mariadbId: mdbId }).strict(),
115
+ endpoint: `${DB}.rebuild`,
116
+ });
117
+ const changeStatus = postTool({
118
+ name: `dokploy_${DB}_change_status`,
119
+ title: 'Change MariaDB Status',
120
+ description: 'Manually set the application status of a MariaDB database in Dokploy. Requires the MariaDB database ID and the desired status (idle, running, done, or error). This is typically used for administrative overrides when the reported status does not match reality. Returns the updated status.',
121
+ schema: z
122
+ .object({
123
+ mariadbId: mdbId,
124
+ applicationStatus: z
125
+ .enum(['idle', 'running', 'done', 'error'])
126
+ .describe('New application status'),
127
+ })
128
+ .strict(),
129
+ endpoint: `${DB}.changeStatus`,
130
+ });
131
+ const saveExternalPort = postTool({
132
+ name: `dokploy_${DB}_save_external_port`,
133
+ title: 'Save MariaDB External Port',
134
+ description: 'Set or clear the external port mapping for a MariaDB database in Dokploy. Requires the MariaDB database ID and the desired external port number, or null to remove the external port mapping. This controls whether the database is accessible from outside the Docker network. Returns the operation status.',
135
+ schema: z
136
+ .object({
137
+ mariadbId: mdbId,
138
+ externalPort: z.number().nullable().describe('External port number (null to remove)'),
139
+ })
140
+ .strict(),
141
+ endpoint: `${DB}.saveExternalPort`,
142
+ });
143
+ const saveEnvironment = postTool({
144
+ name: `dokploy_${DB}_save_environment`,
145
+ title: 'Save MariaDB Environment',
146
+ description: 'Overwrite the environment variables for a MariaDB database in Dokploy. Requires the MariaDB database ID and the environment variables as a string. This replaces all existing environment variables with the provided values. Returns the operation status.',
147
+ schema: z
148
+ .object({
149
+ mariadbId: mdbId,
150
+ env: z.string().nullable().optional().describe('Environment variables as a string'),
151
+ })
152
+ .strict(),
153
+ endpoint: `${DB}.saveEnvironment`,
154
+ });
155
+ // ── export ───────────────────────────────────────────────────────────
156
+ export const mariadbTools = [
157
+ one,
158
+ create,
159
+ update,
160
+ remove,
161
+ move,
162
+ deploy,
163
+ start,
164
+ stop,
165
+ reload,
166
+ rebuild,
167
+ changeStatus,
168
+ saveExternalPort,
169
+ saveEnvironment,
170
+ ];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const mongoTools: ToolDefinition[];
@@ -0,0 +1,168 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── helpers ──────────────────────────────────────────────────────────
4
+ const mgId = z.string().min(1).describe('Unique MongoDB database ID');
5
+ const DB = 'mongo';
6
+ // ── tools ────────────────────────────────────────────────────────────
7
+ const one = getTool({
8
+ name: `dokploy_${DB}_one`,
9
+ title: 'Get MongoDB Details',
10
+ description: 'Retrieve the full configuration and status details of a MongoDB database managed by Dokploy. Requires the unique MongoDB database ID. Returns all metadata including name, image, resource limits, environment variables, and current application status.',
11
+ schema: z.object({ mongoId: mgId }).strict(),
12
+ endpoint: `${DB}.one`,
13
+ });
14
+ const create = postTool({
15
+ name: `dokploy_${DB}_create`,
16
+ title: 'Create MongoDB Database',
17
+ description: 'Create a new MongoDB database instance inside a Dokploy project. Requires a display name, app-level identifier, user credentials, and the target project ID. Optionally specify a Docker image, description, or remote server. Returns the newly created database record.',
18
+ schema: z
19
+ .object({
20
+ name: z.string().min(1).describe('Display name for the database'),
21
+ appName: z.string().min(1).describe('Unique app-level identifier'),
22
+ databaseUser: z.string().min(1).describe('Database user'),
23
+ databasePassword: z.string().min(1).describe('Database password'),
24
+ projectId: z.string().min(1).describe('Project ID to create the database in'),
25
+ dockerImage: z.string().optional().describe('Docker image (default: mongo:6)'),
26
+ description: z.string().nullable().optional().describe('Optional description'),
27
+ serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
28
+ })
29
+ .strict(),
30
+ endpoint: `${DB}.create`,
31
+ });
32
+ const update = postTool({
33
+ name: `dokploy_${DB}_update`,
34
+ title: 'Update MongoDB Database',
35
+ description: 'Update the configuration of an existing MongoDB database in Dokploy. Requires the MongoDB database ID and accepts optional fields such as name, Docker image, resource limits (memory and CPU), custom start command, environment variables, and external port. Returns the updated database configuration.',
36
+ schema: z
37
+ .object({
38
+ mongoId: mgId,
39
+ name: z.string().min(1).optional().describe('Display name'),
40
+ appName: z.string().min(1).optional().describe('App-level identifier'),
41
+ description: z.string().nullable().optional().describe('Description'),
42
+ dockerImage: z.string().optional().describe('Docker image'),
43
+ memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
44
+ memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
45
+ cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
46
+ cpuLimit: z.number().nullable().optional().describe('CPU limit'),
47
+ command: z.string().nullable().optional().describe('Custom start command'),
48
+ env: z.string().nullable().optional().describe('Environment variables'),
49
+ externalPort: z.number().nullable().optional().describe('External port'),
50
+ })
51
+ .strict(),
52
+ endpoint: `${DB}.update`,
53
+ });
54
+ const remove = postTool({
55
+ name: `dokploy_${DB}_remove`,
56
+ title: 'Remove MongoDB Database',
57
+ description: 'Permanently delete a MongoDB database from Dokploy. Requires the MongoDB database ID. This is a destructive operation that removes the container, all associated data, and configuration. Returns the operation status confirming deletion.',
58
+ schema: z.object({ mongoId: mgId }).strict(),
59
+ endpoint: `${DB}.remove`,
60
+ annotations: { destructiveHint: true },
61
+ });
62
+ const move = postTool({
63
+ name: `dokploy_${DB}_move`,
64
+ title: 'Move MongoDB Database',
65
+ description: 'Move a MongoDB database from its current project to a different project within Dokploy. Requires the MongoDB database ID and the destination project ID. The database configuration and data remain intact during the move. Returns the operation status.',
66
+ schema: z
67
+ .object({
68
+ mongoId: mgId,
69
+ targetProjectId: z.string().min(1).describe('Destination project ID'),
70
+ })
71
+ .strict(),
72
+ endpoint: `${DB}.move`,
73
+ });
74
+ const deploy = postTool({
75
+ name: `dokploy_${DB}_deploy`,
76
+ title: 'Deploy MongoDB Database',
77
+ description: 'Deploy a MongoDB database in Dokploy, pulling the configured Docker image and starting the container. Requires the MongoDB database ID. This triggers a full deployment lifecycle including image pull, container creation, and startup. Returns the deployment operation status.',
78
+ schema: z.object({ mongoId: mgId }).strict(),
79
+ endpoint: `${DB}.deploy`,
80
+ });
81
+ const start = postTool({
82
+ name: `dokploy_${DB}_start`,
83
+ title: 'Start MongoDB Database',
84
+ description: 'Start a previously stopped MongoDB database container in Dokploy. Requires the MongoDB database ID. The container will resume with its existing data and configuration. Returns the operation status.',
85
+ schema: z.object({ mongoId: mgId }).strict(),
86
+ endpoint: `${DB}.start`,
87
+ });
88
+ const stop = postTool({
89
+ name: `dokploy_${DB}_stop`,
90
+ title: 'Stop MongoDB Database',
91
+ description: 'Stop a currently running MongoDB database container in Dokploy. Requires the MongoDB database ID. The container will be gracefully stopped but its data and configuration are preserved for future restarts. Returns the operation status.',
92
+ schema: z.object({ mongoId: mgId }).strict(),
93
+ endpoint: `${DB}.stop`,
94
+ annotations: { destructiveHint: true },
95
+ });
96
+ const reload = postTool({
97
+ name: `dokploy_${DB}_reload`,
98
+ title: 'Reload MongoDB Database',
99
+ description: 'Reload the MongoDB database container in Dokploy without performing a full rebuild. Requires the MongoDB database ID and the app-level identifier. This restarts the container with its current configuration. Returns the operation status.',
100
+ schema: z
101
+ .object({
102
+ mongoId: mgId,
103
+ appName: z.string().min(1).describe('App-level identifier'),
104
+ })
105
+ .strict(),
106
+ endpoint: `${DB}.reload`,
107
+ });
108
+ const rebuild = postTool({
109
+ name: `dokploy_${DB}_rebuild`,
110
+ title: 'Rebuild MongoDB Database',
111
+ description: 'Rebuild the MongoDB database container from scratch in Dokploy. Requires the MongoDB database ID. This tears down the existing container and recreates it using the current configuration, which is useful when the container state has become inconsistent. Returns the operation status.',
112
+ schema: z.object({ mongoId: mgId }).strict(),
113
+ endpoint: `${DB}.rebuild`,
114
+ });
115
+ const changeStatus = postTool({
116
+ name: `dokploy_${DB}_change_status`,
117
+ title: 'Change MongoDB Status',
118
+ description: 'Manually set the application status of a MongoDB database in Dokploy. Requires the MongoDB database ID and the desired status (idle, running, done, or error). This is typically used for administrative overrides when the reported status does not match reality. Returns the updated status.',
119
+ schema: z
120
+ .object({
121
+ mongoId: mgId,
122
+ applicationStatus: z
123
+ .enum(['idle', 'running', 'done', 'error'])
124
+ .describe('New application status'),
125
+ })
126
+ .strict(),
127
+ endpoint: `${DB}.changeStatus`,
128
+ });
129
+ const saveExternalPort = postTool({
130
+ name: `dokploy_${DB}_save_external_port`,
131
+ title: 'Save MongoDB External Port',
132
+ description: 'Set or clear the external port mapping for a MongoDB database in Dokploy. Requires the MongoDB database ID and the desired external port number, or null to remove the external port mapping. This controls whether the database is accessible from outside the Docker network. Returns the operation status.',
133
+ schema: z
134
+ .object({
135
+ mongoId: mgId,
136
+ externalPort: z.number().nullable().describe('External port number (null to remove)'),
137
+ })
138
+ .strict(),
139
+ endpoint: `${DB}.saveExternalPort`,
140
+ });
141
+ const saveEnvironment = postTool({
142
+ name: `dokploy_${DB}_save_environment`,
143
+ title: 'Save MongoDB Environment',
144
+ description: 'Overwrite the environment variables for a MongoDB database in Dokploy. Requires the MongoDB database ID and the environment variables as a string. This replaces all existing environment variables with the provided values. Returns the operation status.',
145
+ schema: z
146
+ .object({
147
+ mongoId: mgId,
148
+ env: z.string().nullable().optional().describe('Environment variables as a string'),
149
+ })
150
+ .strict(),
151
+ endpoint: `${DB}.saveEnvironment`,
152
+ });
153
+ // ── export ───────────────────────────────────────────────────────────
154
+ export const mongoTools = [
155
+ one,
156
+ create,
157
+ update,
158
+ remove,
159
+ move,
160
+ deploy,
161
+ start,
162
+ stop,
163
+ reload,
164
+ rebuild,
165
+ changeStatus,
166
+ saveExternalPort,
167
+ saveEnvironment,
168
+ ];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const mountsTools: ToolDefinition[];
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import { getTool, postTool } from './_factory.js';
3
+ // ── helpers ──────────────────────────────────────────────────────────
4
+ const mountId = z.string().min(1).describe('Unique mount ID');
5
+ const mountTypeEnum = z
6
+ .enum(['bind', 'volume', 'file'])
7
+ .describe('Mount type: bind, volume, or file');
8
+ // ── tools ────────────────────────────────────────────────────────────
9
+ const one = getTool({
10
+ name: 'dokploy_mount_one',
11
+ title: 'Get Mount',
12
+ description: 'Retrieve the full configuration of a specific mount by its unique ID. Requires the mountId parameter. Returns the mount object including its type (bind, volume, or file), container path, host path or volume name, and associated service ID.',
13
+ schema: z.object({ mountId }).strict(),
14
+ endpoint: '/mounts.one',
15
+ });
16
+ const create = postTool({
17
+ name: 'dokploy_mount_create',
18
+ title: 'Create Mount',
19
+ description: 'Create a new mount for a Dokploy service. Supports bind mounts (host path to container), volume mounts (named Docker volumes), and file mounts (inline file content). Requires the mount type, container path, and service ID. Returns the created mount configuration.',
20
+ schema: z
21
+ .object({
22
+ type: mountTypeEnum,
23
+ mountPath: z
24
+ .string()
25
+ .min(1)
26
+ .describe('Path inside the container where the mount is attached'),
27
+ serviceId: z.string().min(1).describe('ID of the service to attach the mount to'),
28
+ hostPath: z.string().optional().describe('Host path for bind mounts'),
29
+ volumeName: z.string().optional().describe('Volume name for volume mounts'),
30
+ content: z.string().optional().describe('File content for file mounts'),
31
+ serviceType: z
32
+ .enum(['application', 'postgres', 'mysql', 'mariadb', 'mongo', 'redis', 'compose'])
33
+ .optional()
34
+ .default('application')
35
+ .describe('Type of service the mount belongs to'),
36
+ })
37
+ .strict(),
38
+ endpoint: '/mounts.create',
39
+ });
40
+ const update = postTool({
41
+ name: 'dokploy_mount_update',
42
+ title: 'Update Mount',
43
+ description: 'Update an existing mount configuration for a Dokploy service. Requires the mountId of the mount to modify. Optionally update the mount type, container path, host path (for bind mounts), volume name (for volume mounts), or file content (for file mounts). Returns the updated mount configuration.',
44
+ schema: z
45
+ .object({
46
+ mountId,
47
+ type: mountTypeEnum.optional().describe('New mount type'),
48
+ mountPath: z.string().optional().describe('New path inside the container'),
49
+ hostPath: z.string().optional().describe('New host path for bind mounts'),
50
+ volumeName: z.string().optional().describe('New volume name for volume mounts'),
51
+ content: z.string().optional().describe('New file content for file mounts'),
52
+ })
53
+ .strict(),
54
+ endpoint: '/mounts.update',
55
+ });
56
+ const remove = postTool({
57
+ name: 'dokploy_mount_remove',
58
+ title: 'Remove Mount',
59
+ description: 'Permanently remove a mount from a Dokploy service. This action is irreversible and detaches the mount from the service container. Requires the mountId parameter. The underlying host path, volume, or file content is not automatically deleted.',
60
+ schema: z.object({ mountId }).strict(),
61
+ endpoint: '/mounts.remove',
62
+ annotations: { destructiveHint: true },
63
+ });
64
+ // ── export ───────────────────────────────────────────────────────────
65
+ export const mountsTools = [one, create, update, remove];
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from './_factory.js';
2
+ export declare const mysqlTools: ToolDefinition[];