@wyattjoh/dokploy-mcp 0.1.0 → 0.2.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.
- package/dist/index.js +24 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29796,6 +29796,9 @@ var require_express = __commonJS((exports, module) => {
|
|
|
29796
29796
|
exports.urlencoded = bodyParser.urlencoded;
|
|
29797
29797
|
});
|
|
29798
29798
|
|
|
29799
|
+
// src/server.ts
|
|
29800
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
29801
|
+
|
|
29799
29802
|
// node_modules/zod/v3/helpers/util.js
|
|
29800
29803
|
var util;
|
|
29801
29804
|
(function(util2) {
|
|
@@ -51705,6 +51708,7 @@ class DokployError extends Error {
|
|
|
51705
51708
|
class DokployClient {
|
|
51706
51709
|
url;
|
|
51707
51710
|
apiToken;
|
|
51711
|
+
timeout = 30000;
|
|
51708
51712
|
constructor(instanceConfig) {
|
|
51709
51713
|
const base = instanceConfig.url.replace(/\/+$/, "");
|
|
51710
51714
|
this.url = `${base}/api`;
|
|
@@ -51721,11 +51725,15 @@ class DokployClient {
|
|
|
51721
51725
|
headers: {
|
|
51722
51726
|
accept: "application/json",
|
|
51723
51727
|
"x-api-key": this.apiToken
|
|
51724
|
-
}
|
|
51728
|
+
},
|
|
51729
|
+
signal: AbortSignal.timeout(this.timeout)
|
|
51725
51730
|
});
|
|
51726
51731
|
if (!res.ok) {
|
|
51727
51732
|
throw new DokployError(res.status, await res.json().catch(() => res.statusText));
|
|
51728
51733
|
}
|
|
51734
|
+
if (res.status === 204 || res.headers.get("content-length") === "0") {
|
|
51735
|
+
return;
|
|
51736
|
+
}
|
|
51729
51737
|
return await res.json();
|
|
51730
51738
|
}
|
|
51731
51739
|
async post(endpoint, body) {
|
|
@@ -51736,11 +51744,15 @@ class DokployClient {
|
|
|
51736
51744
|
accept: "application/json",
|
|
51737
51745
|
"x-api-key": this.apiToken
|
|
51738
51746
|
},
|
|
51739
|
-
body: JSON.stringify(body)
|
|
51747
|
+
body: JSON.stringify(body),
|
|
51748
|
+
signal: AbortSignal.timeout(this.timeout)
|
|
51740
51749
|
});
|
|
51741
51750
|
if (!res.ok) {
|
|
51742
51751
|
throw new DokployError(res.status, await res.json().catch(() => res.statusText));
|
|
51743
51752
|
}
|
|
51753
|
+
if (res.status === 204 || res.headers.get("content-length") === "0") {
|
|
51754
|
+
return;
|
|
51755
|
+
}
|
|
51744
51756
|
return await res.json();
|
|
51745
51757
|
}
|
|
51746
51758
|
listProjects() {
|
|
@@ -51932,7 +51944,7 @@ function register2(server) {
|
|
|
51932
51944
|
});
|
|
51933
51945
|
server.registerTool("dokploy_get_application", {
|
|
51934
51946
|
title: "Get Application",
|
|
51935
|
-
description: "Get
|
|
51947
|
+
description: "Get application config by ID. Returns status, git provider config, and other fields. Environment variables and secrets are excluded; use dokploy_list_environment to access those.",
|
|
51936
51948
|
inputSchema: {
|
|
51937
51949
|
applicationId: exports_external.string().describe("The application ID")
|
|
51938
51950
|
},
|
|
@@ -51942,8 +51954,9 @@ function register2(server) {
|
|
|
51942
51954
|
}
|
|
51943
51955
|
}, async ({ client, applicationId }) => {
|
|
51944
51956
|
const app = await client.getApplication(applicationId);
|
|
51957
|
+
const { env: _env, buildArgs: _buildArgs, buildSecrets: _buildSecrets, ...safe } = app;
|
|
51945
51958
|
return {
|
|
51946
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
51959
|
+
content: [{ type: "text", text: JSON.stringify(safe, null, 2) }]
|
|
51947
51960
|
};
|
|
51948
51961
|
});
|
|
51949
51962
|
server.registerTool("dokploy_update_application", {
|
|
@@ -52154,7 +52167,7 @@ function register5(server) {
|
|
|
52154
52167
|
env: buildEnvString({ ...currentEnv, ...env ?? {} }),
|
|
52155
52168
|
buildArgs: buildEnvString({ ...currentBuildArgs, ...buildArgs ?? {} }),
|
|
52156
52169
|
buildSecrets: buildEnvString({ ...currentBuildSecrets, ...buildSecrets ?? {} }),
|
|
52157
|
-
createEnvFile: createEnvFile ?? false
|
|
52170
|
+
createEnvFile: createEnvFile ?? app.createEnvFile ?? false
|
|
52158
52171
|
});
|
|
52159
52172
|
return {
|
|
52160
52173
|
content: [{ type: "text", text: "Environment updated successfully." }]
|
|
@@ -52182,7 +52195,7 @@ function register5(server) {
|
|
|
52182
52195
|
env: buildEnvString(currentEnv),
|
|
52183
52196
|
buildArgs: app.buildArgs ?? "",
|
|
52184
52197
|
buildSecrets: app.buildSecrets ?? "",
|
|
52185
|
-
createEnvFile: false
|
|
52198
|
+
createEnvFile: app.createEnvFile ?? false
|
|
52186
52199
|
});
|
|
52187
52200
|
return {
|
|
52188
52201
|
content: [
|
|
@@ -52523,10 +52536,12 @@ function register8(server) {
|
|
|
52523
52536
|
}
|
|
52524
52537
|
|
|
52525
52538
|
// src/server.ts
|
|
52539
|
+
var require2 = createRequire2(import.meta.url);
|
|
52540
|
+
var { version: version2 } = require2("../package.json");
|
|
52526
52541
|
function createServer() {
|
|
52527
52542
|
const mcpServer = new McpServer({
|
|
52528
52543
|
name: "dokploy-mcp",
|
|
52529
|
-
version:
|
|
52544
|
+
version: version2
|
|
52530
52545
|
});
|
|
52531
52546
|
mcpServer.registerTool("dokploy_list_instances", {
|
|
52532
52547
|
title: "List Instances",
|
|
@@ -53815,15 +53830,13 @@ class StreamableHTTPServerTransport {
|
|
|
53815
53830
|
var import_express = __toESM(require_express(), 1);
|
|
53816
53831
|
|
|
53817
53832
|
// src/auth.ts
|
|
53818
|
-
import { timingSafeEqual } from "node:crypto";
|
|
53833
|
+
import { createHash, timingSafeEqual } from "node:crypto";
|
|
53819
53834
|
var mcpToken = process.env.DOKPLOY_MCP_TOKEN?.trim() || undefined;
|
|
53820
53835
|
function getMcpToken() {
|
|
53821
53836
|
return mcpToken;
|
|
53822
53837
|
}
|
|
53823
53838
|
function sha256(input) {
|
|
53824
|
-
|
|
53825
|
-
hasher.update(input);
|
|
53826
|
-
return hasher.digest();
|
|
53839
|
+
return createHash("sha256").update(input).digest();
|
|
53827
53840
|
}
|
|
53828
53841
|
function validateBearerToken(authHeader) {
|
|
53829
53842
|
if (!mcpToken) {
|