@vibetools/dokploy-mcp 0.5.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 +39 -13
- package/dist/api/client.d.ts +2 -0
- package/dist/api/client.js +51 -16
- package/dist/config/resolver.js +33 -50
- package/dist/server.js +1 -1
- package/dist/tools/_database.d.ts +12 -0
- package/dist/tools/_database.js +115 -0
- package/dist/tools/_factory.d.ts +3 -1
- package/dist/tools/_factory.js +36 -17
- 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.d.ts +1 -2
- package/dist/tools/mariadb.js +9 -165
- package/dist/tools/mongo.d.ts +1 -2
- package/dist/tools/mongo.js +9 -164
- package/dist/tools/mounts.js +53 -9
- package/dist/tools/mysql.d.ts +1 -2
- package/dist/tools/mysql.js +9 -165
- 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.d.ts +1 -2
- package/dist/tools/postgres.js +8 -164
- 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.d.ts +1 -2
- package/dist/tools/redis.js +8 -164
- 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 +7 -2
package/dist/tools/mongo.js
CHANGED
|
@@ -1,168 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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'),
|
|
2
|
+
import { createDatabaseTools } from './_database.js';
|
|
3
|
+
export const mongoTools = createDatabaseTools({
|
|
4
|
+
type: 'mongo',
|
|
5
|
+
idField: 'mongoId',
|
|
6
|
+
displayName: 'MongoDB',
|
|
7
|
+
defaultImage: 'mongo:15',
|
|
8
|
+
createFields: z.object({
|
|
22
9
|
databaseUser: z.string().min(1).describe('Database user'),
|
|
23
10
|
databasePassword: z.string().min(1).describe('Database password'),
|
|
24
|
-
|
|
25
|
-
|
|
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`,
|
|
11
|
+
replicaSets: z.boolean().nullable().optional().describe('Whether replica sets are enabled'),
|
|
12
|
+
}),
|
|
152
13
|
});
|
|
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
|
-
];
|
package/dist/tools/mounts.js
CHANGED
|
@@ -13,6 +13,17 @@ const one = getTool({
|
|
|
13
13
|
schema: z.object({ mountId }).strict(),
|
|
14
14
|
endpoint: '/mounts.one',
|
|
15
15
|
});
|
|
16
|
+
const allNamedByApplicationId = getTool({
|
|
17
|
+
name: 'dokploy_mount_all_named_by_application_id',
|
|
18
|
+
title: 'List Named Mounts by Application',
|
|
19
|
+
description: 'List named mounts attached to a Dokploy application. Requires the application ID.',
|
|
20
|
+
schema: z
|
|
21
|
+
.object({
|
|
22
|
+
applicationId: z.string().min(1).describe('Application ID'),
|
|
23
|
+
})
|
|
24
|
+
.strict(),
|
|
25
|
+
endpoint: '/mounts.allNamedByApplicationId',
|
|
26
|
+
});
|
|
16
27
|
const create = postTool({
|
|
17
28
|
name: 'dokploy_mount_create',
|
|
18
29
|
title: 'Create Mount',
|
|
@@ -25,13 +36,13 @@ const create = postTool({
|
|
|
25
36
|
.min(1)
|
|
26
37
|
.describe('Path inside the container where the mount is attached'),
|
|
27
38
|
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'),
|
|
39
|
+
hostPath: z.string().nullable().optional().describe('Host path for bind mounts'),
|
|
40
|
+
volumeName: z.string().nullable().optional().describe('Volume name for volume mounts'),
|
|
41
|
+
content: z.string().nullable().optional().describe('File content for file mounts'),
|
|
42
|
+
filePath: z.string().nullable().optional().describe('File path for file mounts'),
|
|
31
43
|
serviceType: z
|
|
32
44
|
.enum(['application', 'postgres', 'mysql', 'mariadb', 'mongo', 'redis', 'compose'])
|
|
33
45
|
.optional()
|
|
34
|
-
.default('application')
|
|
35
46
|
.describe('Type of service the mount belongs to'),
|
|
36
47
|
})
|
|
37
48
|
.strict(),
|
|
@@ -45,14 +56,40 @@ const update = postTool({
|
|
|
45
56
|
.object({
|
|
46
57
|
mountId,
|
|
47
58
|
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
|
-
|
|
59
|
+
mountPath: z.string().min(1).optional().describe('New path inside the container'),
|
|
60
|
+
hostPath: z.string().nullable().optional().describe('New host path for bind mounts'),
|
|
61
|
+
volumeName: z.string().nullable().optional().describe('New volume name for volume mounts'),
|
|
62
|
+
filePath: z.string().nullable().optional().describe('New file path for file mounts'),
|
|
63
|
+
content: z.string().nullable().optional().describe('New file content for file mounts'),
|
|
64
|
+
serviceType: z
|
|
65
|
+
.enum(['application', 'postgres', 'mysql', 'mariadb', 'mongo', 'redis', 'compose'])
|
|
66
|
+
.optional()
|
|
67
|
+
.describe('Type of service the mount belongs to'),
|
|
68
|
+
applicationId: z.string().nullable().optional().describe('Application ID'),
|
|
69
|
+
postgresId: z.string().nullable().optional().describe('Postgres ID'),
|
|
70
|
+
mariadbId: z.string().nullable().optional().describe('MariaDB ID'),
|
|
71
|
+
mongoId: z.string().nullable().optional().describe('MongoDB ID'),
|
|
72
|
+
mysqlId: z.string().nullable().optional().describe('MySQL ID'),
|
|
73
|
+
redisId: z.string().nullable().optional().describe('Redis ID'),
|
|
74
|
+
composeId: z.string().nullable().optional().describe('Compose ID'),
|
|
52
75
|
})
|
|
53
76
|
.strict(),
|
|
54
77
|
endpoint: '/mounts.update',
|
|
55
78
|
});
|
|
79
|
+
const listByServiceId = getTool({
|
|
80
|
+
name: 'dokploy_mount_list_by_service_id',
|
|
81
|
+
title: 'List Mounts by Service',
|
|
82
|
+
description: 'List mounts for a Dokploy service. Requires the service ID and the service type.',
|
|
83
|
+
schema: z
|
|
84
|
+
.object({
|
|
85
|
+
serviceId: z.string().min(1).describe('Service ID'),
|
|
86
|
+
serviceType: z
|
|
87
|
+
.enum(['application', 'postgres', 'mysql', 'mariadb', 'mongo', 'redis', 'compose'])
|
|
88
|
+
.describe('Service type'),
|
|
89
|
+
})
|
|
90
|
+
.strict(),
|
|
91
|
+
endpoint: '/mounts.listByServiceId',
|
|
92
|
+
});
|
|
56
93
|
const remove = postTool({
|
|
57
94
|
name: 'dokploy_mount_remove',
|
|
58
95
|
title: 'Remove Mount',
|
|
@@ -62,4 +99,11 @@ const remove = postTool({
|
|
|
62
99
|
annotations: { destructiveHint: true },
|
|
63
100
|
});
|
|
64
101
|
// ── export ───────────────────────────────────────────────────────────
|
|
65
|
-
export const mountsTools = [
|
|
102
|
+
export const mountsTools = [
|
|
103
|
+
one,
|
|
104
|
+
allNamedByApplicationId,
|
|
105
|
+
create,
|
|
106
|
+
update,
|
|
107
|
+
listByServiceId,
|
|
108
|
+
remove,
|
|
109
|
+
];
|
package/dist/tools/mysql.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const mysqlTools: ToolDefinition[];
|
|
1
|
+
export declare const mysqlTools: import("./_factory.js").ToolDefinition[];
|
package/dist/tools/mysql.js
CHANGED
|
@@ -1,170 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
title: 'Get MySQL Details',
|
|
10
|
-
description: 'Retrieve detailed information about a specific MySQL database managed by Dokploy. Returns the full configuration including connection settings, resource limits, environment variables, and current status. Requires the unique MySQL database ID.',
|
|
11
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
12
|
-
endpoint: `${DB}.one`,
|
|
13
|
-
});
|
|
14
|
-
const create = postTool({
|
|
15
|
-
name: `dokploy_${DB}_create`,
|
|
16
|
-
title: 'Create MySQL Database',
|
|
17
|
-
description: 'Create a new MySQL 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'),
|
|
2
|
+
import { createDatabaseTools } from './_database.js';
|
|
3
|
+
export const mysqlTools = createDatabaseTools({
|
|
4
|
+
type: 'mysql',
|
|
5
|
+
idField: 'mysqlId',
|
|
6
|
+
displayName: 'MySQL',
|
|
7
|
+
defaultImage: 'mysql:8',
|
|
8
|
+
createFields: z.object({
|
|
22
9
|
databaseName: z.string().min(1).describe('Name of the database to create'),
|
|
23
10
|
databaseUser: z.string().min(1).describe('Database user'),
|
|
24
11
|
databasePassword: z.string().min(1).describe('Database password'),
|
|
25
|
-
databaseRootPassword: z.string().min(1).describe('Root password for MySQL'),
|
|
26
|
-
|
|
27
|
-
dockerImage: z.string().optional().describe('Docker image (default: mysql:8)'),
|
|
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 MySQL Database',
|
|
37
|
-
description: 'Update the configuration of an existing MySQL database in Dokploy. Supports modifying the display name, Docker image, resource limits (CPU and memory), custom start command, environment variables, and external port. Requires the MySQL database ID. Only the provided fields are updated.',
|
|
38
|
-
schema: z
|
|
39
|
-
.object({
|
|
40
|
-
mysqlId: myId,
|
|
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 MySQL Database',
|
|
59
|
-
description: 'Permanently delete a MySQL database from Dokploy. This action removes the database container, its data, and all associated configuration. Requires the MySQL database ID. This operation is destructive and cannot be undone.',
|
|
60
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
61
|
-
endpoint: `${DB}.remove`,
|
|
62
|
-
annotations: { destructiveHint: true },
|
|
63
|
-
});
|
|
64
|
-
const move = postTool({
|
|
65
|
-
name: `dokploy_${DB}_move`,
|
|
66
|
-
title: 'Move MySQL Database',
|
|
67
|
-
description: 'Move a MySQL database from its current project to a different project within Dokploy. Requires the MySQL database ID and the destination project ID. The database configuration and data are preserved during the move.',
|
|
68
|
-
schema: z
|
|
69
|
-
.object({
|
|
70
|
-
mysqlId: myId,
|
|
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 MySQL Database',
|
|
79
|
-
description: 'Deploy a MySQL database container in Dokploy. Triggers the build and start process for the specified database. Requires the MySQL database ID. Returns the deployment status.',
|
|
80
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
81
|
-
endpoint: `${DB}.deploy`,
|
|
82
|
-
});
|
|
83
|
-
const start = postTool({
|
|
84
|
-
name: `dokploy_${DB}_start`,
|
|
85
|
-
title: 'Start MySQL Database',
|
|
86
|
-
description: 'Start a previously stopped MySQL database container in Dokploy. The database must already be deployed. Requires the MySQL database ID. Returns the updated status after starting.',
|
|
87
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
88
|
-
endpoint: `${DB}.start`,
|
|
89
|
-
});
|
|
90
|
-
const stop = postTool({
|
|
91
|
-
name: `dokploy_${DB}_stop`,
|
|
92
|
-
title: 'Stop MySQL Database',
|
|
93
|
-
description: 'Stop a running MySQL database container in Dokploy. The database data is preserved but the container will no longer accept connections. Requires the MySQL database ID. This is a destructive action as it interrupts active connections.',
|
|
94
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
95
|
-
endpoint: `${DB}.stop`,
|
|
96
|
-
annotations: { destructiveHint: true },
|
|
97
|
-
});
|
|
98
|
-
const reload = postTool({
|
|
99
|
-
name: `dokploy_${DB}_reload`,
|
|
100
|
-
title: 'Reload MySQL Database',
|
|
101
|
-
description: 'Reload the MySQL database container in Dokploy without a full restart. Applies configuration changes that do not require a rebuild. Requires the MySQL database ID and the app-level identifier. Returns the reload status.',
|
|
102
|
-
schema: z
|
|
103
|
-
.object({
|
|
104
|
-
mysqlId: myId,
|
|
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 MySQL Database',
|
|
113
|
-
description: 'Rebuild the MySQL database container from scratch in Dokploy. This tears down the existing container and recreates it with the current configuration. Requires the MySQL database ID. Useful after changing the Docker image or when the container is in a broken state.',
|
|
114
|
-
schema: z.object({ mysqlId: myId }).strict(),
|
|
115
|
-
endpoint: `${DB}.rebuild`,
|
|
116
|
-
});
|
|
117
|
-
const changeStatus = postTool({
|
|
118
|
-
name: `dokploy_${DB}_change_status`,
|
|
119
|
-
title: 'Change MySQL Status',
|
|
120
|
-
description: 'Manually set the application status of a MySQL database in Dokploy. Accepts one of: idle, running, done, or error. Requires the MySQL database ID and the new status value. Useful for correcting a stale or incorrect status.',
|
|
121
|
-
schema: z
|
|
122
|
-
.object({
|
|
123
|
-
mysqlId: myId,
|
|
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 MySQL External Port',
|
|
134
|
-
description: 'Set or clear the external port mapping for a MySQL database in Dokploy. When set, the database is accessible from outside the Docker network on the specified port. Pass null to remove the external port. Requires the MySQL database ID.',
|
|
135
|
-
schema: z
|
|
136
|
-
.object({
|
|
137
|
-
mysqlId: myId,
|
|
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 MySQL Environment',
|
|
146
|
-
description: 'Overwrite the environment variables for a MySQL database in Dokploy. Replaces all existing environment variables with the provided value. Pass the variables as a single string (one per line, KEY=VALUE format). Requires the MySQL database ID.',
|
|
147
|
-
schema: z
|
|
148
|
-
.object({
|
|
149
|
-
mysqlId: myId,
|
|
150
|
-
env: z.string().nullable().optional().describe('Environment variables as a string'),
|
|
151
|
-
})
|
|
152
|
-
.strict(),
|
|
153
|
-
endpoint: `${DB}.saveEnvironment`,
|
|
12
|
+
databaseRootPassword: z.string().min(1).optional().describe('Root password for MySQL'),
|
|
13
|
+
}),
|
|
154
14
|
});
|
|
155
|
-
// ── export ───────────────────────────────────────────────────────────
|
|
156
|
-
export const mysqlTools = [
|
|
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
|
-
];
|