mcp-dokploy-fullapi-proxy 1.0.1

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.
@@ -0,0 +1,30 @@
1
+ name: Publish to npm
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ jobs:
7
+ publish:
8
+ runs-on: ubuntu-latest
9
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
10
+ permissions:
11
+ contents: write
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ token: ${{ secrets.GITHUB_TOKEN }}
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 20
19
+ registry-url: https://registry.npmjs.org
20
+ - run: npm ci
21
+ - run: npm run build
22
+ - name: Bump version, publish, push back
23
+ env:
24
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25
+ run: |
26
+ git config user.name "github-actions"
27
+ git config user.email "github-actions@github.com"
28
+ npm version patch -m "v%s [skip ci]"
29
+ npm publish --access public || echo "Version already published, skipping"
30
+ git push || echo "Push failed, version published to npm"
package/README.md ADDED
@@ -0,0 +1,525 @@
1
+ # mcp-dokploy-fullapi-proxy
2
+
3
+ > **Dokploy Version: `v0.28.1` — 436 Endpoints** _(last updated: 2026-02-28)_
4
+
5
+ Full API proxy MCP for the entire Dokploy API. **1 tool, ~200 tokens** instead of 67+ tools consuming ~35,000 tokens per conversation.
6
+
7
+ ## How it works
8
+
9
+ A single MCP tool `dokploy(method, params?)` acts as a thin proxy to Dokploy's tRPC API. All intelligence lives in skill files that Claude reads on-demand via **Progressive Disclosure** – only the relevant API section is loaded into context, saving 77–92% tokens per request.
10
+
11
+ ## Setup
12
+
13
+ ```bash
14
+ git clone https://github.com/hl9020/mcp-dokploy-fullapi-proxy.git
15
+ cd mcp-dokploy-fullapi-proxy
16
+ npm install
17
+ npm run build
18
+ ```
19
+
20
+ ## Configuration
21
+
22
+ > **Architecture:** This MCP uses a two-part setup:
23
+ > 1. **MCP Server** – gives the AI tool access to the `dokploy()` function
24
+ > 2. **Skill/Instructions** – teaches the AI *which* endpoints exist and *how* to call them
25
+ >
26
+ > Without the skill, the AI has the tool but doesn't know the API. Tools that support native skill files get Progressive Disclosure (on-demand loading). Tools without skill support need the SKILL.md content injected as instructions (higher baseline token cost but still far better than 67 individual tools).
27
+
28
+ ---
29
+
30
+ ### Claude Desktop / Claude.ai
31
+
32
+ **MCP:** ✅ Native  |  **Skills:** ✅ Native (ZIP upload)
33
+
34
+ #### 1. MCP Server
35
+
36
+ Add to `claude_desktop_config.json`:
37
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
38
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "dokploy-fullapi-proxy": {
44
+ "command": "node",
45
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
46
+ "env": {
47
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
48
+ "DOKPLOY_TOKEN": "your-api-token"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ #### 2. Skill Upload
56
+
57
+ 1. Download `skill/dokploy-api.zip` from this repo
58
+ 2. Go to **Claude.ai / Claude Desktop → Customize → Skills**
59
+ 3. Click **+** and upload `dokploy-api.zip`
60
+
61
+
62
+ Get your API token from Dokploy: **Settings → Profile → API/Token Section**.
63
+
64
+ ---
65
+
66
+ ### Claude Code
67
+
68
+ **MCP:** ✅ Native  |  **Skills:** ✅ Native (`.claude/skills/` directory)
69
+
70
+ #### 1. MCP Server
71
+
72
+ ```bash
73
+ claude mcp add dokploy-fullapi-proxy \
74
+ -e DOKPLOY_URL=https://your-dokploy-instance.com/api \
75
+ -e DOKPLOY_TOKEN=your-api-token \
76
+ -- node /path/to/mcp-dokploy-fullapi-proxy/dist/index.js
77
+ ```
78
+
79
+ Or add to `.mcp.json` in your project root (Windows: use `cmd /c` wrapper):
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "dokploy-fullapi-proxy": {
85
+ "command": "node",
86
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
87
+ "env": {
88
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
89
+ "DOKPLOY_TOKEN": "your-api-token"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ #### 2. Skills
97
+
98
+ Copy the `skill/` directory into your project's Claude Code skills folder:
99
+
100
+ ```bash
101
+ mkdir -p .claude/skills/dokploy-api
102
+ cp skill/*.md .claude/skills/dokploy-api/
103
+ ```
104
+
105
+ Claude Code uses Progressive Disclosure from `.claude/skills/` automatically – it reads `SKILL.md` first, then loads the relevant reference file on demand.
106
+
107
+ ---
108
+
109
+ ### Cursor
110
+
111
+ **MCP:** ✅ Native  |  **Skills:** ✅ Agent Skills (auto-discovered)
112
+
113
+ #### 1. MCP Server
114
+
115
+ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
116
+
117
+ ```json
118
+ {
119
+ "mcpServers": {
120
+ "dokploy-fullapi-proxy": {
121
+ "command": "node",
122
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
123
+ "env": {
124
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
125
+ "DOKPLOY_TOKEN": "your-api-token"
126
+ }
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ #### 2. Skills
133
+
134
+ Cursor supports **Agent Skills** – an open standard for extending AI agents. Copy the skill files into your project:
135
+
136
+ ```bash
137
+ mkdir -p .cursor/skills/dokploy-api
138
+ cp skill/*.md .cursor/skills/dokploy-api/
139
+ ```
140
+
141
+ Cursor auto-discovers skills and applies them as agent-decided rules. Enable under **Settings → Rules → Import Settings → Agent Skills**.
142
+
143
+ Alternatively, create a `.cursor/rules/dokploy.mdc` rule:
144
+
145
+ ```markdown
146
+ ---
147
+ description: Use when managing Dokploy infrastructure
148
+ alwaysApply: false
149
+ ---
150
+ [Paste contents of skill/SKILL.md here]
151
+ ```
152
+
153
+ ---
154
+
155
+ ### Windsurf
156
+
157
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use Rules workaround)
158
+
159
+ #### 1. MCP Server
160
+
161
+ Add to `~/.codeium/windsurf/mcp_config.json` (Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`):
162
+
163
+ ```json
164
+ {
165
+ "mcpServers": {
166
+ "dokploy-fullapi-proxy": {
167
+ "command": "node",
168
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
169
+ "env": {
170
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
171
+ "DOKPLOY_TOKEN": "your-api-token"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ ```
177
+
178
+
179
+ #### 2. Skill Workaround (Global Rule)
180
+
181
+ Create a global or workspace rule via **Settings → Rules, Memories & Workflows → Rules → + Global** (or `+ Workspace`), or create `.windsurf/rules/dokploy.md`:
182
+
183
+ ```markdown
184
+ ## Dokploy MCP API Reference
185
+
186
+ When managing Dokploy infrastructure, use the `dokploy(method, params?)` MCP tool.
187
+
188
+ [Paste contents of skill/SKILL.md here]
189
+ ```
190
+
191
+ ---
192
+
193
+ ### VS Code + GitHub Copilot
194
+
195
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use Instructions workaround)
196
+
197
+ #### 1. MCP Server
198
+
199
+ Add to `.vscode/mcp.json` in your workspace:
200
+
201
+ ```json
202
+ {
203
+ "servers": {
204
+ "dokploy-fullapi-proxy": {
205
+ "command": "node",
206
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
207
+ "env": {
208
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
209
+ "DOKPLOY_TOKEN": "your-api-token"
210
+ }
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ #### 2. Skill Workaround (Copilot Instructions)
217
+
218
+ Create `.github/copilot-instructions.md` in your project root and paste the contents of `skill/SKILL.md`.
219
+
220
+ ---
221
+
222
+ ### Cline (VS Code Extension)
223
+
224
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use .clinerules workaround)
225
+
226
+ #### 1. MCP Server
227
+
228
+ Open Cline → **MCP Servers** icon → **Edit MCP Settings**, then add:
229
+
230
+ ```json
231
+ {
232
+ "mcpServers": {
233
+ "dokploy-fullapi-proxy": {
234
+ "command": "node",
235
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
236
+ "env": {
237
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
238
+ "DOKPLOY_TOKEN": "your-api-token"
239
+ }
240
+ }
241
+ }
242
+ }
243
+ ```
244
+
245
+ #### 2. Skill Workaround (.clinerules)
246
+
247
+ Create a `.clinerules` file in your project root and paste the contents of `skill/SKILL.md`. Cline injects this into every conversation as custom instructions.
248
+
249
+ ---
250
+
251
+ ### Continue.dev
252
+
253
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use Rules workaround)
254
+
255
+ #### 1. MCP Server
256
+
257
+ Create `.continue/mcpServers/dokploy.json`:
258
+
259
+ ```json
260
+ {
261
+ "mcpServers": {
262
+ "dokploy-fullapi-proxy": {
263
+ "command": "node",
264
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
265
+ "env": {
266
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
267
+ "DOKPLOY_TOKEN": "your-api-token"
268
+ }
269
+ }
270
+ }
271
+ }
272
+ ```
273
+
274
+ #### 2. Skill Workaround (Rules)
275
+
276
+ Add a `.continue/rules/dokploy.md` rule with the contents of `skill/SKILL.md`. Continue applies rules as persistent context for the model.
277
+
278
+ ---
279
+
280
+ ### OpenAI Codex CLI
281
+
282
+ **MCP:** ✅ Native  |  **Skills:** ✅ Native (`.agents/skills/` directory)
283
+
284
+ #### 1. MCP Server
285
+
286
+ ```bash
287
+ codex mcp add dokploy-fullapi-proxy \
288
+ --env DOKPLOY_URL=https://your-dokploy-instance.com/api \
289
+ --env DOKPLOY_TOKEN=your-api-token \
290
+ -- node /path/to/mcp-dokploy-fullapi-proxy/dist/index.js
291
+ ```
292
+
293
+ Or add to `~/.codex/config.toml` (global) or `.codex/config.toml` (project):
294
+
295
+ ```toml
296
+ [mcp_servers.dokploy-fullapi-proxy]
297
+ command = "node"
298
+ args = ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"]
299
+
300
+ [mcp_servers.dokploy-fullapi-proxy.env]
301
+ DOKPLOY_URL = "https://your-dokploy-instance.com/api"
302
+ DOKPLOY_TOKEN = "your-api-token"
303
+ ```
304
+
305
+ #### 2. Skills
306
+
307
+ Copy the `skill/` directory into `.agents/skills/`:
308
+
309
+ ```bash
310
+ mkdir -p .agents/skills/dokploy-api
311
+ cp skill/*.md .agents/skills/dokploy-api/
312
+ ```
313
+
314
+ Codex discovers skills from `.agents/skills/` automatically via `AGENTS.md`.
315
+
316
+
317
+ ---
318
+
319
+ ### Zed
320
+
321
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use AGENTS.md workaround)
322
+
323
+ #### 1. MCP Server
324
+
325
+ Add to Zed `settings.json` (via **Agent Panel → Settings**):
326
+
327
+ ```json
328
+ {
329
+ "context_servers": {
330
+ "dokploy-fullapi-proxy": {
331
+ "command": {
332
+ "path": "node",
333
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
334
+ "env": {
335
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
336
+ "DOKPLOY_TOKEN": "your-api-token"
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ ```
343
+
344
+ #### 2. Skill Workaround
345
+
346
+ Create an `AGENTS.md` file in your project root and include the contents of `skill/SKILL.md`. Zed's agent reads `AGENTS.md` for project instructions.
347
+
348
+ ---
349
+
350
+ ### Google Antigravity
351
+
352
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use Rules workaround)
353
+
354
+ #### 1. MCP Server
355
+
356
+ Add to `~/.gemini/settings.json` or via **Antigravity Settings → MCP**:
357
+
358
+ ```json
359
+ {
360
+ "mcpServers": {
361
+ "dokploy-fullapi-proxy": {
362
+ "command": "node",
363
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
364
+ "env": {
365
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
366
+ "DOKPLOY_TOKEN": "your-api-token"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ ```
372
+
373
+ #### 2. Skill Workaround
374
+
375
+ Create a `GEMINI.md` or project rules file and include the contents of `skill/SKILL.md`.
376
+
377
+ ---
378
+
379
+ ### Roo Code (VS Code Extension)
380
+
381
+ **MCP:** ✅ Native  |  **Skills:** ❌ No native support (use Custom Instructions workaround)
382
+
383
+ #### 1. MCP Server
384
+
385
+ Configure via Roo Code's MCP settings panel, same JSON format as Cline:
386
+
387
+ ```json
388
+ {
389
+ "mcpServers": {
390
+ "dokploy-fullapi-proxy": {
391
+ "command": "node",
392
+ "args": ["/path/to/mcp-dokploy-fullapi-proxy/dist/index.js"],
393
+ "env": {
394
+ "DOKPLOY_URL": "https://your-dokploy-instance.com/api",
395
+ "DOKPLOY_TOKEN": "your-api-token"
396
+ }
397
+ }
398
+ }
399
+ }
400
+ ```
401
+
402
+ #### 2. Skill Workaround
403
+
404
+ Add the contents of `skill/SKILL.md` to Roo Code's custom system prompt or `.roo/rules/` directory.
405
+
406
+ ---
407
+
408
+ ## Compatibility Matrix
409
+
410
+ | Tool | MCP Server | Native Skills | Skill Workaround | Config Location |
411
+ |------|:---:|:---:|:---:|---|
412
+ | **Claude Desktop / Claude.ai** | ✅ | ✅ ZIP Upload | – | `claude_desktop_config.json` |
413
+ | **Claude Code** | ✅ | ✅ `.claude/skills/` | – | `.mcp.json` |
414
+ | **Cursor** | ✅ | ✅ Agent Skills | `.cursor/rules/*.mdc` | `.cursor/mcp.json` |
415
+ | **Codex CLI** | ✅ | ✅ `.agents/skills/` | – | `.codex/config.toml` |
416
+ | **Windsurf** | ✅ | ❌ | `.windsurf/rules/` | `~/.codeium/windsurf/mcp_config.json` |
417
+ | **VS Code + Copilot** | ✅ | ❌ | `.github/copilot-instructions.md` | `.vscode/mcp.json` |
418
+ | **Cline** | ✅ | ❌ | `.clinerules` | MCP Settings JSON |
419
+ | **Continue.dev** | ✅ | ❌ | `.continue/rules/` | `.continue/mcpServers/*.json` |
420
+ | **Zed** | ✅ | ❌ | `AGENTS.md` | `settings.json` |
421
+ | **Google Antigravity** | ✅ | ❌ | `GEMINI.md` / Rules | `~/.gemini/settings.json` |
422
+ | **Roo Code** | ✅ | ❌ | `.roo/rules/` | MCP Settings JSON |
423
+
424
+ > **Legend:** Tools with native skill support get Progressive Disclosure (on-demand file loading, ~500–2,000 tokens per request). Tools without skills load the full SKILL.md as instructions (~500 tokens always-on, without the granular per-resource files).
425
+
426
+ ---
427
+
428
+ ## Skill files
429
+
430
+ The `skill/` directory contains API documentation split by resource (auto-generated from Dokploy's OpenAPI spec). Claude reads only the relevant section when needed:
431
+
432
+ | File | Endpoints | Coverage |
433
+ |------|-----------|----------|
434
+ | `SKILL.md` | – | Entry point, routing table |
435
+ | `project.md` | 12 | Projects & Environments |
436
+ | `app.md` | 28 | Applications |
437
+ | `compose.md` | 27 | Compose services |
438
+ | `domain.md` | 9 | Domains & SSL |
439
+ | `database.md` | 65 | PostgreSQL, MySQL, MariaDB, MongoDB, Redis |
440
+ | `deployment.md` | 12 | Deployments, Preview, Rollback |
441
+ | `docker.md` | 7 | Docker containers |
442
+ | `server.md` | 23 | Server, Cluster, Swarm |
443
+ | `notification.md` | 38 | Notifications (Slack, Discord, Telegram, Email, Teams, Resend, ...) |
444
+ | `settings.md` | 73 | Settings, Admin, Stripe, SSO, LicenseKey |
445
+ | `user.md` | 27 | User & Organization |
446
+ | `git.md` | 30 | Git Providers (GitHub, GitLab, Bitbucket, Gitea) |
447
+ | `infra.md` | 85 | Mounts, Redirects, Security, Ports, Backups, Schedule, Certs, Registry, SSH, AI |
448
+
449
+ ## Token comparison
450
+
451
+ | | Official Dokploy MCP | mcp-dokploy-fullapi-proxy |
452
+ |---|---|---|
453
+ | Tools registered | 67 | 1 |
454
+ | Permanent context tokens | ~35,000 | ~200 |
455
+ | API coverage | ~16% (67 of 436 endpoints) | 100% (436 endpoints) |
456
+ | On-demand tokens per request | 0 | ~500–2,000 (1 skill file) |
457
+ | Typical savings | – | **77–92% fewer tokens** |
458
+
459
+
460
+ ## How the skill system works
461
+
462
+ ```
463
+ User: "Deploy my app"
464
+
465
+ Claude reads SKILL.md routing table (~500 tokens)
466
+
467
+ Claude reads app.md (~1,600 tokens)
468
+
469
+ Claude calls: dokploy("application.deploy", { applicationId: "..." })
470
+ ```
471
+
472
+ Instead of loading all 407 endpoint definitions (~15,500 tokens) into every conversation, Claude loads only what's needed. A typical request costs ~2,100 tokens instead of ~15,500.
473
+
474
+ ## Building the skill ZIP
475
+
476
+ ```bash
477
+ # Windows (PowerShell)
478
+ Compress-Archive -Path skill\* -DestinationPath dokploy-api.zip -Force
479
+
480
+ # macOS / Linux
481
+ cd skill && zip -r ../dokploy-api.zip . && cd ..
482
+ ```
483
+
484
+ ## Environment variables
485
+
486
+ | Variable | Required | Default | Description |
487
+ |----------|----------|---------|-------------|
488
+ | `DOKPLOY_URL` | No | `http://localhost:3000/api` | Dokploy API base URL |
489
+ | `DOKPLOY_TOKEN` | Yes | – | API authentication token |
490
+
491
+ Get your API token from Dokploy: **Settings → Profile → API/Token Section**.
492
+
493
+ ## pick - Response Filter
494
+
495
+ The `pick` parameter filters large API responses clientside to only the fields you need — drastically reducing token usage on endpoints like `project.all`.
496
+
497
+ ```js
498
+ // Without pick: returns entire project tree (~50KB, ~10,000 tokens)
499
+ dokploy("project.all")
500
+
501
+ // With pick: returns only MySQL instances (~200 tokens)
502
+ dokploy("project.all", {}, pick: ["mysqlId", "name", "appName", "applicationStatus"])
503
+
504
+ // Get backup info without noise
505
+ dokploy("mysql.one", { mysqlId: "..." }, pick: ["backupId", "schedule", "enabled", "database"])
506
+ ```
507
+
508
+ **How it works:** Recursively traverses the JSON response and retains only nodes that contain the specified field names. Empty objects/arrays are removed automatically.
509
+
510
+ **When to use it:**
511
+ - `project.all` → always use `pick` when looking for a specific resource type
512
+ - `*.one` endpoints → when only a sub-section (backups, mounts, etc.) is needed
513
+ - Any endpoint returning large nested objects
514
+
515
+ ## Verify
516
+
517
+ Start a new conversation and ask:
518
+ ```
519
+ Show me all Dokploy projects
520
+ ```
521
+ The AI should call `dokploy("project.all")`.
522
+
523
+ ## License
524
+
525
+ MIT
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,105 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { z } from "zod";
4
+ const DOKPLOY_URL = process.env.DOKPLOY_URL ?? "http://localhost:3000/api";
5
+ const DOKPLOY_TOKEN = process.env.DOKPLOY_TOKEN ?? process.env.DOKPLOY_API_KEY ?? "";
6
+ if (!DOKPLOY_TOKEN) {
7
+ console.error("DOKPLOY_TOKEN env var required");
8
+ process.exit(1);
9
+ }
10
+ const server = new McpServer({
11
+ name: "mcp-dokploy-fullapi-proxy",
12
+ version: "1.0.0",
13
+ });
14
+ function pickFields(data, fields) {
15
+ if (!data || typeof data !== "object")
16
+ return data;
17
+ if (Array.isArray(data))
18
+ return data.map(item => pickFields(item, fields));
19
+ const obj = data;
20
+ const result = {};
21
+ for (const key of Object.keys(obj)) {
22
+ if (fields.includes(key)) {
23
+ result[key] = obj[key];
24
+ }
25
+ else if (typeof obj[key] === "object" && obj[key] !== null) {
26
+ const nested = pickFields(obj[key], fields);
27
+ // nur hinzufügen wenn nested nicht leer ist
28
+ if (Array.isArray(nested) ? nested.length > 0 : Object.keys(nested).length > 0) {
29
+ result[key] = nested;
30
+ }
31
+ }
32
+ }
33
+ return result;
34
+ }
35
+ server.tool("dokploy", "Universal Dokploy API proxy. Calls any tRPC endpoint. " +
36
+ "Use method like 'project.all', 'application.deploy', 'compose.update'. " +
37
+ "Params are passed as JSON body to the API. " +
38
+ "Optional 'pick' filters the response to only include specified field names (e.g. pick: ['mysql'] on project.all returns only mysql arrays).", { method: z.string(), params: z.record(z.string(), z.unknown()).optional(), pick: z.array(z.string()).optional() }, async ({ method, params, pick }) => {
39
+ const baseUrl = `${DOKPLOY_URL}/trpc/${method}`;
40
+ const hasParams = params && Object.keys(params).length > 0;
41
+ try {
42
+ let res;
43
+ if (hasParams) {
44
+ // tRPC GET queries: params as ?input=<JSON>
45
+ const qs = new URLSearchParams({ input: JSON.stringify({ json: params }) });
46
+ res = await fetch(`${baseUrl}?${qs}`, {
47
+ method: "GET",
48
+ headers: { "x-api-key": DOKPLOY_TOKEN },
49
+ });
50
+ // Fallback to POST for mutations
51
+ if (res.status === 405) {
52
+ res = await fetch(baseUrl, {
53
+ method: "POST",
54
+ headers: { "Content-Type": "application/json", "x-api-key": DOKPLOY_TOKEN },
55
+ body: JSON.stringify({ json: params }),
56
+ });
57
+ }
58
+ }
59
+ else {
60
+ res = await fetch(baseUrl, {
61
+ method: "GET",
62
+ headers: { "x-api-key": DOKPLOY_TOKEN },
63
+ });
64
+ if (res.status === 405) {
65
+ res = await fetch(baseUrl, {
66
+ method: "POST",
67
+ headers: { "Content-Type": "application/json", "x-api-key": DOKPLOY_TOKEN },
68
+ body: "{}",
69
+ });
70
+ }
71
+ }
72
+ const text = await res.text();
73
+ let data;
74
+ try {
75
+ data = JSON.parse(text);
76
+ }
77
+ catch {
78
+ data = text;
79
+ }
80
+ if (!res.ok) {
81
+ const msg = typeof data === "object" ? JSON.stringify(data, null, 2) : String(data);
82
+ return { content: [{ type: "text", text: `❌ ${res.status} ${res.statusText}\n${msg}` }], isError: true };
83
+ }
84
+ const result = typeof data === "object" && data !== null && "result" in data
85
+ ? data.result
86
+ : data;
87
+ const output = typeof result === "object" && result !== null && "data" in result
88
+ ? result.data
89
+ : result;
90
+ const filtered = pick && pick.length > 0 ? pickFields(output, pick) : output;
91
+ return { content: [{ type: "text", text: JSON.stringify(filtered, null, 2) }] };
92
+ }
93
+ catch (e) {
94
+ return { content: [{ type: "text", text: `❌ Network error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
95
+ }
96
+ });
97
+ async function main() {
98
+ const transport = new StdioServerTransport();
99
+ await server.connect(transport);
100
+ }
101
+ main().catch((e) => {
102
+ console.error("Fatal:", e);
103
+ process.exit(1);
104
+ });
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,2BAA2B,CAAC;AAC3E,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;AAErF,IAAI,CAAC,aAAa,EAAE,CAAC;IACnB,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,IAAa,EAAE,MAAgB;IACjD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,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C,CAAC,CAAC,CAAC,MAAM,CAAC;QAC7E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC3F,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,oBAAoB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzI,CAAC;AACH,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "mcp-dokploy-fullapi-proxy",
3
+ "version": "1.0.1",
4
+ "description": "Full API proxy MCP for the entire Dokploy API – single tool, skill-driven, 407 endpoints",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsx src/index.ts",
10
+ "start": "node dist/index.js",
11
+ "update-skills": "python scripts/update-skills.py"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "dokploy",
16
+ "proxy"
17
+ ],
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@modelcontextprotocol/sdk": "^1.12.0",
21
+ "zod": "^4.3.6"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^22.0.0",
25
+ "tsx": "^4.19.0",
26
+ "typescript": "^5.7.0"
27
+ }
28
+ }