@vibetools/dokploy-mcp 0.4.0 → 0.5.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/LICENSE +21 -0
- package/README.md +78 -558
- package/dist/index.js +0 -0
- package/package.json +1 -1
- package/dist/tools/auth.d.ts +0 -2
- package/dist/tools/auth.js +0 -150
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vibe Code (https://vcode.sh)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,115 +1,60 @@
|
|
|
1
1
|
# @vibetools/dokploy-mcp
|
|
2
2
|
|
|
3
|
-
MCP server for the Dokploy API.
|
|
4
|
-
|
|
5
3
|
[](https://www.npmjs.com/package/@vibetools/dokploy-mcp)
|
|
6
4
|
[](https://opensource.org/licenses/MIT)
|
|
7
5
|
[](https://nodejs.org/)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that provides complete coverage of the Dokploy API. With 224 tools across 24 modules, it enables LLMs to manage Dokploy infrastructure through natural language -- deploying applications, managing databases, configuring domains, handling backups, and more.
|
|
12
|
-
|
|
13
|
-
## Features
|
|
14
|
-
|
|
15
|
-
- **Complete API coverage** across all 24 Dokploy modules (224 tools)
|
|
16
|
-
- **Interactive setup wizard** -- run `npx @vibetools/dokploy-mcp setup` and start using it in seconds
|
|
17
|
-
- **Auto-config detection** -- picks up credentials from env vars, config file, or Dokploy CLI
|
|
18
|
-
- **Type-safe schemas** with Zod v4 validation on every parameter
|
|
19
|
-
- **Tool annotations** (`readOnlyHint`, `destructiveHint`, `idempotentHint`) so clients can warn before destructive operations
|
|
20
|
-
- **Lazy configuration loading** -- environment variables are validated on first API call, not at startup
|
|
21
|
-
- **Comprehensive error handling** with actionable messages mapped from HTTP status codes
|
|
22
|
-
- **Minimal dependencies** -- only `@modelcontextprotocol/sdk`, `zod`, and `@clack/prompts`
|
|
23
|
-
|
|
24
|
-
## Installation
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install @vibetools/dokploy-mcp
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Or run directly:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npx @vibetools/dokploy-mcp
|
|
34
|
-
```
|
|
7
|
+
MCP server for the Dokploy API. 196 tools across 23 modules. Your AI agent can now deploy apps, manage databases, configure domains, and handle backups -- without you touching a dashboard.
|
|
35
8
|
|
|
36
9
|
## Quick Start
|
|
37
10
|
|
|
38
|
-
|
|
39
|
-
npx @vibetools/dokploy-mcp setup
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The setup wizard will:
|
|
43
|
-
1. Prompt for your Dokploy server URL and API key
|
|
44
|
-
2. Validate the credentials
|
|
45
|
-
3. Save configuration to `~/.config/dokploy-mcp/config.json`
|
|
46
|
-
4. Show the MCP client config to add
|
|
47
|
-
|
|
48
|
-
After setup, add this minimal config to your MCP client:
|
|
11
|
+
Grab your API key from **Dokploy Settings > Profile > API/CLI** and add this to your MCP client config:
|
|
49
12
|
|
|
50
13
|
```json
|
|
51
14
|
{
|
|
52
15
|
"mcpServers": {
|
|
53
16
|
"dokploy": {
|
|
54
17
|
"command": "npx",
|
|
55
|
-
"args": ["@vibetools/dokploy-mcp"]
|
|
18
|
+
"args": ["@vibetools/dokploy-mcp"],
|
|
19
|
+
"env": {
|
|
20
|
+
"DOKPLOY_URL": "https://panel.example.com",
|
|
21
|
+
"DOKPLOY_API_KEY": "your-api-key"
|
|
22
|
+
}
|
|
56
23
|
}
|
|
57
24
|
}
|
|
58
25
|
}
|
|
59
26
|
```
|
|
60
27
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
## Configuration Resolution
|
|
64
|
-
|
|
65
|
-
Credentials are resolved in this order (first match wins):
|
|
28
|
+
That's it. No setup wizard, no config files, no PhD.
|
|
66
29
|
|
|
67
|
-
|
|
68
|
-
2. **Config file** -- `~/.config/dokploy-mcp/config.json` (created by `setup`)
|
|
69
|
-
3. **Dokploy CLI** -- Auto-detected from globally installed `@dokploy/cli`
|
|
30
|
+
### Alternative: setup wizard
|
|
70
31
|
|
|
71
|
-
If you
|
|
32
|
+
If you prefer saving credentials to disk instead of env vars:
|
|
72
33
|
|
|
73
|
-
|
|
34
|
+
```bash
|
|
35
|
+
npx @vibetools/dokploy-mcp setup
|
|
36
|
+
```
|
|
74
37
|
|
|
75
|
-
|
|
38
|
+
Validates credentials, saves to `~/.config/dokploy-mcp/config.json`, and shows you the minimal MCP config to copy. After that, the `env` block is optional.
|
|
76
39
|
|
|
77
|
-
|
|
78
|
-
|---|---|---|---|
|
|
79
|
-
| `DOKPLOY_URL` | Yes | Dokploy panel URL (e.g., `https://panel.example.com`) — automatically normalized | -- |
|
|
80
|
-
| `DOKPLOY_API_KEY` | Yes | API key from Dokploy Settings > API | -- |
|
|
81
|
-
| `DOKPLOY_TIMEOUT` | No | Request timeout in milliseconds | `30000` |
|
|
40
|
+
### Alternative: Dokploy CLI auto-detection
|
|
82
41
|
|
|
83
|
-
|
|
42
|
+
If you already have the [Dokploy CLI](https://github.com/Dokploy/cli) installed and authenticated -- zero config needed. It just works.
|
|
84
43
|
|
|
85
|
-
|
|
86
|
-
|---|---|
|
|
87
|
-
| `npx @vibetools/dokploy-mcp` | Start MCP server (stdio transport) |
|
|
88
|
-
| `npx @vibetools/dokploy-mcp setup` | Interactive setup wizard |
|
|
89
|
-
| `npx @vibetools/dokploy-mcp version` | Show version |
|
|
44
|
+
## Features
|
|
90
45
|
|
|
91
|
-
|
|
46
|
+
- **196 tools, 23 modules** -- applications, compose, databases (Postgres/MySQL/MariaDB/MongoDB/Redis), domains, backups, Docker, settings, and more
|
|
47
|
+
- **Tool annotations** -- `readOnlyHint`, `destructiveHint`, `idempotentHint` so clients can warn before you nuke something
|
|
48
|
+
- **Type-safe schemas** -- Zod v4 validation on every parameter
|
|
49
|
+
- **Lazy config loading** -- validates credentials on first API call, not at startup
|
|
50
|
+
- **Three config sources** -- env vars > config file > Dokploy CLI (first match wins)
|
|
51
|
+
- **Minimal dependencies** -- just `@modelcontextprotocol/sdk`, `zod`, and `@clack/prompts`
|
|
92
52
|
|
|
93
|
-
##
|
|
53
|
+
## MCP Client Config
|
|
94
54
|
|
|
95
55
|
### Claude Desktop
|
|
96
56
|
|
|
97
|
-
Add
|
|
98
|
-
|
|
99
|
-
**With setup (recommended):**
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"mcpServers": {
|
|
104
|
-
"dokploy": {
|
|
105
|
-
"command": "npx",
|
|
106
|
-
"args": ["@vibetools/dokploy-mcp"]
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**With environment variables:**
|
|
57
|
+
Add to `claude_desktop_config.json`:
|
|
113
58
|
|
|
114
59
|
```json
|
|
115
60
|
{
|
|
@@ -128,22 +73,7 @@ Add the following to your Claude Desktop configuration file (`claude_desktop_con
|
|
|
128
73
|
|
|
129
74
|
### Claude Code
|
|
130
75
|
|
|
131
|
-
Add
|
|
132
|
-
|
|
133
|
-
**With setup (recommended):**
|
|
134
|
-
|
|
135
|
-
```json
|
|
136
|
-
{
|
|
137
|
-
"mcpServers": {
|
|
138
|
-
"dokploy": {
|
|
139
|
-
"command": "npx",
|
|
140
|
-
"args": ["@vibetools/dokploy-mcp"]
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**With environment variables:**
|
|
76
|
+
Add to `.mcp.json`:
|
|
147
77
|
|
|
148
78
|
```json
|
|
149
79
|
{
|
|
@@ -162,22 +92,7 @@ Add the following to your `.mcp.json` configuration file:
|
|
|
162
92
|
|
|
163
93
|
### Cursor
|
|
164
94
|
|
|
165
|
-
Add to `~/.cursor/mcp.json` or `.cursor/mcp.json
|
|
166
|
-
|
|
167
|
-
**With setup (recommended):**
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"mcpServers": {
|
|
172
|
-
"dokploy": {
|
|
173
|
-
"command": "npx",
|
|
174
|
-
"args": ["@vibetools/dokploy-mcp"]
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
**With environment variables:**
|
|
95
|
+
Add to `~/.cursor/mcp.json` or `.cursor/mcp.json`:
|
|
181
96
|
|
|
182
97
|
```json
|
|
183
98
|
{
|
|
@@ -198,21 +113,6 @@ Add to `~/.cursor/mcp.json` or `.cursor/mcp.json` in your project:
|
|
|
198
113
|
|
|
199
114
|
Add to `.vscode/mcp.json`:
|
|
200
115
|
|
|
201
|
-
**With setup (recommended):**
|
|
202
|
-
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"servers": {
|
|
206
|
-
"dokploy": {
|
|
207
|
-
"command": "npx",
|
|
208
|
-
"args": ["@vibetools/dokploy-mcp"]
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**With environment variables:**
|
|
215
|
-
|
|
216
116
|
```json
|
|
217
117
|
{
|
|
218
118
|
"servers": {
|
|
@@ -228,15 +128,56 @@ Add to `.vscode/mcp.json`:
|
|
|
228
128
|
}
|
|
229
129
|
```
|
|
230
130
|
|
|
231
|
-
|
|
131
|
+
Already ran `setup` or have Dokploy CLI authenticated? Drop the `env` block entirely.
|
|
132
|
+
|
|
133
|
+
## Tools
|
|
134
|
+
|
|
135
|
+
| Module | Tools | Module | Tools |
|
|
136
|
+
|--------|-------|--------|-------|
|
|
137
|
+
| Project | 6 | Deployment | 2 |
|
|
138
|
+
| Application | 26 | Docker | 4 |
|
|
139
|
+
| Compose | 14 | Certificates | 4 |
|
|
140
|
+
| Domain | 8 | Registry | 6 |
|
|
141
|
+
| PostgreSQL | 13 | Destination | 6 |
|
|
142
|
+
| MySQL | 13 | Backup | 8 |
|
|
143
|
+
| MariaDB | 13 | Mounts | 4 |
|
|
144
|
+
| MongoDB | 13 | Port | 4 |
|
|
145
|
+
| Redis | 13 | Redirects | 4 |
|
|
146
|
+
| Security | 4 | Cluster | 4 |
|
|
147
|
+
| Settings | 25 | Admin | 1 |
|
|
148
|
+
| User | 1 | | |
|
|
149
|
+
|
|
150
|
+
Full reference with parameters and descriptions: **[docs/tools.md](docs/tools.md)**
|
|
151
|
+
|
|
152
|
+
API coverage report: **[docs/coverage.md](docs/coverage.md)**
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
| Variable | Required | Description |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| `DOKPLOY_URL` | Yes | Dokploy panel URL -- automatically normalized to `/api/trpc` |
|
|
159
|
+
| `DOKPLOY_API_KEY` | Yes | API key from Dokploy Settings > API |
|
|
160
|
+
| `DOKPLOY_TIMEOUT` | No | Request timeout in ms (default: `30000`) |
|
|
161
|
+
|
|
162
|
+
Resolution order: env vars > `~/.config/dokploy-mcp/config.json` > Dokploy CLI config.
|
|
163
|
+
|
|
164
|
+
## CLI
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npx @vibetools/dokploy-mcp # Start MCP server (stdio)
|
|
168
|
+
npx @vibetools/dokploy-mcp setup # Interactive setup wizard (aliases: init, auth)
|
|
169
|
+
npx @vibetools/dokploy-mcp version # Show version
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Development
|
|
232
173
|
|
|
233
174
|
```bash
|
|
234
|
-
git clone
|
|
235
|
-
|
|
236
|
-
npm run build
|
|
175
|
+
git clone https://github.com/vcode-sh/dokploy-mcp.git
|
|
176
|
+
cd dokploy-mcp
|
|
177
|
+
npm install && npm run build
|
|
237
178
|
```
|
|
238
179
|
|
|
239
|
-
|
|
180
|
+
Point your MCP client at the local build:
|
|
240
181
|
|
|
241
182
|
```json
|
|
242
183
|
{
|
|
@@ -253,440 +194,19 @@ Then point your MCP client at the local build:
|
|
|
253
194
|
}
|
|
254
195
|
```
|
|
255
196
|
|
|
256
|
-
## Getting Your API Key
|
|
257
|
-
|
|
258
|
-
1. Open your Dokploy dashboard
|
|
259
|
-
2. Go to Settings > Profile > API/CLI section
|
|
260
|
-
3. Generate a token
|
|
261
|
-
4. Use it as the `DOKPLOY_API_KEY` environment variable
|
|
262
|
-
|
|
263
|
-
## Tool Reference
|
|
264
|
-
|
|
265
|
-
All 224 tools are organized into 24 modules. Each table below shows the tool name, a brief description, and whether the tool is read-only or mutating/destructive.
|
|
266
|
-
|
|
267
|
-
For the complete reference with full descriptions and parameter details, see [docs/TOOLS.md](docs/TOOLS.md).
|
|
268
|
-
|
|
269
|
-
### Project (6 tools)
|
|
270
|
-
|
|
271
|
-
| Tool | Description | Type |
|
|
272
|
-
|---|---|---|
|
|
273
|
-
| `dokploy_project_all` | List all projects | Read-only |
|
|
274
|
-
| `dokploy_project_one` | Get project details by ID | Read-only |
|
|
275
|
-
| `dokploy_project_create` | Create a new project | Mutating |
|
|
276
|
-
| `dokploy_project_update` | Update an existing project | Mutating |
|
|
277
|
-
| `dokploy_project_duplicate` | Duplicate a project with its services | Mutating |
|
|
278
|
-
| `dokploy_project_remove` | Remove a project and all its resources | Destructive |
|
|
279
|
-
|
|
280
|
-
### Application (25 tools)
|
|
281
|
-
|
|
282
|
-
| Tool | Description | Type |
|
|
283
|
-
|---|---|---|
|
|
284
|
-
| `dokploy_application_create` | Create a new application in a project | Mutating |
|
|
285
|
-
| `dokploy_application_one` | Get application details by ID | Read-only |
|
|
286
|
-
| `dokploy_application_update` | Update application configuration | Mutating |
|
|
287
|
-
| `dokploy_application_delete` | Delete an application permanently | Destructive |
|
|
288
|
-
| `dokploy_application_move` | Move application to another project | Mutating |
|
|
289
|
-
| `dokploy_application_deploy` | Trigger a new deployment | Mutating |
|
|
290
|
-
| `dokploy_application_redeploy` | Force a full redeploy from source | Mutating |
|
|
291
|
-
| `dokploy_application_start` | Start a stopped application | Mutating |
|
|
292
|
-
| `dokploy_application_stop` | Stop a running application | Destructive |
|
|
293
|
-
| `dokploy_application_cancel_deployment` | Cancel an in-progress deployment | Mutating |
|
|
294
|
-
| `dokploy_application_reload` | Reload application containers | Mutating |
|
|
295
|
-
| `dokploy_application_mark_running` | Manually mark application as running | Mutating |
|
|
296
|
-
| `dokploy_application_clean_queues` | Clean pending deployment queues | Mutating |
|
|
297
|
-
| `dokploy_application_refresh_token` | Refresh the webhook token | Mutating |
|
|
298
|
-
| `dokploy_application_save_build_type` | Set build type and settings | Mutating |
|
|
299
|
-
| `dokploy_application_save_environment` | Save environment variables and build args | Mutating |
|
|
300
|
-
| `dokploy_application_save_github_provider` | Configure GitHub as source | Mutating |
|
|
301
|
-
| `dokploy_application_save_gitlab_provider` | Configure GitLab as source | Mutating |
|
|
302
|
-
| `dokploy_application_save_bitbucket_provider` | Configure Bitbucket as source | Mutating |
|
|
303
|
-
| `dokploy_application_save_gitea_provider` | Configure Gitea as source | Mutating |
|
|
304
|
-
| `dokploy_application_save_git_provider` | Configure custom Git repo as source | Mutating |
|
|
305
|
-
| `dokploy_application_save_docker_provider` | Configure Docker image as source | Mutating |
|
|
306
|
-
| `dokploy_application_disconnect_git_provider` | Disconnect the current Git provider | Mutating |
|
|
307
|
-
| `dokploy_application_read_app_monitoring` | Read application monitoring metrics | Read-only |
|
|
308
|
-
| `dokploy_application_read_traefik_config` | Read Traefik config for an application | Read-only |
|
|
309
|
-
| `dokploy_application_update_traefik_config` | Update Traefik config for an application | Mutating |
|
|
310
|
-
|
|
311
|
-
### Compose (17 tools)
|
|
312
|
-
|
|
313
|
-
| Tool | Description | Type |
|
|
314
|
-
|---|---|---|
|
|
315
|
-
| `dokploy_compose_create` | Create a new Docker Compose service | Mutating |
|
|
316
|
-
| `dokploy_compose_one` | Get compose service details by ID | Read-only |
|
|
317
|
-
| `dokploy_compose_update` | Update compose service configuration | Mutating |
|
|
318
|
-
| `dokploy_compose_delete` | Delete a compose service permanently | Destructive |
|
|
319
|
-
| `dokploy_compose_deploy` | Deploy a compose service | Mutating |
|
|
320
|
-
| `dokploy_compose_redeploy` | Redeploy a compose service | Mutating |
|
|
321
|
-
| `dokploy_compose_stop` | Stop all containers in a compose service | Destructive |
|
|
322
|
-
| `dokploy_compose_clean_queues` | Clean pending deployment queues | Mutating |
|
|
323
|
-
| `dokploy_compose_all_services` | List individual services in a compose stack | Read-only |
|
|
324
|
-
| `dokploy_compose_randomize` | Randomize service names to avoid conflicts | Mutating |
|
|
325
|
-
| `dokploy_compose_get_default_command` | Get the default deployment command | Read-only |
|
|
326
|
-
| `dokploy_compose_generate_ssh_key` | Generate SSH key pair for Git access | Mutating |
|
|
327
|
-
| `dokploy_compose_refresh_token` | Refresh the webhook token | Mutating |
|
|
328
|
-
| `dokploy_compose_remove_ssh_key` | Remove the SSH key | Mutating |
|
|
329
|
-
| `dokploy_compose_deploy_template` | Deploy from a predefined template | Mutating |
|
|
330
|
-
| `dokploy_compose_templates` | List available compose templates | Read-only |
|
|
331
|
-
| `dokploy_compose_save_environment` | Save environment variables and build args | Mutating |
|
|
332
|
-
|
|
333
|
-
### Domain (9 tools)
|
|
334
|
-
|
|
335
|
-
| Tool | Description | Type |
|
|
336
|
-
|---|---|---|
|
|
337
|
-
| `dokploy_domain_create` | Create a new domain configuration | Mutating |
|
|
338
|
-
| `dokploy_domain_one` | Get domain details by ID | Read-only |
|
|
339
|
-
| `dokploy_domain_by_application_id` | List domains for an application | Read-only |
|
|
340
|
-
| `dokploy_domain_by_compose_id` | List domains for a compose service | Read-only |
|
|
341
|
-
| `dokploy_domain_update` | Update a domain configuration | Mutating |
|
|
342
|
-
| `dokploy_domain_delete` | Delete a domain permanently | Destructive |
|
|
343
|
-
| `dokploy_domain_validate` | Validate domain DNS records | Mutating |
|
|
344
|
-
| `dokploy_domain_generate` | Generate a default domain for an app | Mutating |
|
|
345
|
-
| `dokploy_domain_generate_wildcard` | Generate a wildcard domain for an app | Mutating |
|
|
346
|
-
|
|
347
|
-
### PostgreSQL (13 tools)
|
|
348
|
-
|
|
349
|
-
| Tool | Description | Type |
|
|
350
|
-
|---|---|---|
|
|
351
|
-
| `dokploy_postgres_one` | Get Postgres database details | Read-only |
|
|
352
|
-
| `dokploy_postgres_create` | Create a new Postgres database | Mutating |
|
|
353
|
-
| `dokploy_postgres_update` | Update Postgres configuration | Mutating |
|
|
354
|
-
| `dokploy_postgres_remove` | Remove a Postgres database | Destructive |
|
|
355
|
-
| `dokploy_postgres_move` | Move database to another project | Mutating |
|
|
356
|
-
| `dokploy_postgres_deploy` | Deploy the database container | Mutating |
|
|
357
|
-
| `dokploy_postgres_start` | Start a stopped database | Mutating |
|
|
358
|
-
| `dokploy_postgres_stop` | Stop a running database | Destructive |
|
|
359
|
-
| `dokploy_postgres_reload` | Reload the database container | Mutating |
|
|
360
|
-
| `dokploy_postgres_rebuild` | Rebuild the database from scratch | Mutating |
|
|
361
|
-
| `dokploy_postgres_change_status` | Manually set application status | Mutating |
|
|
362
|
-
| `dokploy_postgres_save_external_port` | Set or clear the external port | Mutating |
|
|
363
|
-
| `dokploy_postgres_save_environment` | Save environment variables | Mutating |
|
|
364
|
-
|
|
365
|
-
### MySQL (13 tools)
|
|
366
|
-
|
|
367
|
-
| Tool | Description | Type |
|
|
368
|
-
|---|---|---|
|
|
369
|
-
| `dokploy_mysql_one` | Get MySQL database details | Read-only |
|
|
370
|
-
| `dokploy_mysql_create` | Create a new MySQL database | Mutating |
|
|
371
|
-
| `dokploy_mysql_update` | Update MySQL configuration | Mutating |
|
|
372
|
-
| `dokploy_mysql_remove` | Remove a MySQL database | Destructive |
|
|
373
|
-
| `dokploy_mysql_move` | Move database to another project | Mutating |
|
|
374
|
-
| `dokploy_mysql_deploy` | Deploy the database container | Mutating |
|
|
375
|
-
| `dokploy_mysql_start` | Start a stopped database | Mutating |
|
|
376
|
-
| `dokploy_mysql_stop` | Stop a running database | Destructive |
|
|
377
|
-
| `dokploy_mysql_reload` | Reload the database container | Mutating |
|
|
378
|
-
| `dokploy_mysql_rebuild` | Rebuild the database from scratch | Mutating |
|
|
379
|
-
| `dokploy_mysql_change_status` | Manually set application status | Mutating |
|
|
380
|
-
| `dokploy_mysql_save_external_port` | Set or clear the external port | Mutating |
|
|
381
|
-
| `dokploy_mysql_save_environment` | Save environment variables | Mutating |
|
|
382
|
-
|
|
383
|
-
### MariaDB (13 tools)
|
|
384
|
-
|
|
385
|
-
| Tool | Description | Type |
|
|
386
|
-
|---|---|---|
|
|
387
|
-
| `dokploy_mariadb_one` | Get MariaDB database details | Read-only |
|
|
388
|
-
| `dokploy_mariadb_create` | Create a new MariaDB database | Mutating |
|
|
389
|
-
| `dokploy_mariadb_update` | Update MariaDB configuration | Mutating |
|
|
390
|
-
| `dokploy_mariadb_remove` | Remove a MariaDB database | Destructive |
|
|
391
|
-
| `dokploy_mariadb_move` | Move database to another project | Mutating |
|
|
392
|
-
| `dokploy_mariadb_deploy` | Deploy the database container | Mutating |
|
|
393
|
-
| `dokploy_mariadb_start` | Start a stopped database | Mutating |
|
|
394
|
-
| `dokploy_mariadb_stop` | Stop a running database | Destructive |
|
|
395
|
-
| `dokploy_mariadb_reload` | Reload the database container | Mutating |
|
|
396
|
-
| `dokploy_mariadb_rebuild` | Rebuild the database from scratch | Mutating |
|
|
397
|
-
| `dokploy_mariadb_change_status` | Manually set application status | Mutating |
|
|
398
|
-
| `dokploy_mariadb_save_external_port` | Set or clear the external port | Mutating |
|
|
399
|
-
| `dokploy_mariadb_save_environment` | Save environment variables | Mutating |
|
|
400
|
-
|
|
401
|
-
### MongoDB (13 tools)
|
|
402
|
-
|
|
403
|
-
| Tool | Description | Type |
|
|
404
|
-
|---|---|---|
|
|
405
|
-
| `dokploy_mongo_one` | Get MongoDB database details | Read-only |
|
|
406
|
-
| `dokploy_mongo_create` | Create a new MongoDB database | Mutating |
|
|
407
|
-
| `dokploy_mongo_update` | Update MongoDB configuration | Mutating |
|
|
408
|
-
| `dokploy_mongo_remove` | Remove a MongoDB database | Destructive |
|
|
409
|
-
| `dokploy_mongo_move` | Move database to another project | Mutating |
|
|
410
|
-
| `dokploy_mongo_deploy` | Deploy the database container | Mutating |
|
|
411
|
-
| `dokploy_mongo_start` | Start a stopped database | Mutating |
|
|
412
|
-
| `dokploy_mongo_stop` | Stop a running database | Destructive |
|
|
413
|
-
| `dokploy_mongo_reload` | Reload the database container | Mutating |
|
|
414
|
-
| `dokploy_mongo_rebuild` | Rebuild the database from scratch | Mutating |
|
|
415
|
-
| `dokploy_mongo_change_status` | Manually set application status | Mutating |
|
|
416
|
-
| `dokploy_mongo_save_external_port` | Set or clear the external port | Mutating |
|
|
417
|
-
| `dokploy_mongo_save_environment` | Save environment variables | Mutating |
|
|
418
|
-
|
|
419
|
-
### Redis (13 tools)
|
|
420
|
-
|
|
421
|
-
| Tool | Description | Type |
|
|
422
|
-
|---|---|---|
|
|
423
|
-
| `dokploy_redis_one` | Get Redis database details | Read-only |
|
|
424
|
-
| `dokploy_redis_create` | Create a new Redis database | Mutating |
|
|
425
|
-
| `dokploy_redis_update` | Update Redis configuration | Mutating |
|
|
426
|
-
| `dokploy_redis_remove` | Remove a Redis database | Destructive |
|
|
427
|
-
| `dokploy_redis_move` | Move database to another project | Mutating |
|
|
428
|
-
| `dokploy_redis_deploy` | Deploy the database container | Mutating |
|
|
429
|
-
| `dokploy_redis_start` | Start a stopped database | Mutating |
|
|
430
|
-
| `dokploy_redis_stop` | Stop a running database | Destructive |
|
|
431
|
-
| `dokploy_redis_reload` | Reload the database container | Mutating |
|
|
432
|
-
| `dokploy_redis_rebuild` | Rebuild the database from scratch | Mutating |
|
|
433
|
-
| `dokploy_redis_change_status` | Manually set application status | Mutating |
|
|
434
|
-
| `dokploy_redis_save_external_port` | Set or clear the external port | Mutating |
|
|
435
|
-
| `dokploy_redis_save_environment` | Save environment variables | Mutating |
|
|
436
|
-
|
|
437
|
-
### Deployment (2 tools)
|
|
438
|
-
|
|
439
|
-
| Tool | Description | Type |
|
|
440
|
-
|---|---|---|
|
|
441
|
-
| `dokploy_deployment_all` | List all deployments for an application | Read-only |
|
|
442
|
-
| `dokploy_deployment_all_by_compose` | List all deployments for a compose service | Read-only |
|
|
443
|
-
|
|
444
|
-
### Docker (4 tools)
|
|
445
|
-
|
|
446
|
-
| Tool | Description | Type |
|
|
447
|
-
|---|---|---|
|
|
448
|
-
| `dokploy_docker_get_containers` | List all Docker containers on the server | Read-only |
|
|
449
|
-
| `dokploy_docker_get_config` | Get full config of a container by ID | Read-only |
|
|
450
|
-
| `dokploy_docker_get_containers_by_app_name_match` | Find containers by app name substring | Read-only |
|
|
451
|
-
| `dokploy_docker_get_containers_by_app_label` | Find containers by app label | Read-only |
|
|
452
|
-
|
|
453
|
-
### Certificates (4 tools)
|
|
454
|
-
|
|
455
|
-
| Tool | Description | Type |
|
|
456
|
-
|---|---|---|
|
|
457
|
-
| `dokploy_certificate_all` | List all SSL/TLS certificates | Read-only |
|
|
458
|
-
| `dokploy_certificate_one` | Get certificate details by ID | Read-only |
|
|
459
|
-
| `dokploy_certificate_create` | Create a new certificate | Mutating |
|
|
460
|
-
| `dokploy_certificate_remove` | Remove a certificate | Destructive |
|
|
461
|
-
|
|
462
|
-
### Registry (7 tools)
|
|
463
|
-
|
|
464
|
-
| Tool | Description | Type |
|
|
465
|
-
|---|---|---|
|
|
466
|
-
| `dokploy_registry_all` | List all container registries | Read-only |
|
|
467
|
-
| `dokploy_registry_one` | Get registry details by ID | Read-only |
|
|
468
|
-
| `dokploy_registry_create` | Create a new registry configuration | Mutating |
|
|
469
|
-
| `dokploy_registry_update` | Update a registry configuration | Mutating |
|
|
470
|
-
| `dokploy_registry_remove` | Remove a registry configuration | Destructive |
|
|
471
|
-
| `dokploy_registry_test` | Test registry connection | Mutating |
|
|
472
|
-
| `dokploy_registry_enable_self_hosted` | Enable the built-in self-hosted registry | Mutating |
|
|
473
|
-
|
|
474
|
-
### Destination (6 tools)
|
|
475
|
-
|
|
476
|
-
| Tool | Description | Type |
|
|
477
|
-
|---|---|---|
|
|
478
|
-
| `dokploy_destination_all` | List all S3 backup destinations | Read-only |
|
|
479
|
-
| `dokploy_destination_one` | Get destination details by ID | Read-only |
|
|
480
|
-
| `dokploy_destination_create` | Create a new S3 backup destination | Mutating |
|
|
481
|
-
| `dokploy_destination_update` | Update a backup destination | Mutating |
|
|
482
|
-
| `dokploy_destination_remove` | Remove a backup destination | Destructive |
|
|
483
|
-
| `dokploy_destination_test_connection` | Test S3 destination connection | Mutating |
|
|
484
|
-
|
|
485
|
-
### Backup (8 tools)
|
|
486
|
-
|
|
487
|
-
| Tool | Description | Type |
|
|
488
|
-
|---|---|---|
|
|
489
|
-
| `dokploy_backup_one` | Get backup configuration details | Read-only |
|
|
490
|
-
| `dokploy_backup_create` | Create a scheduled backup | Mutating |
|
|
491
|
-
| `dokploy_backup_update` | Update a backup schedule | Mutating |
|
|
492
|
-
| `dokploy_backup_remove` | Remove a backup schedule | Destructive |
|
|
493
|
-
| `dokploy_backup_manual_postgres` | Trigger manual Postgres backup | Mutating |
|
|
494
|
-
| `dokploy_backup_manual_mysql` | Trigger manual MySQL backup | Mutating |
|
|
495
|
-
| `dokploy_backup_manual_mariadb` | Trigger manual MariaDB backup | Mutating |
|
|
496
|
-
| `dokploy_backup_manual_mongo` | Trigger manual MongoDB backup | Mutating |
|
|
497
|
-
|
|
498
|
-
### Mounts (4 tools)
|
|
499
|
-
|
|
500
|
-
| Tool | Description | Type |
|
|
501
|
-
|---|---|---|
|
|
502
|
-
| `dokploy_mount_one` | Get mount configuration details | Read-only |
|
|
503
|
-
| `dokploy_mount_create` | Create a new mount (bind, volume, or file) | Mutating |
|
|
504
|
-
| `dokploy_mount_update` | Update a mount configuration | Mutating |
|
|
505
|
-
| `dokploy_mount_remove` | Remove a mount | Destructive |
|
|
506
|
-
|
|
507
|
-
### Port (4 tools)
|
|
508
|
-
|
|
509
|
-
| Tool | Description | Type |
|
|
510
|
-
|---|---|---|
|
|
511
|
-
| `dokploy_port_one` | Get port mapping details | Read-only |
|
|
512
|
-
| `dokploy_port_create` | Create a new port mapping | Mutating |
|
|
513
|
-
| `dokploy_port_update` | Update a port mapping | Mutating |
|
|
514
|
-
| `dokploy_port_delete` | Delete a port mapping | Destructive |
|
|
515
|
-
|
|
516
|
-
### Redirects (4 tools)
|
|
517
|
-
|
|
518
|
-
| Tool | Description | Type |
|
|
519
|
-
|---|---|---|
|
|
520
|
-
| `dokploy_redirect_one` | Get redirect rule details | Read-only |
|
|
521
|
-
| `dokploy_redirect_create` | Create a new redirect rule | Mutating |
|
|
522
|
-
| `dokploy_redirect_update` | Update a redirect rule | Mutating |
|
|
523
|
-
| `dokploy_redirect_delete` | Delete a redirect rule | Destructive |
|
|
524
|
-
|
|
525
|
-
### Security (4 tools)
|
|
526
|
-
|
|
527
|
-
| Tool | Description | Type |
|
|
528
|
-
|---|---|---|
|
|
529
|
-
| `dokploy_security_one` | Get HTTP basic-auth entry details | Read-only |
|
|
530
|
-
| `dokploy_security_create` | Create HTTP basic-auth protection | Mutating |
|
|
531
|
-
| `dokploy_security_update` | Update basic-auth credentials | Mutating |
|
|
532
|
-
| `dokploy_security_delete` | Delete basic-auth protection | Destructive |
|
|
533
|
-
|
|
534
|
-
### Cluster (4 tools)
|
|
535
|
-
|
|
536
|
-
| Tool | Description | Type |
|
|
537
|
-
|---|---|---|
|
|
538
|
-
| `dokploy_cluster_get_nodes` | List all Docker Swarm cluster nodes | Read-only |
|
|
539
|
-
| `dokploy_cluster_add_worker` | Get the command to add a worker node | Read-only |
|
|
540
|
-
| `dokploy_cluster_add_manager` | Get the command to add a manager node | Read-only |
|
|
541
|
-
| `dokploy_cluster_remove_worker` | Remove a worker node from the cluster | Destructive |
|
|
542
|
-
|
|
543
|
-
### Settings (23 tools)
|
|
544
|
-
|
|
545
|
-
| Tool | Description | Type |
|
|
546
|
-
|---|---|---|
|
|
547
|
-
| `dokploy_settings_reload_server` | Reload the Dokploy server process | Mutating |
|
|
548
|
-
| `dokploy_settings_reload_traefik` | Reload the Traefik reverse proxy | Mutating |
|
|
549
|
-
| `dokploy_settings_clean_unused_images` | Remove unused Docker images | Mutating |
|
|
550
|
-
| `dokploy_settings_clean_unused_volumes` | Remove unused Docker volumes | Destructive |
|
|
551
|
-
| `dokploy_settings_clean_stopped_containers` | Remove all stopped containers | Destructive |
|
|
552
|
-
| `dokploy_settings_clean_docker_builder` | Clean Docker builder cache | Mutating |
|
|
553
|
-
| `dokploy_settings_clean_docker_prune` | Full Docker system prune | Destructive |
|
|
554
|
-
| `dokploy_settings_clean_all` | Clean all unused Docker resources | Destructive |
|
|
555
|
-
| `dokploy_settings_clean_monitoring` | Clear all monitoring data | Destructive |
|
|
556
|
-
| `dokploy_settings_save_ssh_private_key` | Save SSH private key for remote access | Mutating |
|
|
557
|
-
| `dokploy_settings_clean_ssh_private_key` | Remove stored SSH private key | Destructive |
|
|
558
|
-
| `dokploy_settings_assign_domain_server` | Assign domain to the server with SSL | Mutating |
|
|
559
|
-
| `dokploy_settings_update_docker_cleanup` | Configure automatic Docker cleanup | Mutating |
|
|
560
|
-
| `dokploy_settings_read_traefik_config` | Read the main Traefik config | Read-only |
|
|
561
|
-
| `dokploy_settings_update_traefik_config` | Update the main Traefik config | Mutating |
|
|
562
|
-
| `dokploy_settings_read_web_server_traefik_config` | Read web server Traefik config | Read-only |
|
|
563
|
-
| `dokploy_settings_update_web_server_traefik_config` | Update web server Traefik config | Mutating |
|
|
564
|
-
| `dokploy_settings_read_middleware_traefik_config` | Read Traefik middleware config | Read-only |
|
|
565
|
-
| `dokploy_settings_update_middleware_traefik_config` | Update Traefik middleware config | Mutating |
|
|
566
|
-
| `dokploy_settings_check_and_update_image` | Check for and apply image updates | Mutating |
|
|
567
|
-
| `dokploy_settings_update_server` | Update Dokploy to latest version | Mutating |
|
|
568
|
-
| `dokploy_settings_get_version` | Get current Dokploy version | Read-only |
|
|
569
|
-
| `dokploy_settings_read_directories` | Read server directory listing | Read-only |
|
|
570
|
-
| `dokploy_settings_get_openapi_document` | Get the OpenAPI specification | Read-only |
|
|
571
|
-
|
|
572
|
-
### Auth (14 tools)
|
|
573
|
-
|
|
574
|
-
| Tool | Description | Type |
|
|
575
|
-
|---|---|---|
|
|
576
|
-
| `dokploy_auth_create_admin` | Create the initial admin account | Mutating |
|
|
577
|
-
| `dokploy_auth_create_user` | Create a user from invitation token | Mutating |
|
|
578
|
-
| `dokploy_auth_login` | Log in with email and password | Mutating |
|
|
579
|
-
| `dokploy_auth_get` | Get current authenticated user profile | Read-only |
|
|
580
|
-
| `dokploy_auth_logout` | Log out and invalidate session | Mutating |
|
|
581
|
-
| `dokploy_auth_update` | Update current user profile | Mutating |
|
|
582
|
-
| `dokploy_auth_generate_token` | Generate a new API token | Mutating |
|
|
583
|
-
| `dokploy_auth_one` | Get user auth info by ID | Read-only |
|
|
584
|
-
| `dokploy_auth_update_by_admin` | Update any user with admin privileges | Mutating |
|
|
585
|
-
| `dokploy_auth_generate_2fa_secret` | Generate 2FA secret and QR code | Read-only |
|
|
586
|
-
| `dokploy_auth_verify_2fa_setup` | Verify and enable 2FA | Mutating |
|
|
587
|
-
| `dokploy_auth_verify_login_2fa` | Verify 2FA PIN during login | Mutating |
|
|
588
|
-
| `dokploy_auth_disable_2fa` | Disable two-factor authentication | Mutating |
|
|
589
|
-
| `dokploy_auth_verify_token` | Verify auth token validity | Mutating |
|
|
590
|
-
|
|
591
|
-
### Admin (9 tools)
|
|
592
|
-
|
|
593
|
-
| Tool | Description | Type |
|
|
594
|
-
|---|---|---|
|
|
595
|
-
| `dokploy_admin_one` | Get admin profile and configuration | Read-only |
|
|
596
|
-
| `dokploy_admin_create_user_invitation` | Send user invitation email | Mutating |
|
|
597
|
-
| `dokploy_admin_remove_user` | Remove a user permanently | Destructive |
|
|
598
|
-
| `dokploy_admin_get_user_by_token` | Look up user by invitation token | Read-only |
|
|
599
|
-
| `dokploy_admin_assign_permissions` | Assign granular permissions to a user | Mutating |
|
|
600
|
-
| `dokploy_admin_clean_github_app` | Remove GitHub App integration | Mutating |
|
|
601
|
-
| `dokploy_admin_get_repositories` | List GitHub App repositories | Read-only |
|
|
602
|
-
| `dokploy_admin_get_branches` | List branches for a GitHub repo | Read-only |
|
|
603
|
-
| `dokploy_admin_have_github_configured` | Check if GitHub App is configured | Read-only |
|
|
604
|
-
|
|
605
|
-
### User (3 tools)
|
|
606
|
-
|
|
607
|
-
| Tool | Description | Type |
|
|
608
|
-
|---|---|---|
|
|
609
|
-
| `dokploy_user_all` | List all registered users | Read-only |
|
|
610
|
-
| `dokploy_user_by_auth_id` | Get user by authentication ID | Read-only |
|
|
611
|
-
| `dokploy_user_by_user_id` | Get user by user ID | Read-only |
|
|
612
|
-
|
|
613
|
-
## Architecture
|
|
614
|
-
|
|
615
|
-
```
|
|
616
|
-
src/
|
|
617
|
-
index.ts - Entry point, routes CLI vs MCP server
|
|
618
|
-
server.ts - MCP server creation, tool registration
|
|
619
|
-
api/client.ts - Fetch-based API client with config resolver
|
|
620
|
-
config/types.ts - Config types and platform paths
|
|
621
|
-
config/resolver.ts - Config resolution chain (env -> file -> CLI)
|
|
622
|
-
cli/index.ts - CLI command router
|
|
623
|
-
cli/setup.ts - Interactive setup wizard (@clack/prompts TUI)
|
|
624
|
-
tools/_factory.ts - Tool creation helpers (createTool, postTool, getTool)
|
|
625
|
-
tools/index.ts - Aggregates all tool module exports
|
|
626
|
-
tools/{module}.ts - 24 domain modules (224 tools total)
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
**Key patterns:**
|
|
630
|
-
|
|
631
|
-
- `postTool()` creates tools that call POST endpoints (mutations)
|
|
632
|
-
- `getTool()` creates tools that call GET endpoints (reads), automatically annotated with `readOnlyHint` and `idempotentHint`
|
|
633
|
-
- `createTool()` is the low-level factory for tools with custom handler logic
|
|
634
|
-
- The API client uses native `fetch` with config resolution: env vars -> config file -> Dokploy CLI
|
|
635
|
-
- Authentication is via `x-api-key` header on every request
|
|
636
|
-
- All tool schemas use Zod v4 with `.describe()` on all parameters
|
|
637
|
-
- Error handling maps HTTP status codes (401, 403, 404, 422) to user-friendly messages
|
|
638
|
-
- CLI setup uses `@clack/prompts` for a modern terminal UI
|
|
639
|
-
|
|
640
|
-
## Development
|
|
641
|
-
|
|
642
197
|
```bash
|
|
643
|
-
npm run
|
|
644
|
-
npm run
|
|
645
|
-
npm run typecheck # Type-check without emitting files
|
|
198
|
+
npm run dev # Watch mode
|
|
199
|
+
npm run typecheck # Type-check
|
|
646
200
|
npm run lint # Lint with Biome
|
|
647
|
-
npm run lint:fix # Auto-fix
|
|
648
|
-
npm run format # Format with Biome
|
|
649
|
-
npm start # Run the built server
|
|
201
|
+
npm run lint:fix # Auto-fix
|
|
650
202
|
```
|
|
651
203
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
Use the MCP Inspector to test tools interactively:
|
|
204
|
+
Test with the MCP Inspector:
|
|
655
205
|
|
|
656
206
|
```bash
|
|
657
207
|
npx @modelcontextprotocol/inspector node dist/index.js
|
|
658
208
|
```
|
|
659
209
|
|
|
660
|
-
Pass environment variables via the inspector UI or prefix the command:
|
|
661
|
-
|
|
662
|
-
```bash
|
|
663
|
-
DOKPLOY_URL=https://panel.example.com DOKPLOY_API_KEY=your-key npx @modelcontextprotocol/inspector node dist/index.js
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
## Adding a New Tool
|
|
667
|
-
|
|
668
|
-
1. Find the module file in `src/tools/` (e.g., `application.ts`)
|
|
669
|
-
2. Add a `postTool()` or `getTool()` call with `name`, `title`, `description`, `schema`, and `endpoint`
|
|
670
|
-
3. Use `.describe()` on all Zod schema parameters
|
|
671
|
-
4. Set `annotations: { destructiveHint: true }` for destructive operations
|
|
672
|
-
5. Add the tool to the module's exported array
|
|
673
|
-
6. Run `npm run build`
|
|
674
|
-
|
|
675
|
-
Example:
|
|
676
|
-
|
|
677
|
-
```typescript
|
|
678
|
-
const myTool = postTool({
|
|
679
|
-
name: 'dokploy_application_my_action',
|
|
680
|
-
title: 'My Action',
|
|
681
|
-
description: 'Description of what this tool does.',
|
|
682
|
-
schema: z.object({
|
|
683
|
-
applicationId: z.string().min(1).describe('The unique application ID'),
|
|
684
|
-
}),
|
|
685
|
-
endpoint: '/application.myAction',
|
|
686
|
-
annotations: { destructiveHint: true }, // if applicable
|
|
687
|
-
})
|
|
688
|
-
```
|
|
689
|
-
|
|
690
210
|
## License
|
|
691
211
|
|
|
692
|
-
MIT
|
|
212
|
+
MIT - [Vibe Code](https://vcode.sh)
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/dist/tools/auth.d.ts
DELETED
package/dist/tools/auth.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { getTool, postTool } from './_factory.js';
|
|
3
|
-
// ── tools ────────────────────────────────────────────────────────────
|
|
4
|
-
const createAdmin = postTool({
|
|
5
|
-
name: 'dokploy_auth_create_admin',
|
|
6
|
-
title: 'Create Admin Account',
|
|
7
|
-
description: 'Create the initial admin account for a fresh Dokploy installation. Requires an email address and a password (minimum 8 characters). This should only be called once during initial setup. Returns the created admin account details.',
|
|
8
|
-
schema: z.object({
|
|
9
|
-
email: z.string().email().describe('Email address for the admin account'),
|
|
10
|
-
password: z.string().min(8).describe('Password for the admin account (min 8 characters)'),
|
|
11
|
-
}).strict(),
|
|
12
|
-
endpoint: '/auth.createAdmin',
|
|
13
|
-
});
|
|
14
|
-
const createUser = postTool({
|
|
15
|
-
name: 'dokploy_auth_create_user',
|
|
16
|
-
title: 'Create User Account',
|
|
17
|
-
description: 'Create a new user account from an invitation token and password. The user must have received an invitation email containing a token and ID. Requires the invitation token, user/invitation ID, and a password (minimum 8 characters). Returns the created user account details.',
|
|
18
|
-
schema: z.object({
|
|
19
|
-
password: z.string().min(8).describe('Password for the new user (min 8 characters)'),
|
|
20
|
-
id: z.string().min(1).describe('The invitation or user ID'),
|
|
21
|
-
token: z.string().min(1).describe('The invitation token'),
|
|
22
|
-
}).strict(),
|
|
23
|
-
endpoint: '/auth.createUser',
|
|
24
|
-
});
|
|
25
|
-
const login = postTool({
|
|
26
|
-
name: 'dokploy_auth_login',
|
|
27
|
-
title: 'Login',
|
|
28
|
-
description: 'Log in to Dokploy with an email address and password. If the account has two-factor authentication enabled, a subsequent call to verify_login_2fa will be required. Returns a session token or a 2FA challenge depending on account configuration.',
|
|
29
|
-
schema: z.object({
|
|
30
|
-
email: z.string().email().describe('Email address of the account'),
|
|
31
|
-
password: z.string().min(8).describe('Account password (min 8 characters)'),
|
|
32
|
-
}).strict(),
|
|
33
|
-
endpoint: '/auth.login',
|
|
34
|
-
});
|
|
35
|
-
const get = getTool({
|
|
36
|
-
name: 'dokploy_auth_get',
|
|
37
|
-
title: 'Get Current User',
|
|
38
|
-
description: "Get the currently authenticated user's profile information. No parameters required. Returns the user's email, role, 2FA status, and other profile fields associated with the active session.",
|
|
39
|
-
schema: z.object({}).strict(),
|
|
40
|
-
endpoint: '/auth.get',
|
|
41
|
-
});
|
|
42
|
-
const logout = postTool({
|
|
43
|
-
name: 'dokploy_auth_logout',
|
|
44
|
-
title: 'Logout',
|
|
45
|
-
description: 'Log out the current user session and invalidate the active authentication token. No parameters required. Returns a confirmation that the session has been terminated.',
|
|
46
|
-
schema: z.object({}).strict(),
|
|
47
|
-
endpoint: '/auth.logout',
|
|
48
|
-
});
|
|
49
|
-
const update = postTool({
|
|
50
|
-
name: 'dokploy_auth_update',
|
|
51
|
-
title: 'Update Current User',
|
|
52
|
-
description: "Update the currently authenticated user's profile information. Accepts optional fields including email, password, role, profile image URL, and 2FA enabled status. Fields set to null will be cleared. Returns the updated user profile.",
|
|
53
|
-
schema: z.object({
|
|
54
|
-
email: z.string().email().nullable().describe('New email address, or null to clear'),
|
|
55
|
-
password: z.string().nullable().describe('New password, or null to keep current'),
|
|
56
|
-
id: z.string().min(1).optional().describe('The auth ID to update'),
|
|
57
|
-
rol: z.enum(['admin', 'user']).optional().describe('Role to assign: admin or user'),
|
|
58
|
-
image: z.string().optional().describe('Profile image URL'),
|
|
59
|
-
is2FAEnabled: z.boolean().optional().describe('Whether two-factor authentication is enabled'),
|
|
60
|
-
}).strict(),
|
|
61
|
-
endpoint: '/auth.update',
|
|
62
|
-
});
|
|
63
|
-
const generateToken = postTool({
|
|
64
|
-
name: 'dokploy_auth_generate_token',
|
|
65
|
-
title: 'Generate API Token',
|
|
66
|
-
description: 'Generate a new API token for the currently authenticated user. The token can be used for programmatic API access via the x-api-key header. No parameters required. Returns the generated token string.',
|
|
67
|
-
schema: z.object({}).strict(),
|
|
68
|
-
endpoint: '/auth.generateToken',
|
|
69
|
-
});
|
|
70
|
-
const one = getTool({
|
|
71
|
-
name: 'dokploy_auth_one',
|
|
72
|
-
title: 'Get User Auth Info',
|
|
73
|
-
description: "Get a specific user's authentication information by their auth ID. Requires the auth ID of the target user. Returns the user's email, role, 2FA status, and other auth-related fields.",
|
|
74
|
-
schema: z.object({
|
|
75
|
-
id: z.string().min(1).describe('The auth ID of the user to retrieve'),
|
|
76
|
-
}).strict(),
|
|
77
|
-
endpoint: '/auth.one',
|
|
78
|
-
});
|
|
79
|
-
const updateByAdmin = postTool({
|
|
80
|
-
name: 'dokploy_auth_update_by_admin',
|
|
81
|
-
title: 'Update User as Admin',
|
|
82
|
-
description: "Update any user's profile information with admin privileges. Requires the target user's auth ID and accepts fields including email, password, role, profile image URL, and 2FA enabled status. Fields set to null will be cleared. Returns the updated user profile.",
|
|
83
|
-
schema: z.object({
|
|
84
|
-
id: z.string().min(1).describe('The auth ID of the user to update'),
|
|
85
|
-
email: z.string().email().nullable().describe('New email address, or null to clear'),
|
|
86
|
-
password: z.string().nullable().describe('New password, or null to keep current'),
|
|
87
|
-
rol: z.enum(['admin', 'user']).optional().describe('Role to assign: admin or user'),
|
|
88
|
-
image: z.string().optional().describe('Profile image URL'),
|
|
89
|
-
is2FAEnabled: z.boolean().optional().describe('Whether two-factor authentication is enabled'),
|
|
90
|
-
}).strict(),
|
|
91
|
-
endpoint: '/auth.updateByAdmin',
|
|
92
|
-
});
|
|
93
|
-
const generate2FASecret = getTool({
|
|
94
|
-
name: 'dokploy_auth_generate_2fa_secret',
|
|
95
|
-
title: 'Generate 2FA Secret',
|
|
96
|
-
description: 'Generate a new two-factor authentication secret for the current user. This is the first step in setting up 2FA with an authenticator app. No parameters required. Returns the secret key and a QR code URL that can be scanned by an authenticator app.',
|
|
97
|
-
schema: z.object({}).strict(),
|
|
98
|
-
endpoint: '/auth.generate2FASecret',
|
|
99
|
-
});
|
|
100
|
-
const verify2FASetup = postTool({
|
|
101
|
-
name: 'dokploy_auth_verify_2fa_setup',
|
|
102
|
-
title: 'Verify 2FA Setup',
|
|
103
|
-
description: 'Verify and complete the two-factor authentication setup by providing a PIN from the authenticator app. Requires the 6-digit PIN and the 2FA secret that was generated during setup. Returns a confirmation that 2FA has been successfully enabled on the account.',
|
|
104
|
-
schema: z.object({
|
|
105
|
-
pin: z.string().min(6).describe('The 6-digit PIN from the authenticator app'),
|
|
106
|
-
secret: z.string().min(1).describe('The 2FA secret to verify against'),
|
|
107
|
-
}).strict(),
|
|
108
|
-
endpoint: '/auth.verify2FASetup',
|
|
109
|
-
});
|
|
110
|
-
const verifyLogin2FA = postTool({
|
|
111
|
-
name: 'dokploy_auth_verify_login_2fa',
|
|
112
|
-
title: 'Verify 2FA Login',
|
|
113
|
-
description: 'Verify a two-factor authentication PIN during the login process. This is called after a successful login attempt on an account with 2FA enabled. Requires the 6-digit PIN from the authenticator app and the auth ID of the user. Returns the authenticated session token.',
|
|
114
|
-
schema: z.object({
|
|
115
|
-
pin: z.string().min(6).describe('The 6-digit PIN from the authenticator app'),
|
|
116
|
-
id: z.string().min(1).describe('The auth ID of the user logging in'),
|
|
117
|
-
}).strict(),
|
|
118
|
-
endpoint: '/auth.verifyLogin2FA',
|
|
119
|
-
});
|
|
120
|
-
const disable2FA = postTool({
|
|
121
|
-
name: 'dokploy_auth_disable_2fa',
|
|
122
|
-
title: 'Disable 2FA',
|
|
123
|
-
description: "Disable two-factor authentication for the currently authenticated user's account. No parameters required. Returns a confirmation that 2FA has been removed from the account. Future logins will no longer require a 2FA PIN.",
|
|
124
|
-
schema: z.object({}).strict(),
|
|
125
|
-
endpoint: '/auth.disable2FA',
|
|
126
|
-
});
|
|
127
|
-
const verifyToken = postTool({
|
|
128
|
-
name: 'dokploy_auth_verify_token',
|
|
129
|
-
title: 'Verify Auth Token',
|
|
130
|
-
description: 'Verify the validity of the current authentication token. No parameters required. Returns whether the token is valid and has not expired. Useful for checking if a session is still active before making other API calls.',
|
|
131
|
-
schema: z.object({}).strict(),
|
|
132
|
-
endpoint: '/auth.verifyToken',
|
|
133
|
-
});
|
|
134
|
-
// ── export ───────────────────────────────────────────────────────────
|
|
135
|
-
export const authTools = [
|
|
136
|
-
createAdmin,
|
|
137
|
-
createUser,
|
|
138
|
-
login,
|
|
139
|
-
get,
|
|
140
|
-
logout,
|
|
141
|
-
update,
|
|
142
|
-
generateToken,
|
|
143
|
-
one,
|
|
144
|
-
updateByAdmin,
|
|
145
|
-
generate2FASecret,
|
|
146
|
-
verify2FASetup,
|
|
147
|
-
verifyLogin2FA,
|
|
148
|
-
disable2FA,
|
|
149
|
-
verifyToken,
|
|
150
|
-
];
|