@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { postTool } from './_factory.js';
|
|
3
|
+
const rollbackIdSchema = z.string().min(1).describe('Rollback ID');
|
|
4
|
+
const rollback = postTool({
|
|
5
|
+
name: 'dokploy_rollback_rollback',
|
|
6
|
+
title: 'Execute Rollback',
|
|
7
|
+
description: 'Execute a rollback in Dokploy. Requires the rollback ID and triggers a rollback to the associated deployment target.',
|
|
8
|
+
schema: z
|
|
9
|
+
.object({
|
|
10
|
+
rollbackId: rollbackIdSchema,
|
|
11
|
+
})
|
|
12
|
+
.strict(),
|
|
13
|
+
endpoint: '/rollback.rollback',
|
|
14
|
+
annotations: { destructiveHint: true },
|
|
15
|
+
});
|
|
16
|
+
const remove = postTool({
|
|
17
|
+
name: 'dokploy_rollback_delete',
|
|
18
|
+
title: 'Delete Rollback Record',
|
|
19
|
+
description: 'Delete a rollback record from Dokploy. Requires the rollback ID. This is a destructive action.',
|
|
20
|
+
schema: z
|
|
21
|
+
.object({
|
|
22
|
+
rollbackId: rollbackIdSchema,
|
|
23
|
+
})
|
|
24
|
+
.strict(),
|
|
25
|
+
endpoint: '/rollback.delete',
|
|
26
|
+
annotations: { destructiveHint: true },
|
|
27
|
+
});
|
|
28
|
+
export const rollbackTools = [rollback, remove];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const nullableString = z.string().nullable().optional();
|
|
4
|
+
const scheduleTypeSchema = z
|
|
5
|
+
.enum(['application', 'compose', 'server', 'dokploy-server'])
|
|
6
|
+
.describe('Schedule type');
|
|
7
|
+
const shellTypeSchema = z.enum(['bash', 'sh']).describe('Shell type');
|
|
8
|
+
const schedulePayload = z
|
|
9
|
+
.object({
|
|
10
|
+
scheduleId: z.string().optional().describe('Schedule ID'),
|
|
11
|
+
name: z.string().describe('Schedule name'),
|
|
12
|
+
cronExpression: z.string().describe('Cron expression'),
|
|
13
|
+
appName: z.string().optional().describe('App name'),
|
|
14
|
+
serviceName: nullableString.describe('Service name'),
|
|
15
|
+
shellType: shellTypeSchema.optional(),
|
|
16
|
+
scheduleType: scheduleTypeSchema.optional(),
|
|
17
|
+
command: z.string().describe('Command to execute'),
|
|
18
|
+
script: nullableString.describe('Inline script'),
|
|
19
|
+
applicationId: nullableString.describe('Application ID'),
|
|
20
|
+
composeId: nullableString.describe('Compose ID'),
|
|
21
|
+
serverId: nullableString.describe('Server ID'),
|
|
22
|
+
userId: nullableString.describe('User ID'),
|
|
23
|
+
enabled: z.boolean().optional().describe('Whether the schedule is enabled'),
|
|
24
|
+
timezone: nullableString.describe('Timezone'),
|
|
25
|
+
createdAt: z.string().optional().describe('Creation timestamp'),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
const list = getTool({
|
|
29
|
+
name: 'dokploy_schedule_list',
|
|
30
|
+
title: 'List Schedules',
|
|
31
|
+
description: 'List schedules in Dokploy for a specific entity ID and schedule type.',
|
|
32
|
+
schema: z
|
|
33
|
+
.object({
|
|
34
|
+
id: z.string().describe('Entity ID'),
|
|
35
|
+
scheduleType: scheduleTypeSchema,
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
endpoint: '/schedule.list',
|
|
39
|
+
});
|
|
40
|
+
const one = getTool({
|
|
41
|
+
name: 'dokploy_schedule_one',
|
|
42
|
+
title: 'Get Schedule',
|
|
43
|
+
description: 'Retrieve a Dokploy schedule by its ID.',
|
|
44
|
+
schema: z
|
|
45
|
+
.object({
|
|
46
|
+
scheduleId: z.string().describe('Schedule ID'),
|
|
47
|
+
})
|
|
48
|
+
.strict(),
|
|
49
|
+
endpoint: '/schedule.one',
|
|
50
|
+
});
|
|
51
|
+
const create = postTool({
|
|
52
|
+
name: 'dokploy_schedule_create',
|
|
53
|
+
title: 'Create Schedule',
|
|
54
|
+
description: 'Create a new schedule in Dokploy. Requires the schedule name, cron expression, and command.',
|
|
55
|
+
schema: schedulePayload,
|
|
56
|
+
endpoint: '/schedule.create',
|
|
57
|
+
});
|
|
58
|
+
const update = postTool({
|
|
59
|
+
name: 'dokploy_schedule_update',
|
|
60
|
+
title: 'Update Schedule',
|
|
61
|
+
description: 'Update an existing schedule in Dokploy. Requires the schedule ID together with the updated schedule payload.',
|
|
62
|
+
schema: schedulePayload
|
|
63
|
+
.extend({
|
|
64
|
+
scheduleId: z.string().min(1).describe('Schedule ID'),
|
|
65
|
+
})
|
|
66
|
+
.strict(),
|
|
67
|
+
endpoint: '/schedule.update',
|
|
68
|
+
});
|
|
69
|
+
const remove = postTool({
|
|
70
|
+
name: 'dokploy_schedule_delete',
|
|
71
|
+
title: 'Delete Schedule',
|
|
72
|
+
description: 'Delete a schedule from Dokploy. Requires the schedule ID. This is a destructive action.',
|
|
73
|
+
schema: z
|
|
74
|
+
.object({
|
|
75
|
+
scheduleId: z.string().describe('Schedule ID'),
|
|
76
|
+
})
|
|
77
|
+
.strict(),
|
|
78
|
+
endpoint: '/schedule.delete',
|
|
79
|
+
annotations: { destructiveHint: true },
|
|
80
|
+
});
|
|
81
|
+
const runManually = postTool({
|
|
82
|
+
name: 'dokploy_schedule_run_manually',
|
|
83
|
+
title: 'Run Schedule Manually',
|
|
84
|
+
description: 'Run a Dokploy schedule immediately. Requires the schedule ID.',
|
|
85
|
+
schema: z
|
|
86
|
+
.object({
|
|
87
|
+
scheduleId: z.string().min(1).describe('Schedule ID'),
|
|
88
|
+
})
|
|
89
|
+
.strict(),
|
|
90
|
+
endpoint: '/schedule.runManually',
|
|
91
|
+
});
|
|
92
|
+
export const scheduleTools = [list, one, create, update, remove, runManually];
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const serverIdSchema = z.string().min(1).describe('The server ID');
|
|
4
|
+
const metricsConfigSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
server: z
|
|
7
|
+
.object({
|
|
8
|
+
refreshRate: z.number().min(2).describe('Refresh rate in seconds'),
|
|
9
|
+
port: z.number().min(1).describe('Monitoring port'),
|
|
10
|
+
token: z.string().describe('Monitoring token'),
|
|
11
|
+
urlCallback: z.string().url().describe('Callback URL'),
|
|
12
|
+
retentionDays: z.number().min(1).describe('Retention period in days'),
|
|
13
|
+
cronJob: z.string().min(1).describe('Cron expression'),
|
|
14
|
+
thresholds: z
|
|
15
|
+
.object({
|
|
16
|
+
cpu: z.number().min(0).describe('CPU threshold'),
|
|
17
|
+
memory: z.number().min(0).describe('Memory threshold'),
|
|
18
|
+
})
|
|
19
|
+
.strict(),
|
|
20
|
+
})
|
|
21
|
+
.strict(),
|
|
22
|
+
containers: z
|
|
23
|
+
.object({
|
|
24
|
+
refreshRate: z.number().min(2).describe('Container refresh rate in seconds'),
|
|
25
|
+
services: z
|
|
26
|
+
.object({
|
|
27
|
+
include: z.array(z.string()).optional().describe('Services to include'),
|
|
28
|
+
exclude: z.array(z.string()).optional().describe('Services to exclude'),
|
|
29
|
+
})
|
|
30
|
+
.strict(),
|
|
31
|
+
})
|
|
32
|
+
.strict(),
|
|
33
|
+
})
|
|
34
|
+
.strict();
|
|
35
|
+
const serverPayload = z
|
|
36
|
+
.object({
|
|
37
|
+
name: z.string().min(1).describe('Server name'),
|
|
38
|
+
description: z.string().nullable().describe('Server description'),
|
|
39
|
+
ipAddress: z.string().describe('Server IP address'),
|
|
40
|
+
port: z.number().describe('SSH port'),
|
|
41
|
+
username: z.string().describe('SSH username'),
|
|
42
|
+
sshKeyId: z.string().nullable().describe('SSH key ID'),
|
|
43
|
+
serverType: z.enum(['deploy', 'build']).describe('Server role'),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
const all = getTool({
|
|
47
|
+
name: 'dokploy_server_all',
|
|
48
|
+
title: 'List Servers',
|
|
49
|
+
description: 'List all Dokploy servers available to the current account. Returns deploy and build servers with their metadata.',
|
|
50
|
+
schema: z.object({}).strict(),
|
|
51
|
+
endpoint: '/server.all',
|
|
52
|
+
});
|
|
53
|
+
const one = getTool({
|
|
54
|
+
name: 'dokploy_server_one',
|
|
55
|
+
title: 'Get Server',
|
|
56
|
+
description: 'Retrieve detailed information about a Dokploy server by its ID. Returns connection settings, monitoring state, and security details.',
|
|
57
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
58
|
+
endpoint: '/server.one',
|
|
59
|
+
});
|
|
60
|
+
const count = getTool({
|
|
61
|
+
name: 'dokploy_server_count',
|
|
62
|
+
title: 'Count Servers',
|
|
63
|
+
description: 'Return the number of servers configured in Dokploy.',
|
|
64
|
+
schema: z.object({}).strict(),
|
|
65
|
+
endpoint: '/server.count',
|
|
66
|
+
});
|
|
67
|
+
const withSshKey = getTool({
|
|
68
|
+
name: 'dokploy_server_with_ssh_key',
|
|
69
|
+
title: 'List Servers with SSH Keys',
|
|
70
|
+
description: 'List Dokploy servers together with their linked SSH key information. Useful when selecting a server-key pair for operations.',
|
|
71
|
+
schema: z.object({}).strict(),
|
|
72
|
+
endpoint: '/server.withSSHKey',
|
|
73
|
+
});
|
|
74
|
+
const buildServers = getTool({
|
|
75
|
+
name: 'dokploy_server_build_servers',
|
|
76
|
+
title: 'List Build Servers',
|
|
77
|
+
description: 'List Dokploy servers configured specifically for build workloads.',
|
|
78
|
+
schema: z.object({}).strict(),
|
|
79
|
+
endpoint: '/server.buildServers',
|
|
80
|
+
});
|
|
81
|
+
const validate = getTool({
|
|
82
|
+
name: 'dokploy_server_validate',
|
|
83
|
+
title: 'Validate Server',
|
|
84
|
+
description: 'Validate the SSH connectivity and server configuration for a Dokploy server. Requires the server ID.',
|
|
85
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
86
|
+
endpoint: '/server.validate',
|
|
87
|
+
});
|
|
88
|
+
const security = getTool({
|
|
89
|
+
name: 'dokploy_server_security',
|
|
90
|
+
title: 'Get Server Security',
|
|
91
|
+
description: 'Retrieve the server security posture and checks for a Dokploy server. Requires the server ID.',
|
|
92
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
93
|
+
endpoint: '/server.security',
|
|
94
|
+
});
|
|
95
|
+
const publicIp = getTool({
|
|
96
|
+
name: 'dokploy_server_public_ip',
|
|
97
|
+
title: 'Get Public IP',
|
|
98
|
+
description: 'Get the public IP address detected by Dokploy for the current installation.',
|
|
99
|
+
schema: z.object({}).strict(),
|
|
100
|
+
endpoint: '/server.publicIp',
|
|
101
|
+
});
|
|
102
|
+
const getServerTime = getTool({
|
|
103
|
+
name: 'dokploy_server_get_server_time',
|
|
104
|
+
title: 'Get Server Time',
|
|
105
|
+
description: 'Get the current server time reported by Dokploy.',
|
|
106
|
+
schema: z.object({}).strict(),
|
|
107
|
+
endpoint: '/server.getServerTime',
|
|
108
|
+
});
|
|
109
|
+
const getServerMetrics = getTool({
|
|
110
|
+
name: 'dokploy_server_get_server_metrics',
|
|
111
|
+
title: 'Get Server Metrics',
|
|
112
|
+
description: 'Retrieve server monitoring metrics from Dokploy. Requires the monitoring URL, token, and number of data points.',
|
|
113
|
+
schema: z
|
|
114
|
+
.object({
|
|
115
|
+
url: z.string().describe('Monitoring URL'),
|
|
116
|
+
token: z.string().describe('Monitoring token'),
|
|
117
|
+
dataPoints: z.string().describe('Number of data points'),
|
|
118
|
+
})
|
|
119
|
+
.strict(),
|
|
120
|
+
endpoint: '/server.getServerMetrics',
|
|
121
|
+
});
|
|
122
|
+
const getDefaultCommand = getTool({
|
|
123
|
+
name: 'dokploy_server_get_default_command',
|
|
124
|
+
title: 'Get Default Server Command',
|
|
125
|
+
description: 'Get the default provisioning command for a Dokploy server. Requires the server ID.',
|
|
126
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
127
|
+
endpoint: '/server.getDefaultCommand',
|
|
128
|
+
});
|
|
129
|
+
const create = postTool({
|
|
130
|
+
name: 'dokploy_server_create',
|
|
131
|
+
title: 'Create Server',
|
|
132
|
+
description: 'Create a new Dokploy server. Requires connection details, server type, and the linked SSH key ID or null for an unmanaged key.',
|
|
133
|
+
schema: serverPayload,
|
|
134
|
+
endpoint: '/server.create',
|
|
135
|
+
});
|
|
136
|
+
const update = postTool({
|
|
137
|
+
name: 'dokploy_server_update',
|
|
138
|
+
title: 'Update Server',
|
|
139
|
+
description: 'Update an existing Dokploy server. Requires the server ID together with the current server connection details and role. Optionally provide a command override.',
|
|
140
|
+
schema: serverPayload
|
|
141
|
+
.extend({
|
|
142
|
+
serverId: serverIdSchema,
|
|
143
|
+
command: z.string().optional().describe('Optional command override'),
|
|
144
|
+
})
|
|
145
|
+
.strict(),
|
|
146
|
+
endpoint: '/server.update',
|
|
147
|
+
});
|
|
148
|
+
const remove = postTool({
|
|
149
|
+
name: 'dokploy_server_remove',
|
|
150
|
+
title: 'Remove Server',
|
|
151
|
+
description: 'Permanently remove a Dokploy server from the installation. Requires the server ID. This operation is destructive.',
|
|
152
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
153
|
+
endpoint: '/server.remove',
|
|
154
|
+
annotations: { destructiveHint: true },
|
|
155
|
+
});
|
|
156
|
+
const setup = postTool({
|
|
157
|
+
name: 'dokploy_server_setup',
|
|
158
|
+
title: 'Setup Server',
|
|
159
|
+
description: 'Run the Dokploy setup workflow on an existing server. Requires the server ID.',
|
|
160
|
+
schema: z.object({ serverId: serverIdSchema }).strict(),
|
|
161
|
+
endpoint: '/server.setup',
|
|
162
|
+
});
|
|
163
|
+
const setupMonitoring = postTool({
|
|
164
|
+
name: 'dokploy_server_setup_monitoring',
|
|
165
|
+
title: 'Setup Server Monitoring',
|
|
166
|
+
description: 'Configure monitoring for a Dokploy server. Requires the server ID and a complete monitoring configuration.',
|
|
167
|
+
schema: z
|
|
168
|
+
.object({
|
|
169
|
+
serverId: serverIdSchema,
|
|
170
|
+
metricsConfig: metricsConfigSchema.describe('Monitoring configuration'),
|
|
171
|
+
})
|
|
172
|
+
.strict(),
|
|
173
|
+
endpoint: '/server.setupMonitoring',
|
|
174
|
+
});
|
|
175
|
+
export const serverTools = [
|
|
176
|
+
all,
|
|
177
|
+
one,
|
|
178
|
+
count,
|
|
179
|
+
withSshKey,
|
|
180
|
+
buildServers,
|
|
181
|
+
validate,
|
|
182
|
+
security,
|
|
183
|
+
publicIp,
|
|
184
|
+
getServerTime,
|
|
185
|
+
getServerMetrics,
|
|
186
|
+
getDefaultCommand,
|
|
187
|
+
create,
|
|
188
|
+
update,
|
|
189
|
+
remove,
|
|
190
|
+
setup,
|
|
191
|
+
setupMonitoring,
|
|
192
|
+
];
|
package/dist/tools/settings.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { getTool, postTool } from './_factory.js';
|
|
3
3
|
// ── tools ────────────────────────────────────────────────────────────
|
|
4
|
+
const optionalServerId = z.string().optional().describe('Optional server ID');
|
|
5
|
+
const protocolSchema = z.enum(['tcp', 'udp', 'sctp']).describe('Port protocol');
|
|
4
6
|
const reloadServer = postTool({
|
|
5
7
|
name: 'dokploy_settings_reload_server',
|
|
6
8
|
title: 'Reload Server',
|
|
@@ -228,6 +230,231 @@ const updateTraefikFile = postTool({
|
|
|
228
230
|
.strict(),
|
|
229
231
|
endpoint: '/settings.updateTraefikFile',
|
|
230
232
|
});
|
|
233
|
+
const readTraefikEnv = getTool({
|
|
234
|
+
name: 'dokploy_settings_read_traefik_env',
|
|
235
|
+
title: 'Read Traefik Environment',
|
|
236
|
+
description: 'Read the Traefik environment configuration from Dokploy. Optionally scope the request to a specific server.',
|
|
237
|
+
schema: z
|
|
238
|
+
.object({
|
|
239
|
+
serverId: optionalServerId,
|
|
240
|
+
})
|
|
241
|
+
.strict(),
|
|
242
|
+
endpoint: '/settings.readTraefikEnv',
|
|
243
|
+
});
|
|
244
|
+
const writeTraefikEnv = postTool({
|
|
245
|
+
name: 'dokploy_settings_write_traefik_env',
|
|
246
|
+
title: 'Write Traefik Environment',
|
|
247
|
+
description: 'Write the Traefik environment configuration in Dokploy. Requires the environment content and optionally accepts a server ID.',
|
|
248
|
+
schema: z
|
|
249
|
+
.object({
|
|
250
|
+
env: z.string().describe('Traefik environment content'),
|
|
251
|
+
serverId: optionalServerId,
|
|
252
|
+
})
|
|
253
|
+
.strict(),
|
|
254
|
+
endpoint: '/settings.writeTraefikEnv',
|
|
255
|
+
});
|
|
256
|
+
const updateTraefikPorts = postTool({
|
|
257
|
+
name: 'dokploy_settings_update_traefik_ports',
|
|
258
|
+
title: 'Update Traefik Ports',
|
|
259
|
+
description: 'Update additional Traefik ports in Dokploy. Requires the list of additional ports and optionally accepts a server ID.',
|
|
260
|
+
schema: z
|
|
261
|
+
.object({
|
|
262
|
+
serverId: optionalServerId,
|
|
263
|
+
additionalPorts: z
|
|
264
|
+
.array(z
|
|
265
|
+
.object({
|
|
266
|
+
targetPort: z.number().describe('Target port'),
|
|
267
|
+
publishedPort: z.number().describe('Published port'),
|
|
268
|
+
protocol: protocolSchema,
|
|
269
|
+
})
|
|
270
|
+
.strict())
|
|
271
|
+
.describe('Additional Traefik ports'),
|
|
272
|
+
})
|
|
273
|
+
.strict(),
|
|
274
|
+
endpoint: '/settings.updateTraefikPorts',
|
|
275
|
+
});
|
|
276
|
+
const getTraefikPorts = getTool({
|
|
277
|
+
name: 'dokploy_settings_get_traefik_ports',
|
|
278
|
+
title: 'Get Traefik Ports',
|
|
279
|
+
description: 'Get Traefik ports configured in Dokploy. Optionally scope the request to a specific server.',
|
|
280
|
+
schema: z
|
|
281
|
+
.object({
|
|
282
|
+
serverId: optionalServerId,
|
|
283
|
+
})
|
|
284
|
+
.strict(),
|
|
285
|
+
endpoint: '/settings.getTraefikPorts',
|
|
286
|
+
});
|
|
287
|
+
const haveTraefikDashboardPortEnabled = getTool({
|
|
288
|
+
name: 'dokploy_settings_have_traefik_dashboard_port_enabled',
|
|
289
|
+
title: 'Check Traefik Dashboard Port',
|
|
290
|
+
description: 'Check whether the Traefik dashboard port is enabled in Dokploy. Optionally scope the request to a specific server.',
|
|
291
|
+
schema: z
|
|
292
|
+
.object({
|
|
293
|
+
serverId: optionalServerId,
|
|
294
|
+
})
|
|
295
|
+
.strict(),
|
|
296
|
+
endpoint: '/settings.haveTraefikDashboardPortEnabled',
|
|
297
|
+
});
|
|
298
|
+
const toggleDashboard = postTool({
|
|
299
|
+
name: 'dokploy_settings_toggle_dashboard',
|
|
300
|
+
title: 'Toggle Traefik Dashboard',
|
|
301
|
+
description: 'Enable or disable the Traefik dashboard in Dokploy. Optionally scope the request to a specific server.',
|
|
302
|
+
schema: z
|
|
303
|
+
.object({
|
|
304
|
+
enableDashboard: z.boolean().optional().describe('Whether to enable the dashboard'),
|
|
305
|
+
serverId: optionalServerId,
|
|
306
|
+
})
|
|
307
|
+
.strict(),
|
|
308
|
+
endpoint: '/settings.toggleDashboard',
|
|
309
|
+
});
|
|
310
|
+
const health = getTool({
|
|
311
|
+
name: 'dokploy_settings_health',
|
|
312
|
+
title: 'Get Dokploy Health',
|
|
313
|
+
description: 'Get the current health status of the Dokploy installation.',
|
|
314
|
+
schema: z.object({}).strict(),
|
|
315
|
+
endpoint: '/settings.health',
|
|
316
|
+
});
|
|
317
|
+
const getIp = getTool({
|
|
318
|
+
name: 'dokploy_settings_get_ip',
|
|
319
|
+
title: 'Get Server IP',
|
|
320
|
+
description: 'Get the server IP address known to Dokploy.',
|
|
321
|
+
schema: z.object({}).strict(),
|
|
322
|
+
endpoint: '/settings.getIp',
|
|
323
|
+
});
|
|
324
|
+
const updateServerIp = postTool({
|
|
325
|
+
name: 'dokploy_settings_update_server_ip',
|
|
326
|
+
title: 'Update Server IP',
|
|
327
|
+
description: 'Update the server IP address used by Dokploy.',
|
|
328
|
+
schema: z
|
|
329
|
+
.object({
|
|
330
|
+
serverIp: z.string().describe('Server IP address'),
|
|
331
|
+
})
|
|
332
|
+
.strict(),
|
|
333
|
+
endpoint: '/settings.updateServerIp',
|
|
334
|
+
});
|
|
335
|
+
const getWebServerSettings = getTool({
|
|
336
|
+
name: 'dokploy_settings_get_web_server_settings',
|
|
337
|
+
title: 'Get Web Server Settings',
|
|
338
|
+
description: 'Get web server settings configured in Dokploy.',
|
|
339
|
+
schema: z.object({}).strict(),
|
|
340
|
+
endpoint: '/settings.getWebServerSettings',
|
|
341
|
+
});
|
|
342
|
+
const getUpdateData = postTool({
|
|
343
|
+
name: 'dokploy_settings_get_update_data',
|
|
344
|
+
title: 'Get Update Data',
|
|
345
|
+
description: 'Get update metadata for the current Dokploy installation.',
|
|
346
|
+
schema: z.object({}).strict(),
|
|
347
|
+
endpoint: '/settings.getUpdateData',
|
|
348
|
+
});
|
|
349
|
+
const getReleaseTag = getTool({
|
|
350
|
+
name: 'dokploy_settings_get_release_tag',
|
|
351
|
+
title: 'Get Release Tag',
|
|
352
|
+
description: 'Get the latest Dokploy release tag visible to the current installation.',
|
|
353
|
+
schema: z.object({}).strict(),
|
|
354
|
+
endpoint: '/settings.getReleaseTag',
|
|
355
|
+
});
|
|
356
|
+
const cleanRedis = postTool({
|
|
357
|
+
name: 'dokploy_settings_clean_redis',
|
|
358
|
+
title: 'Clean Redis',
|
|
359
|
+
description: 'Clean Dokploy Redis data. This is a destructive maintenance action.',
|
|
360
|
+
schema: z.object({}).strict(),
|
|
361
|
+
endpoint: '/settings.cleanRedis',
|
|
362
|
+
annotations: { destructiveHint: true },
|
|
363
|
+
});
|
|
364
|
+
const reloadRedis = postTool({
|
|
365
|
+
name: 'dokploy_settings_reload_redis',
|
|
366
|
+
title: 'Reload Redis',
|
|
367
|
+
description: 'Reload Dokploy Redis.',
|
|
368
|
+
schema: z.object({}).strict(),
|
|
369
|
+
endpoint: '/settings.reloadRedis',
|
|
370
|
+
});
|
|
371
|
+
const cleanAllDeploymentQueue = postTool({
|
|
372
|
+
name: 'dokploy_settings_clean_all_deployment_queue',
|
|
373
|
+
title: 'Clean Deployment Queue',
|
|
374
|
+
description: 'Clear the Dokploy deployment queue. This is a destructive maintenance action.',
|
|
375
|
+
schema: z.object({}).strict(),
|
|
376
|
+
endpoint: '/settings.cleanAllDeploymentQueue',
|
|
377
|
+
annotations: { destructiveHint: true },
|
|
378
|
+
});
|
|
379
|
+
const updateLogCleanup = postTool({
|
|
380
|
+
name: 'dokploy_settings_update_log_cleanup',
|
|
381
|
+
title: 'Update Log Cleanup Schedule',
|
|
382
|
+
description: 'Update the Dokploy log cleanup schedule.',
|
|
383
|
+
schema: z
|
|
384
|
+
.object({
|
|
385
|
+
cronExpression: z.string().nullable().describe('Cron expression for log cleanup'),
|
|
386
|
+
})
|
|
387
|
+
.strict(),
|
|
388
|
+
endpoint: '/settings.updateLogCleanup',
|
|
389
|
+
});
|
|
390
|
+
const getLogCleanupStatus = getTool({
|
|
391
|
+
name: 'dokploy_settings_get_log_cleanup_status',
|
|
392
|
+
title: 'Get Log Cleanup Status',
|
|
393
|
+
description: 'Get the current Dokploy log cleanup configuration and status.',
|
|
394
|
+
schema: z.object({}).strict(),
|
|
395
|
+
endpoint: '/settings.getLogCleanupStatus',
|
|
396
|
+
});
|
|
397
|
+
const setupGpu = postTool({
|
|
398
|
+
name: 'dokploy_settings_setup_gpu',
|
|
399
|
+
title: 'Setup GPU',
|
|
400
|
+
description: 'Run Dokploy GPU setup. Optionally scope the request to a specific server.',
|
|
401
|
+
schema: z
|
|
402
|
+
.object({
|
|
403
|
+
serverId: optionalServerId,
|
|
404
|
+
})
|
|
405
|
+
.strict(),
|
|
406
|
+
endpoint: '/settings.setupGPU',
|
|
407
|
+
});
|
|
408
|
+
const checkGpuStatus = getTool({
|
|
409
|
+
name: 'dokploy_settings_check_gpu_status',
|
|
410
|
+
title: 'Check GPU Status',
|
|
411
|
+
description: 'Check Dokploy GPU status. Optionally scope the request to a specific server.',
|
|
412
|
+
schema: z
|
|
413
|
+
.object({
|
|
414
|
+
serverId: optionalServerId,
|
|
415
|
+
})
|
|
416
|
+
.strict(),
|
|
417
|
+
endpoint: '/settings.checkGPUStatus',
|
|
418
|
+
});
|
|
419
|
+
const isCloud = getTool({
|
|
420
|
+
name: 'dokploy_settings_is_cloud',
|
|
421
|
+
title: 'Check Cloud Mode',
|
|
422
|
+
description: 'Check whether the current Dokploy installation runs in cloud mode.',
|
|
423
|
+
schema: z.object({}).strict(),
|
|
424
|
+
endpoint: '/settings.isCloud',
|
|
425
|
+
});
|
|
426
|
+
const isUserSubscribed = getTool({
|
|
427
|
+
name: 'dokploy_settings_is_user_subscribed',
|
|
428
|
+
title: 'Check Subscription Status',
|
|
429
|
+
description: 'Check whether the current Dokploy user has an active subscription.',
|
|
430
|
+
schema: z.object({}).strict(),
|
|
431
|
+
endpoint: '/settings.isUserSubscribed',
|
|
432
|
+
});
|
|
433
|
+
const haveActivateRequests = getTool({
|
|
434
|
+
name: 'dokploy_settings_have_activate_requests',
|
|
435
|
+
title: 'Check Request Logging',
|
|
436
|
+
description: 'Check whether request handling features are enabled in Dokploy.',
|
|
437
|
+
schema: z.object({}).strict(),
|
|
438
|
+
endpoint: '/settings.haveActivateRequests',
|
|
439
|
+
});
|
|
440
|
+
const toggleRequests = postTool({
|
|
441
|
+
name: 'dokploy_settings_toggle_requests',
|
|
442
|
+
title: 'Toggle Requests',
|
|
443
|
+
description: 'Enable or disable request handling features in Dokploy.',
|
|
444
|
+
schema: z
|
|
445
|
+
.object({
|
|
446
|
+
enable: z.boolean().describe('Whether to enable requests'),
|
|
447
|
+
})
|
|
448
|
+
.strict(),
|
|
449
|
+
endpoint: '/settings.toggleRequests',
|
|
450
|
+
});
|
|
451
|
+
const getDokployCloudIps = getTool({
|
|
452
|
+
name: 'dokploy_settings_get_dokploy_cloud_ips',
|
|
453
|
+
title: 'Get Dokploy Cloud IPs',
|
|
454
|
+
description: 'Get Dokploy Cloud IP ranges.',
|
|
455
|
+
schema: z.object({}).strict(),
|
|
456
|
+
endpoint: '/settings.getDokployCloudIps',
|
|
457
|
+
});
|
|
231
458
|
// ── export ───────────────────────────────────────────────────────────
|
|
232
459
|
export const settingsTools = [
|
|
233
460
|
reloadServer,
|
|
@@ -255,4 +482,28 @@ export const settingsTools = [
|
|
|
255
482
|
getOpenApiDocument,
|
|
256
483
|
readTraefikFile,
|
|
257
484
|
updateTraefikFile,
|
|
485
|
+
readTraefikEnv,
|
|
486
|
+
writeTraefikEnv,
|
|
487
|
+
updateTraefikPorts,
|
|
488
|
+
getTraefikPorts,
|
|
489
|
+
haveTraefikDashboardPortEnabled,
|
|
490
|
+
toggleDashboard,
|
|
491
|
+
health,
|
|
492
|
+
getIp,
|
|
493
|
+
updateServerIp,
|
|
494
|
+
getWebServerSettings,
|
|
495
|
+
getUpdateData,
|
|
496
|
+
getReleaseTag,
|
|
497
|
+
cleanRedis,
|
|
498
|
+
reloadRedis,
|
|
499
|
+
cleanAllDeploymentQueue,
|
|
500
|
+
updateLogCleanup,
|
|
501
|
+
getLogCleanupStatus,
|
|
502
|
+
setupGpu,
|
|
503
|
+
checkGpuStatus,
|
|
504
|
+
isCloud,
|
|
505
|
+
isUserSubscribed,
|
|
506
|
+
haveActivateRequests,
|
|
507
|
+
toggleRequests,
|
|
508
|
+
getDokployCloudIps,
|
|
258
509
|
];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const nullableString = z.string().nullable().optional();
|
|
4
|
+
const all = getTool({
|
|
5
|
+
name: 'dokploy_ssh_key_all',
|
|
6
|
+
title: 'List SSH Keys',
|
|
7
|
+
description: 'List all SSH keys available in Dokploy. Returns stored keys together with their metadata and organization context.',
|
|
8
|
+
schema: z.object({}).strict(),
|
|
9
|
+
endpoint: '/sshKey.all',
|
|
10
|
+
});
|
|
11
|
+
const create = postTool({
|
|
12
|
+
name: 'dokploy_ssh_key_create',
|
|
13
|
+
title: 'Create SSH Key',
|
|
14
|
+
description: 'Create a new SSH key record in Dokploy. Requires the key pair and a name. Optionally set a description and organization ID.',
|
|
15
|
+
schema: z
|
|
16
|
+
.object({
|
|
17
|
+
name: z.string().min(1).describe('SSH key name'),
|
|
18
|
+
description: z.string().nullable().optional().describe('SSH key description'),
|
|
19
|
+
privateKey: z.string().describe('Private key content'),
|
|
20
|
+
publicKey: z.string().describe('Public key content'),
|
|
21
|
+
organizationId: z.string().optional().describe('Organization ID'),
|
|
22
|
+
})
|
|
23
|
+
.strict(),
|
|
24
|
+
endpoint: '/sshKey.create',
|
|
25
|
+
});
|
|
26
|
+
const generate = postTool({
|
|
27
|
+
name: 'dokploy_ssh_key_generate',
|
|
28
|
+
title: 'Generate SSH Key Pair',
|
|
29
|
+
description: 'Generate a new SSH key pair in Dokploy. Optionally specify the key type; supported values are rsa and ed25519.',
|
|
30
|
+
schema: z
|
|
31
|
+
.object({
|
|
32
|
+
type: z.enum(['rsa', 'ed25519']).optional().describe('SSH key type'),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
endpoint: '/sshKey.generate',
|
|
36
|
+
});
|
|
37
|
+
const one = getTool({
|
|
38
|
+
name: 'dokploy_ssh_key_one',
|
|
39
|
+
title: 'Get SSH Key',
|
|
40
|
+
description: 'Retrieve detailed information about a Dokploy SSH key by its ID.',
|
|
41
|
+
schema: z
|
|
42
|
+
.object({
|
|
43
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
endpoint: '/sshKey.one',
|
|
47
|
+
});
|
|
48
|
+
const remove = postTool({
|
|
49
|
+
name: 'dokploy_ssh_key_remove',
|
|
50
|
+
title: 'Remove SSH Key',
|
|
51
|
+
description: 'Permanently remove an SSH key from Dokploy. Requires the SSH key ID. This is a destructive action.',
|
|
52
|
+
schema: z
|
|
53
|
+
.object({
|
|
54
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
55
|
+
})
|
|
56
|
+
.strict(),
|
|
57
|
+
endpoint: '/sshKey.remove',
|
|
58
|
+
annotations: { destructiveHint: true },
|
|
59
|
+
});
|
|
60
|
+
const update = postTool({
|
|
61
|
+
name: 'dokploy_ssh_key_update',
|
|
62
|
+
title: 'Update SSH Key',
|
|
63
|
+
description: 'Update metadata for a Dokploy SSH key. Requires the SSH key ID and accepts optional name, description, and last-used timestamp changes.',
|
|
64
|
+
schema: z
|
|
65
|
+
.object({
|
|
66
|
+
sshKeyId: z.string().min(1).describe('SSH key ID'),
|
|
67
|
+
name: z.string().min(1).optional().describe('SSH key name'),
|
|
68
|
+
description: nullableString.describe('SSH key description'),
|
|
69
|
+
lastUsedAt: nullableString.describe('Last used timestamp'),
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
endpoint: '/sshKey.update',
|
|
73
|
+
});
|
|
74
|
+
export const sshKeyTools = [all, create, generate, one, remove, update];
|