@vibetools/dokploy-mcp 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -14
- package/dist/api/client.d.ts +2 -0
- package/dist/api/client.js +44 -11
- package/dist/tools/_database.js +25 -6
- package/dist/tools/_factory.d.ts +2 -0
- package/dist/tools/_factory.js +21 -4
- package/dist/tools/application.js +219 -82
- package/dist/tools/backup.js +30 -0
- package/dist/tools/compose.js +273 -35
- package/dist/tools/deployment.js +82 -2
- package/dist/tools/docker.js +62 -2
- package/dist/tools/domain.js +15 -2
- package/dist/tools/environment.d.ts +2 -0
- package/dist/tools/environment.js +104 -0
- package/dist/tools/git-provider.d.ts +2 -0
- package/dist/tools/git-provider.js +22 -0
- package/dist/tools/github.d.ts +2 -0
- package/dist/tools/github.js +66 -0
- package/dist/tools/gitlab.d.ts +2 -0
- package/dist/tools/gitlab.js +98 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/mariadb.js +1 -1
- package/dist/tools/mongo.js +2 -1
- package/dist/tools/mounts.js +53 -9
- package/dist/tools/mysql.js +1 -1
- package/dist/tools/notification.d.ts +2 -0
- package/dist/tools/notification.js +559 -0
- package/dist/tools/patch.d.ts +2 -0
- package/dist/tools/patch.js +179 -0
- package/dist/tools/postgres.js +1 -1
- package/dist/tools/preview-deployment.d.ts +2 -0
- package/dist/tools/preview-deployment.js +50 -0
- package/dist/tools/project.js +32 -1
- package/dist/tools/redis.js +1 -1
- package/dist/tools/rollback.d.ts +2 -0
- package/dist/tools/rollback.js +28 -0
- package/dist/tools/schedule.d.ts +2 -0
- package/dist/tools/schedule.js +92 -0
- package/dist/tools/server.d.ts +2 -0
- package/dist/tools/server.js +192 -0
- package/dist/tools/settings.js +251 -0
- package/dist/tools/ssh-key.d.ts +2 -0
- package/dist/tools/ssh-key.js +74 -0
- package/dist/tools/user.js +75 -2
- package/dist/tools/volume-backups.d.ts +2 -0
- package/dist/tools/volume-backups.js +96 -0
- package/package.json +1 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const entityTypeSchema = z.enum(['application', 'compose']).describe('Entity type');
|
|
4
|
+
const patchTypeSchema = z.enum(['create', 'update', 'delete']).describe('Patch type');
|
|
5
|
+
const savePatchTypeSchema = z.enum(['create', 'update']).default('update').describe('Patch type');
|
|
6
|
+
const nullableString = z.string().nullable().optional();
|
|
7
|
+
const create = postTool({
|
|
8
|
+
name: 'dokploy_patch_create',
|
|
9
|
+
title: 'Create Patch',
|
|
10
|
+
description: 'Create a new patch record in Dokploy. Requires the file path and file content. Optionally associate the patch with an application or compose service.',
|
|
11
|
+
schema: z
|
|
12
|
+
.object({
|
|
13
|
+
filePath: z.string().min(1).describe('File path inside the repository'),
|
|
14
|
+
content: z.string().describe('File content'),
|
|
15
|
+
type: patchTypeSchema.optional(),
|
|
16
|
+
enabled: z.boolean().optional().describe('Whether the patch is enabled'),
|
|
17
|
+
applicationId: nullableString.describe('Application ID'),
|
|
18
|
+
composeId: nullableString.describe('Compose ID'),
|
|
19
|
+
})
|
|
20
|
+
.strict(),
|
|
21
|
+
endpoint: '/patch.create',
|
|
22
|
+
});
|
|
23
|
+
const one = getTool({
|
|
24
|
+
name: 'dokploy_patch_one',
|
|
25
|
+
title: 'Get Patch',
|
|
26
|
+
description: 'Retrieve a patch record by its ID.',
|
|
27
|
+
schema: z
|
|
28
|
+
.object({
|
|
29
|
+
patchId: z.string().min(1).describe('Patch ID'),
|
|
30
|
+
})
|
|
31
|
+
.strict(),
|
|
32
|
+
endpoint: '/patch.one',
|
|
33
|
+
});
|
|
34
|
+
const byEntityId = getTool({
|
|
35
|
+
name: 'dokploy_patch_by_entity_id',
|
|
36
|
+
title: 'List Patches by Entity',
|
|
37
|
+
description: 'List patches associated with a Dokploy application or compose service. Requires the entity ID and entity type.',
|
|
38
|
+
schema: z
|
|
39
|
+
.object({
|
|
40
|
+
id: z.string().describe('Entity ID'),
|
|
41
|
+
type: entityTypeSchema,
|
|
42
|
+
})
|
|
43
|
+
.strict(),
|
|
44
|
+
endpoint: '/patch.byEntityId',
|
|
45
|
+
});
|
|
46
|
+
const update = postTool({
|
|
47
|
+
name: 'dokploy_patch_update',
|
|
48
|
+
title: 'Update Patch',
|
|
49
|
+
description: 'Update an existing patch record in Dokploy. Requires the patch ID and optionally accepts updated type, file path, content, enablement state, and timestamps.',
|
|
50
|
+
schema: z
|
|
51
|
+
.object({
|
|
52
|
+
patchId: z.string().min(1).describe('Patch ID'),
|
|
53
|
+
type: patchTypeSchema.optional(),
|
|
54
|
+
filePath: z.string().min(1).optional().describe('File path inside the repository'),
|
|
55
|
+
enabled: z.boolean().optional().describe('Whether the patch is enabled'),
|
|
56
|
+
content: z.string().optional().describe('File content'),
|
|
57
|
+
createdAt: z.string().optional().describe('Creation timestamp'),
|
|
58
|
+
updatedAt: nullableString.describe('Update timestamp'),
|
|
59
|
+
})
|
|
60
|
+
.strict(),
|
|
61
|
+
endpoint: '/patch.update',
|
|
62
|
+
});
|
|
63
|
+
const remove = postTool({
|
|
64
|
+
name: 'dokploy_patch_delete',
|
|
65
|
+
title: 'Delete Patch',
|
|
66
|
+
description: 'Delete a patch record from Dokploy. Requires the patch ID. This is a destructive action.',
|
|
67
|
+
schema: z
|
|
68
|
+
.object({
|
|
69
|
+
patchId: z.string().min(1).describe('Patch ID'),
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
endpoint: '/patch.delete',
|
|
73
|
+
annotations: { destructiveHint: true },
|
|
74
|
+
});
|
|
75
|
+
const toggleEnabled = postTool({
|
|
76
|
+
name: 'dokploy_patch_toggle_enabled',
|
|
77
|
+
title: 'Toggle Patch',
|
|
78
|
+
description: 'Enable or disable a patch record in Dokploy. Requires the patch ID and the desired enabled state.',
|
|
79
|
+
schema: z
|
|
80
|
+
.object({
|
|
81
|
+
patchId: z.string().min(1).describe('Patch ID'),
|
|
82
|
+
enabled: z.boolean().describe('Whether the patch should be enabled'),
|
|
83
|
+
})
|
|
84
|
+
.strict(),
|
|
85
|
+
endpoint: '/patch.toggleEnabled',
|
|
86
|
+
});
|
|
87
|
+
const ensureRepo = postTool({
|
|
88
|
+
name: 'dokploy_patch_ensure_repo',
|
|
89
|
+
title: 'Ensure Patch Repository',
|
|
90
|
+
description: 'Ensure that the local patch repository exists for a Dokploy application or compose service. Requires the entity ID and entity type.',
|
|
91
|
+
schema: z
|
|
92
|
+
.object({
|
|
93
|
+
id: z.string().describe('Entity ID'),
|
|
94
|
+
type: entityTypeSchema,
|
|
95
|
+
})
|
|
96
|
+
.strict(),
|
|
97
|
+
endpoint: '/patch.ensureRepo',
|
|
98
|
+
});
|
|
99
|
+
const readRepoDirectories = getTool({
|
|
100
|
+
name: 'dokploy_patch_read_repo_directories',
|
|
101
|
+
title: 'Read Patch Repository Directories',
|
|
102
|
+
description: 'Read directory entries inside a patch repository. Requires the entity ID, entity type, and repository path.',
|
|
103
|
+
schema: z
|
|
104
|
+
.object({
|
|
105
|
+
id: z.string().min(1).describe('Entity ID'),
|
|
106
|
+
type: entityTypeSchema,
|
|
107
|
+
repoPath: z.string().describe('Repository path'),
|
|
108
|
+
})
|
|
109
|
+
.strict(),
|
|
110
|
+
endpoint: '/patch.readRepoDirectories',
|
|
111
|
+
});
|
|
112
|
+
const readRepoFile = getTool({
|
|
113
|
+
name: 'dokploy_patch_read_repo_file',
|
|
114
|
+
title: 'Read Patch Repository File',
|
|
115
|
+
description: 'Read a file from a patch repository. Requires the entity ID, entity type, and file path.',
|
|
116
|
+
schema: z
|
|
117
|
+
.object({
|
|
118
|
+
id: z.string().min(1).describe('Entity ID'),
|
|
119
|
+
type: entityTypeSchema,
|
|
120
|
+
filePath: z.string().describe('File path'),
|
|
121
|
+
})
|
|
122
|
+
.strict(),
|
|
123
|
+
endpoint: '/patch.readRepoFile',
|
|
124
|
+
});
|
|
125
|
+
const saveFileAsPatch = postTool({
|
|
126
|
+
name: 'dokploy_patch_save_file_as_patch',
|
|
127
|
+
title: 'Save File as Patch',
|
|
128
|
+
description: 'Create or update a patch record from file content. Requires the entity ID, entity type, file path, and content.',
|
|
129
|
+
schema: z
|
|
130
|
+
.object({
|
|
131
|
+
id: z.string().min(1).describe('Entity ID'),
|
|
132
|
+
type: entityTypeSchema,
|
|
133
|
+
filePath: z.string().describe('File path'),
|
|
134
|
+
content: z.string().describe('File content'),
|
|
135
|
+
patchType: savePatchTypeSchema.optional(),
|
|
136
|
+
})
|
|
137
|
+
.strict(),
|
|
138
|
+
endpoint: '/patch.saveFileAsPatch',
|
|
139
|
+
});
|
|
140
|
+
const markFileForDeletion = postTool({
|
|
141
|
+
name: 'dokploy_patch_mark_file_for_deletion',
|
|
142
|
+
title: 'Mark File for Deletion',
|
|
143
|
+
description: 'Mark a file for deletion through the Dokploy patch workflow. Requires the entity ID, entity type, and file path.',
|
|
144
|
+
schema: z
|
|
145
|
+
.object({
|
|
146
|
+
id: z.string().min(1).describe('Entity ID'),
|
|
147
|
+
type: entityTypeSchema,
|
|
148
|
+
filePath: z.string().describe('File path'),
|
|
149
|
+
})
|
|
150
|
+
.strict(),
|
|
151
|
+
endpoint: '/patch.markFileForDeletion',
|
|
152
|
+
annotations: { destructiveHint: true },
|
|
153
|
+
});
|
|
154
|
+
const cleanPatchRepos = postTool({
|
|
155
|
+
name: 'dokploy_patch_clean_patch_repos',
|
|
156
|
+
title: 'Clean Patch Repositories',
|
|
157
|
+
description: 'Clean Dokploy patch repositories. Optionally scope the cleanup to a specific server.',
|
|
158
|
+
schema: z
|
|
159
|
+
.object({
|
|
160
|
+
serverId: z.string().optional().describe('Optional server ID'),
|
|
161
|
+
})
|
|
162
|
+
.strict(),
|
|
163
|
+
endpoint: '/patch.cleanPatchRepos',
|
|
164
|
+
annotations: { destructiveHint: true },
|
|
165
|
+
});
|
|
166
|
+
export const patchTools = [
|
|
167
|
+
create,
|
|
168
|
+
one,
|
|
169
|
+
byEntityId,
|
|
170
|
+
update,
|
|
171
|
+
remove,
|
|
172
|
+
toggleEnabled,
|
|
173
|
+
ensureRepo,
|
|
174
|
+
readRepoDirectories,
|
|
175
|
+
readRepoFile,
|
|
176
|
+
saveFileAsPatch,
|
|
177
|
+
markFileForDeletion,
|
|
178
|
+
cleanPatchRepos,
|
|
179
|
+
];
|
package/dist/tools/postgres.js
CHANGED
|
@@ -4,7 +4,7 @@ export const postgresTools = createDatabaseTools({
|
|
|
4
4
|
type: 'postgres',
|
|
5
5
|
idField: 'postgresId',
|
|
6
6
|
displayName: 'Postgres',
|
|
7
|
-
defaultImage: 'postgres:
|
|
7
|
+
defaultImage: 'postgres:18',
|
|
8
8
|
createFields: z.object({
|
|
9
9
|
databaseName: z.string().min(1).describe('Name of the database to create'),
|
|
10
10
|
databaseUser: z.string().min(1).describe('Database user'),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getTool, postTool } from './_factory.js';
|
|
3
|
+
const all = getTool({
|
|
4
|
+
name: 'dokploy_preview_deployment_all',
|
|
5
|
+
title: 'List Preview Deployments',
|
|
6
|
+
description: 'List preview deployments for a Dokploy application. Requires the application ID.',
|
|
7
|
+
schema: z
|
|
8
|
+
.object({
|
|
9
|
+
applicationId: z.string().min(1).describe('Application ID'),
|
|
10
|
+
})
|
|
11
|
+
.strict(),
|
|
12
|
+
endpoint: '/previewDeployment.all',
|
|
13
|
+
});
|
|
14
|
+
const one = getTool({
|
|
15
|
+
name: 'dokploy_preview_deployment_one',
|
|
16
|
+
title: 'Get Preview Deployment',
|
|
17
|
+
description: 'Retrieve a preview deployment by its ID.',
|
|
18
|
+
schema: z
|
|
19
|
+
.object({
|
|
20
|
+
previewDeploymentId: z.string().describe('Preview deployment ID'),
|
|
21
|
+
})
|
|
22
|
+
.strict(),
|
|
23
|
+
endpoint: '/previewDeployment.one',
|
|
24
|
+
});
|
|
25
|
+
const remove = postTool({
|
|
26
|
+
name: 'dokploy_preview_deployment_delete',
|
|
27
|
+
title: 'Delete Preview Deployment',
|
|
28
|
+
description: 'Delete a preview deployment in Dokploy. Requires the preview deployment ID. This is a destructive action.',
|
|
29
|
+
schema: z
|
|
30
|
+
.object({
|
|
31
|
+
previewDeploymentId: z.string().describe('Preview deployment ID'),
|
|
32
|
+
})
|
|
33
|
+
.strict(),
|
|
34
|
+
endpoint: '/previewDeployment.delete',
|
|
35
|
+
annotations: { destructiveHint: true },
|
|
36
|
+
});
|
|
37
|
+
const redeploy = postTool({
|
|
38
|
+
name: 'dokploy_preview_deployment_redeploy',
|
|
39
|
+
title: 'Redeploy Preview Deployment',
|
|
40
|
+
description: 'Redeploy a preview deployment in Dokploy. Requires the preview deployment ID and optionally accepts a title and description.',
|
|
41
|
+
schema: z
|
|
42
|
+
.object({
|
|
43
|
+
previewDeploymentId: z.string().describe('Preview deployment ID'),
|
|
44
|
+
title: z.string().optional().describe('Optional deployment title'),
|
|
45
|
+
description: z.string().optional().describe('Optional deployment description'),
|
|
46
|
+
})
|
|
47
|
+
.strict(),
|
|
48
|
+
endpoint: '/previewDeployment.redeploy',
|
|
49
|
+
});
|
|
50
|
+
export const previewDeploymentTools = [all, one, remove, redeploy];
|
package/dist/tools/project.js
CHANGED
|
@@ -8,6 +8,13 @@ const all = getTool({
|
|
|
8
8
|
schema: z.object({}).strict(),
|
|
9
9
|
endpoint: '/project.all',
|
|
10
10
|
});
|
|
11
|
+
const allForPermissions = getTool({
|
|
12
|
+
name: 'dokploy_project_all_for_permissions',
|
|
13
|
+
title: 'List Projects for Permissions',
|
|
14
|
+
description: 'List projects in the format used by Dokploy permission assignment workflows.',
|
|
15
|
+
schema: z.object({}).strict(),
|
|
16
|
+
endpoint: '/project.allForPermissions',
|
|
17
|
+
});
|
|
11
18
|
const one = getTool({
|
|
12
19
|
name: 'dokploy_project_one',
|
|
13
20
|
title: 'Get Project Details',
|
|
@@ -90,5 +97,29 @@ const remove = postTool({
|
|
|
90
97
|
endpoint: '/project.remove',
|
|
91
98
|
annotations: { destructiveHint: true },
|
|
92
99
|
});
|
|
100
|
+
const search = getTool({
|
|
101
|
+
name: 'dokploy_project_search',
|
|
102
|
+
title: 'Search Projects',
|
|
103
|
+
description: 'Search Dokploy projects by free text or field-specific filters. Supports pagination through limit and offset.',
|
|
104
|
+
schema: z
|
|
105
|
+
.object({
|
|
106
|
+
q: z.string().optional().describe('Free-text query'),
|
|
107
|
+
name: z.string().optional().describe('Project name'),
|
|
108
|
+
description: z.string().optional().describe('Project description'),
|
|
109
|
+
limit: z.number().min(1).max(100).optional().describe('Maximum number of results'),
|
|
110
|
+
offset: z.number().min(0).optional().describe('Number of results to skip'),
|
|
111
|
+
})
|
|
112
|
+
.strict(),
|
|
113
|
+
endpoint: '/project.search',
|
|
114
|
+
});
|
|
93
115
|
// ── export ───────────────────────────────────────────────────────────
|
|
94
|
-
export const projectTools = [
|
|
116
|
+
export const projectTools = [
|
|
117
|
+
all,
|
|
118
|
+
allForPermissions,
|
|
119
|
+
one,
|
|
120
|
+
create,
|
|
121
|
+
update,
|
|
122
|
+
duplicate,
|
|
123
|
+
remove,
|
|
124
|
+
search,
|
|
125
|
+
];
|
package/dist/tools/redis.js
CHANGED
|
@@ -4,7 +4,7 @@ export const redisTools = createDatabaseTools({
|
|
|
4
4
|
type: 'redis',
|
|
5
5
|
idField: 'redisId',
|
|
6
6
|
displayName: 'Redis',
|
|
7
|
-
defaultImage: 'redis:
|
|
7
|
+
defaultImage: 'redis:8',
|
|
8
8
|
createFields: z.object({
|
|
9
9
|
databasePassword: z.string().min(1).describe('Database password'),
|
|
10
10
|
}),
|
|
@@ -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
|
+
];
|