@vibetools/dokploy-mcp 2.1.0 → 2.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 CHANGED
@@ -4,13 +4,13 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
5
  [![Node >= 24](https://img.shields.io/badge/node-%3E%3D24-brightgreen)](https://nodejs.org/)
6
6
 
7
- MCP server for [Dokploy](https://dokploy.com). Two tools. 463 API procedures. Your AI agent can now deploy, configure, and manage your entire infrastructure without memorizing 377 endpoint definitions first.
7
+ MCP server for [Dokploy](https://dokploy.com). Two tools. 463 API procedures. Your AI agent can now deploy, configure, and manage your entire infrastructure without memorizing hundreds of endpoint definitions first.
8
8
 
9
9
  Most MCP servers dump hundreds of tool schemas into your context window and call it a day. This one doesn't. **Code Mode** gives your agent `search` and `execute` -- it finds what it needs from a compact API catalog, writes a workflow, and the sandbox runs the whole thing in one call. Create an app, set env vars, mount volumes, configure domains, deploy -- all in a single round-trip.
10
10
 
11
- The result: **99.8% fewer tokens** on tool definitions. Your context window can go back to doing its actual job.
11
+ The result: **99.4% fewer tokens** on tool definitions. Your context window can go back to doing its actual job.
12
12
 
13
- > Previously: 377 tools = ~92,354 tokens just to list them. Now: 2 tools = ~218 tokens. The math is embarrassing for everyone else.
13
+ > Previously: 377 tools = ~92,354 tokens just to list them. Now: 2 tools = ~595 tokens. The math is still embarrassing for everyone else.
14
14
 
15
15
  ## Quick start
16
16
 
@@ -42,21 +42,93 @@ Want a wizard? `npx @vibetools/dokploy-mcp setup` -- validates credentials, save
42
42
  Your agent gets two tools:
43
43
 
44
44
  ```
45
- search → "what can Dokploy do with applications?"
46
- execute → runs a multi-step workflow in one sandboxed call
45
+ search → discover API procedures and their parameters
46
+ execute → run a multi-step workflow in one sandboxed call
47
47
  ```
48
48
 
49
- One `execute` call can spin up an app, configure resource limits, set 5 env vars, create 3 file mounts, attach a domain with HTTPS, deploy, wait for it to come up, verify it's running, and clean up after itself. Eight API calls. One context window round-trip. Sub-second sandbox overhead.
49
+ `dokploy` and `helpers` are sandbox globals -- your agent writes bare code, no wrapper functions:
50
50
 
51
- **What this looks like in practice:**
51
+ ```js
52
+ // search
53
+ catalog.searchText("deploy")
54
+ catalog.get("application.one")
55
+
56
+ // execute -- just write code
57
+ await dokploy.settings.health()
58
+
59
+ // multi-step workflows
60
+ const app = await dokploy.application.one({ applicationId: "id", select: ["name", "status"] })
61
+ return app.name
62
+ ```
63
+
64
+ One `execute` call can spin up an app, configure resource limits, set env vars, create file mounts, attach a domain with HTTPS, deploy, wait for it to come up, verify, and clean up. Eight API calls. One context window round-trip.
65
+
66
+ **Token comparison:**
52
67
 
53
68
  | | Old way (endpoint-per-tool) | Code Mode |
54
69
  |---|---|---|
55
- | Tool definitions sent | ~92,354 tokens (377 tools) | ~218 tokens (2 tools) |
70
+ | Tool definitions sent | ~92,354 tokens (377 tools) | ~595 tokens (2 tools) |
56
71
  | Deploy workflow (8 API calls) | 8 round-trips through the model | 1 execute call, done |
57
- | Context window tax | ~738k tokens on tool schemas alone | ~218 tokens total |
72
+ | Context window tax | ~738k tokens on tool schemas alone | ~595 tokens total |
73
+
74
+ Every token spent on tool definitions is a token your agent can't use for reasoning. We just gave you 738k of them back.
75
+
76
+ ## Response shaping
77
+
78
+ Heavy endpoints like `application.one` return 25KB+ of data when you need 3 fields. Code Mode adds optional shaping parameters that trim responses **before** the sandbox counts bytes:
79
+
80
+ ```js
81
+ // Select only the fields you need (96% reduction)
82
+ await dokploy.application.one({
83
+ applicationId: "id",
84
+ select: ["name", "applicationStatus", "mounts", "watchPaths"],
85
+ includeDeployments: false
86
+ })
87
+
88
+ // Or limit deployment history instead of excluding it entirely
89
+ await dokploy.application.one({
90
+ applicationId: "id",
91
+ deploymentLimit: 1 // only the latest deployment
92
+ })
93
+ ```
94
+
95
+ Without shaping params, behavior is identical to the raw Dokploy API -- fully backward compatible.
58
96
 
59
- That last row is why this exists. Every token spent on tool definitions is a token your agent can't use for reasoning. We just gave you 738k of them back.
97
+ ## Virtual helpers
98
+
99
+ Code Mode includes MCP-side helpers for common multi-call patterns. They run inside `execute`, fan out to real Dokploy API calls, and charge every underlying call against the sandbox budget honestly.
100
+
101
+ **Batch reads** -- inspect N apps without N separate tool calls:
102
+
103
+ ```js
104
+ await dokploy.application.many({
105
+ applicationIds: ["app-1", "app-2", "app-3"],
106
+ select: ["name", "applicationStatus", "watchPaths"],
107
+ includeDeployments: false
108
+ })
109
+ // Returns: { items: [...], total: 3 }
110
+ ```
111
+
112
+ **Project overview** -- the entire project state in one call:
113
+
114
+ ```js
115
+ await dokploy.project.overview({ projectId: "id" })
116
+ // Returns: { name, environments: [{ name, applications: [{ name, status, domains, mounts, watchPaths, lastDeployment }] }] }
117
+ ```
118
+
119
+ These are discoverable via `search` (`catalog.get("application.many")`, `catalog.get("project.overview")`). They are MCP-side virtual procedures, not Dokploy HTTP endpoints.
120
+
121
+ ## Sandbox helpers
122
+
123
+ Available as globals inside `execute`:
124
+
125
+ | Helper | Description |
126
+ |---|---|
127
+ | `helpers.sleep(ms)` | Async delay, max 15s. Use after deploy to wait for containers. |
128
+ | `helpers.assert(condition, msg)` | Quick validation. Throws on falsy. |
129
+ | `helpers.pick(obj, keys)` | Object projection. |
130
+ | `helpers.limit(arr, n)` | Array slicing. |
131
+ | `helpers.selectOne(arr, pred?)` | Find first match. |
60
132
 
61
133
  ## Configuration
62
134
 
@@ -87,8 +159,6 @@ The Code Mode catalog covers the full Dokploy OpenAPI surface -- 463 procedures
87
159
 
88
160
  Your agent doesn't need to know any of this upfront. That's the point. It searches when it needs something, executes when it knows what to do.
89
161
 
90
- Coverage details: **[docs/coverage.md](docs/coverage.md)**
91
-
92
162
  ## CLI
93
163
 
94
164
  ```bash