@vibetools/dokploy-mcp 0.5.0 → 1.0.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 -0
- package/dist/api/client.js +12 -10
- 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 +96 -0
- package/dist/tools/_factory.d.ts +1 -1
- package/dist/tools/_factory.js +15 -13
- package/dist/tools/mariadb.d.ts +1 -2
- package/dist/tools/mariadb.js +8 -164
- package/dist/tools/mongo.d.ts +1 -2
- package/dist/tools/mongo.js +8 -164
- package/dist/tools/mysql.d.ts +1 -2
- package/dist/tools/mysql.js +8 -164
- package/dist/tools/postgres.d.ts +1 -2
- package/dist/tools/postgres.js +8 -164
- package/dist/tools/redis.d.ts +1 -2
- package/dist/tools/redis.js +8 -164
- package/package.json +7 -2
package/dist/tools/redis.js
CHANGED
|
@@ -1,167 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
title: 'Get Redis Details',
|
|
10
|
-
description: 'Retrieve the full configuration and status details of a Redis database managed by Dokploy. Requires the unique Redis database ID. Returns all metadata including name, image, resource limits, environment variables, and current application status.',
|
|
11
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
12
|
-
endpoint: `${DB}.one`,
|
|
13
|
-
});
|
|
14
|
-
const create = postTool({
|
|
15
|
-
name: `dokploy_${DB}_create`,
|
|
16
|
-
title: 'Create Redis Database',
|
|
17
|
-
description: 'Create a new Redis database instance inside a Dokploy project. Requires a display name, app-level identifier, database 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 redisTools = createDatabaseTools({
|
|
4
|
+
type: 'redis',
|
|
5
|
+
idField: 'redisId',
|
|
6
|
+
displayName: 'Redis',
|
|
7
|
+
defaultImage: 'redis:7',
|
|
8
|
+
createFields: z.object({
|
|
22
9
|
databasePassword: z.string().min(1).describe('Database password'),
|
|
23
|
-
|
|
24
|
-
dockerImage: z.string().optional().describe('Docker image (default: redis:7)'),
|
|
25
|
-
description: z.string().nullable().optional().describe('Optional description'),
|
|
26
|
-
serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
|
|
27
|
-
})
|
|
28
|
-
.strict(),
|
|
29
|
-
endpoint: `${DB}.create`,
|
|
30
|
-
});
|
|
31
|
-
const update = postTool({
|
|
32
|
-
name: `dokploy_${DB}_update`,
|
|
33
|
-
title: 'Update Redis Database',
|
|
34
|
-
description: 'Update the configuration of an existing Redis database in Dokploy. Requires the Redis 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.',
|
|
35
|
-
schema: z
|
|
36
|
-
.object({
|
|
37
|
-
redisId: rdId,
|
|
38
|
-
name: z.string().min(1).optional().describe('Display name'),
|
|
39
|
-
appName: z.string().min(1).optional().describe('App-level identifier'),
|
|
40
|
-
description: z.string().nullable().optional().describe('Description'),
|
|
41
|
-
dockerImage: z.string().optional().describe('Docker image'),
|
|
42
|
-
memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
|
|
43
|
-
memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
|
|
44
|
-
cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
|
|
45
|
-
cpuLimit: z.number().nullable().optional().describe('CPU limit'),
|
|
46
|
-
command: z.string().nullable().optional().describe('Custom start command'),
|
|
47
|
-
env: z.string().nullable().optional().describe('Environment variables'),
|
|
48
|
-
externalPort: z.number().nullable().optional().describe('External port'),
|
|
49
|
-
})
|
|
50
|
-
.strict(),
|
|
51
|
-
endpoint: `${DB}.update`,
|
|
52
|
-
});
|
|
53
|
-
const remove = postTool({
|
|
54
|
-
name: `dokploy_${DB}_remove`,
|
|
55
|
-
title: 'Remove Redis Database',
|
|
56
|
-
description: 'Permanently delete a Redis database from Dokploy. Requires the Redis database ID. This is a destructive operation that removes the container, all associated data, and configuration. Returns the operation status confirming deletion.',
|
|
57
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
58
|
-
endpoint: `${DB}.remove`,
|
|
59
|
-
annotations: { destructiveHint: true },
|
|
60
|
-
});
|
|
61
|
-
const move = postTool({
|
|
62
|
-
name: `dokploy_${DB}_move`,
|
|
63
|
-
title: 'Move Redis Database',
|
|
64
|
-
description: 'Move a Redis database from its current project to a different project within Dokploy. Requires the Redis database ID and the destination project ID. The database configuration and data remain intact during the move. Returns the operation status.',
|
|
65
|
-
schema: z
|
|
66
|
-
.object({
|
|
67
|
-
redisId: rdId,
|
|
68
|
-
targetProjectId: z.string().min(1).describe('Destination project ID'),
|
|
69
|
-
})
|
|
70
|
-
.strict(),
|
|
71
|
-
endpoint: `${DB}.move`,
|
|
72
|
-
});
|
|
73
|
-
const deploy = postTool({
|
|
74
|
-
name: `dokploy_${DB}_deploy`,
|
|
75
|
-
title: 'Deploy Redis Database',
|
|
76
|
-
description: 'Deploy a Redis database in Dokploy, pulling the configured Docker image and starting the container. Requires the Redis database ID. This triggers a full deployment lifecycle including image pull, container creation, and startup. Returns the deployment operation status.',
|
|
77
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
78
|
-
endpoint: `${DB}.deploy`,
|
|
79
|
-
});
|
|
80
|
-
const start = postTool({
|
|
81
|
-
name: `dokploy_${DB}_start`,
|
|
82
|
-
title: 'Start Redis Database',
|
|
83
|
-
description: 'Start a previously stopped Redis database container in Dokploy. Requires the Redis database ID. The container will resume with its existing data and configuration. Returns the operation status.',
|
|
84
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
85
|
-
endpoint: `${DB}.start`,
|
|
86
|
-
});
|
|
87
|
-
const stop = postTool({
|
|
88
|
-
name: `dokploy_${DB}_stop`,
|
|
89
|
-
title: 'Stop Redis Database',
|
|
90
|
-
description: 'Stop a currently running Redis database container in Dokploy. Requires the Redis database ID. The container will be gracefully stopped but its data and configuration are preserved for future restarts. Returns the operation status.',
|
|
91
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
92
|
-
endpoint: `${DB}.stop`,
|
|
93
|
-
annotations: { destructiveHint: true },
|
|
94
|
-
});
|
|
95
|
-
const reload = postTool({
|
|
96
|
-
name: `dokploy_${DB}_reload`,
|
|
97
|
-
title: 'Reload Redis Database',
|
|
98
|
-
description: 'Reload the Redis database container in Dokploy without performing a full rebuild. Requires the Redis database ID and the app-level identifier. This restarts the container with its current configuration. Returns the operation status.',
|
|
99
|
-
schema: z
|
|
100
|
-
.object({
|
|
101
|
-
redisId: rdId,
|
|
102
|
-
appName: z.string().min(1).describe('App-level identifier'),
|
|
103
|
-
})
|
|
104
|
-
.strict(),
|
|
105
|
-
endpoint: `${DB}.reload`,
|
|
106
|
-
});
|
|
107
|
-
const rebuild = postTool({
|
|
108
|
-
name: `dokploy_${DB}_rebuild`,
|
|
109
|
-
title: 'Rebuild Redis Database',
|
|
110
|
-
description: 'Rebuild the Redis database container from scratch in Dokploy. Requires the Redis 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.',
|
|
111
|
-
schema: z.object({ redisId: rdId }).strict(),
|
|
112
|
-
endpoint: `${DB}.rebuild`,
|
|
113
|
-
});
|
|
114
|
-
const changeStatus = postTool({
|
|
115
|
-
name: `dokploy_${DB}_change_status`,
|
|
116
|
-
title: 'Change Redis Status',
|
|
117
|
-
description: 'Manually set the application status of a Redis database in Dokploy. Requires the Redis 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.',
|
|
118
|
-
schema: z
|
|
119
|
-
.object({
|
|
120
|
-
redisId: rdId,
|
|
121
|
-
applicationStatus: z
|
|
122
|
-
.enum(['idle', 'running', 'done', 'error'])
|
|
123
|
-
.describe('New application status'),
|
|
124
|
-
})
|
|
125
|
-
.strict(),
|
|
126
|
-
endpoint: `${DB}.changeStatus`,
|
|
127
|
-
});
|
|
128
|
-
const saveExternalPort = postTool({
|
|
129
|
-
name: `dokploy_${DB}_save_external_port`,
|
|
130
|
-
title: 'Save Redis External Port',
|
|
131
|
-
description: 'Set or clear the external port mapping for a Redis database in Dokploy. Requires the Redis 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.',
|
|
132
|
-
schema: z
|
|
133
|
-
.object({
|
|
134
|
-
redisId: rdId,
|
|
135
|
-
externalPort: z.number().nullable().describe('External port number (null to remove)'),
|
|
136
|
-
})
|
|
137
|
-
.strict(),
|
|
138
|
-
endpoint: `${DB}.saveExternalPort`,
|
|
139
|
-
});
|
|
140
|
-
const saveEnvironment = postTool({
|
|
141
|
-
name: `dokploy_${DB}_save_environment`,
|
|
142
|
-
title: 'Save Redis Environment',
|
|
143
|
-
description: 'Overwrite the environment variables for a Redis database in Dokploy. Requires the Redis database ID and the environment variables as a string. This replaces all existing environment variables with the provided values. Returns the operation status.',
|
|
144
|
-
schema: z
|
|
145
|
-
.object({
|
|
146
|
-
redisId: rdId,
|
|
147
|
-
env: z.string().nullable().optional().describe('Environment variables as a string'),
|
|
148
|
-
})
|
|
149
|
-
.strict(),
|
|
150
|
-
endpoint: `${DB}.saveEnvironment`,
|
|
10
|
+
}),
|
|
151
11
|
});
|
|
152
|
-
// ── export ───────────────────────────────────────────────────────────
|
|
153
|
-
export const redisTools = [
|
|
154
|
-
one,
|
|
155
|
-
create,
|
|
156
|
-
update,
|
|
157
|
-
remove,
|
|
158
|
-
move,
|
|
159
|
-
deploy,
|
|
160
|
-
start,
|
|
161
|
-
stop,
|
|
162
|
-
reload,
|
|
163
|
-
rebuild,
|
|
164
|
-
changeStatus,
|
|
165
|
-
saveExternalPort,
|
|
166
|
-
saveEnvironment,
|
|
167
|
-
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibetools/dokploy-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "MCP Server for the Dokploy API - complete coverage of all endpoints",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"dev": "tsc --watch",
|
|
21
21
|
"start": "node dist/index.js",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:coverage": "vitest run --coverage",
|
|
22
25
|
"typecheck": "tsc --noEmit",
|
|
23
26
|
"lint": "biome check .",
|
|
24
27
|
"lint:fix": "biome check --write .",
|
|
@@ -34,7 +37,9 @@
|
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"@biomejs/biome": "^2.4.4",
|
|
36
39
|
"@types/node": "^22.19.11",
|
|
37
|
-
"
|
|
40
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vitest": "^4.0.18"
|
|
38
43
|
},
|
|
39
44
|
"engines": {
|
|
40
45
|
"node": ">=22.0.0"
|