quicklify 1.0.4 → 1.1.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 +42 -5
- package/README.tr.md +42 -5
- package/SECURITY.md +42 -9
- package/bin/quicklify-mcp +5 -0
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +30 -10
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +2 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/destroy.js +2 -2
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/domain.d.ts.map +1 -1
- package/dist/commands/domain.js +17 -4
- package/dist/commands/domain.js.map +1 -1
- package/dist/commands/firewall.d.ts.map +1 -1
- package/dist/commands/firewall.js +21 -5
- package/dist/commands/firewall.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +50 -18
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/logs.d.ts +3 -2
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +6 -11
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/maintain.d.ts.map +1 -1
- package/dist/commands/maintain.js +18 -5
- package/dist/commands/maintain.js.map +1 -1
- package/dist/commands/monitor.d.ts +3 -9
- package/dist/commands/monitor.d.ts.map +1 -1
- package/dist/commands/monitor.js +7 -48
- package/dist/commands/monitor.js.map +1 -1
- package/dist/commands/restart.d.ts.map +1 -1
- package/dist/commands/restart.js +5 -1
- package/dist/commands/restart.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +25 -6
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/secure.d.ts.map +1 -1
- package/dist/commands/secure.js +17 -4
- package/dist/commands/secure.js.map +1 -1
- package/dist/commands/snapshot.d.ts.map +1 -1
- package/dist/commands/snapshot.js +19 -8
- package/dist/commands/snapshot.js.map +1 -1
- package/dist/commands/ssh.d.ts.map +1 -1
- package/dist/commands/ssh.js +4 -1
- package/dist/commands/ssh.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +34 -76
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transfer.d.ts.map +1 -1
- package/dist/commands/transfer.js +9 -2
- package/dist/commands/transfer.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +9 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/core/backup.d.ts +43 -0
- package/dist/core/backup.d.ts.map +1 -0
- package/dist/core/backup.js +259 -0
- package/dist/core/backup.js.map +1 -0
- package/dist/core/domain.d.ts +30 -0
- package/dist/core/domain.d.ts.map +1 -0
- package/dist/core/domain.js +174 -0
- package/dist/core/domain.js.map +1 -0
- package/dist/core/firewall.d.ts +25 -0
- package/dist/core/firewall.d.ts.map +1 -0
- package/dist/core/firewall.js +146 -0
- package/dist/core/firewall.js.map +1 -0
- package/dist/core/logs.d.ts +28 -0
- package/dist/core/logs.d.ts.map +1 -0
- package/dist/core/logs.js +129 -0
- package/dist/core/logs.js.map +1 -0
- package/dist/core/maintain.d.ts +41 -0
- package/dist/core/maintain.d.ts.map +1 -0
- package/dist/core/maintain.js +180 -0
- package/dist/core/maintain.js.map +1 -0
- package/dist/core/manage.d.ts +34 -0
- package/dist/core/manage.d.ts.map +1 -0
- package/dist/core/manage.js +203 -0
- package/dist/core/manage.js.map +1 -0
- package/dist/core/provision.d.ts +18 -0
- package/dist/core/provision.d.ts.map +1 -0
- package/dist/core/provision.js +197 -0
- package/dist/core/provision.js.map +1 -0
- package/dist/core/secure.d.ts +29 -0
- package/dist/core/secure.d.ts.map +1 -0
- package/dist/core/secure.js +198 -0
- package/dist/core/secure.js.map +1 -0
- package/dist/core/snapshot.d.ts +22 -0
- package/dist/core/snapshot.d.ts.map +1 -0
- package/dist/core/snapshot.js +58 -0
- package/dist/core/snapshot.js.map +1 -0
- package/dist/core/status.d.ts +12 -0
- package/dist/core/status.d.ts.map +1 -0
- package/dist/core/status.js +43 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/tokens.d.ts +4 -0
- package/dist/core/tokens.d.ts.map +1 -0
- package/dist/core/tokens.js +23 -0
- package/dist/core/tokens.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +16 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +105 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/serverBackup.d.ts +29 -0
- package/dist/mcp/tools/serverBackup.d.ts.map +1 -0
- package/dist/mcp/tools/serverBackup.js +376 -0
- package/dist/mcp/tools/serverBackup.js.map +1 -0
- package/dist/mcp/tools/serverInfo.d.ts +20 -0
- package/dist/mcp/tools/serverInfo.d.ts.map +1 -0
- package/dist/mcp/tools/serverInfo.js +219 -0
- package/dist/mcp/tools/serverInfo.js.map +1 -0
- package/dist/mcp/tools/serverLogs.d.ts +30 -0
- package/dist/mcp/tools/serverLogs.d.ts.map +1 -0
- package/dist/mcp/tools/serverLogs.js +145 -0
- package/dist/mcp/tools/serverLogs.js.map +1 -0
- package/dist/mcp/tools/serverMaintain.d.ts +22 -0
- package/dist/mcp/tools/serverMaintain.d.ts.map +1 -0
- package/dist/mcp/tools/serverMaintain.js +217 -0
- package/dist/mcp/tools/serverMaintain.js.map +1 -0
- package/dist/mcp/tools/serverManage.d.ts +33 -0
- package/dist/mcp/tools/serverManage.d.ts.map +1 -0
- package/dist/mcp/tools/serverManage.js +207 -0
- package/dist/mcp/tools/serverManage.js.map +1 -0
- package/dist/mcp/tools/serverProvision.d.ts +31 -0
- package/dist/mcp/tools/serverProvision.d.ts.map +1 -0
- package/dist/mcp/tools/serverProvision.js +125 -0
- package/dist/mcp/tools/serverProvision.js.map +1 -0
- package/dist/mcp/tools/serverSecure.d.ts +40 -0
- package/dist/mcp/tools/serverSecure.d.ts.map +1 -0
- package/dist/mcp/tools/serverSecure.js +396 -0
- package/dist/mcp/tools/serverSecure.js.map +1 -0
- package/dist/providers/vultr.d.ts.map +1 -1
- package/dist/providers/vultr.js +7 -1
- package/dist/providers/vultr.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/errorMapper.d.ts +4 -0
- package/dist/utils/errorMapper.d.ts.map +1 -1
- package/dist/utils/errorMapper.js +93 -0
- package/dist/utils/errorMapper.js.map +1 -1
- package/dist/utils/openBrowser.d.ts.map +1 -1
- package/dist/utils/openBrowser.js +6 -1
- package/dist/utils/openBrowser.js.map +1 -1
- package/dist/utils/ssh.d.ts +1 -0
- package/dist/utils/ssh.d.ts.map +1 -1
- package/dist/utils/ssh.js +6 -2
- package/dist/utils/ssh.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { isSafeMode } from "../../core/manage.js";
|
|
3
|
+
import { provisionServer } from "../../core/provision.js";
|
|
4
|
+
import { getErrorMessage } from "../../utils/errorMapper.js";
|
|
5
|
+
// ─── Schema ──────────────────────────────────────────────────────────────────
|
|
6
|
+
export const serverProvisionSchema = {
|
|
7
|
+
provider: z
|
|
8
|
+
.enum(["hetzner", "digitalocean", "vultr", "linode"])
|
|
9
|
+
.describe("Cloud provider to create server on"),
|
|
10
|
+
region: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Region/location ID (e.g. 'nbg1' for Hetzner, 'fra1' for DigitalOcean, 'ewr' for Vultr, 'us-east' for Linode). Uses template defaults if omitted"),
|
|
14
|
+
size: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Server type/plan ID (e.g. 'cax11' for Hetzner, 's-2vcpu-2gb' for DigitalOcean). Uses template defaults if omitted"),
|
|
18
|
+
name: z
|
|
19
|
+
.string()
|
|
20
|
+
.describe("Server hostname, 3-63 chars, lowercase, starts with letter, only alphanumeric and hyphens, ends with letter or number"),
|
|
21
|
+
template: z
|
|
22
|
+
.enum(["starter", "production", "dev"])
|
|
23
|
+
.default("starter")
|
|
24
|
+
.describe("Template for default region/size. 'starter' = cheapest, 'production' = more resources, 'dev' = development. Explicit region/size override template defaults. Default: starter"),
|
|
25
|
+
};
|
|
26
|
+
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
27
|
+
export async function handleServerProvision(params) {
|
|
28
|
+
// SAFE_MODE guard
|
|
29
|
+
if (isSafeMode()) {
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: JSON.stringify({
|
|
35
|
+
error: "Provision is disabled in SAFE_MODE",
|
|
36
|
+
hint: "Set QUICKLIFY_SAFE_MODE=false to enable server provisioning. WARNING: This creates billable cloud resources.",
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const result = await provisionServer({
|
|
45
|
+
provider: params.provider,
|
|
46
|
+
region: params.region,
|
|
47
|
+
size: params.size,
|
|
48
|
+
name: params.name,
|
|
49
|
+
template: params.template,
|
|
50
|
+
});
|
|
51
|
+
if (!result.success) {
|
|
52
|
+
return {
|
|
53
|
+
content: [
|
|
54
|
+
{
|
|
55
|
+
type: "text",
|
|
56
|
+
text: JSON.stringify({
|
|
57
|
+
error: result.error,
|
|
58
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
59
|
+
suggested_actions: [
|
|
60
|
+
{
|
|
61
|
+
command: "server_info { action: 'list' }",
|
|
62
|
+
reason: "Check existing servers",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
}),
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
isError: true,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (!result.server) {
|
|
72
|
+
return {
|
|
73
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Unexpected: server record missing" }) }],
|
|
74
|
+
isError: true,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const server = result.server;
|
|
78
|
+
return {
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: JSON.stringify({
|
|
83
|
+
success: true,
|
|
84
|
+
message: `Server "${server.name}" provisioned on ${server.provider}`,
|
|
85
|
+
server: {
|
|
86
|
+
id: server.id,
|
|
87
|
+
name: server.name,
|
|
88
|
+
provider: server.provider,
|
|
89
|
+
ip: server.ip,
|
|
90
|
+
region: server.region,
|
|
91
|
+
size: server.size,
|
|
92
|
+
createdAt: server.createdAt,
|
|
93
|
+
},
|
|
94
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
95
|
+
suggested_actions: [
|
|
96
|
+
{
|
|
97
|
+
command: `server_info { action: 'health', server: '${server.name}' }`,
|
|
98
|
+
reason: "Check Coolify health (wait 3-5 minutes after creation for Coolify to initialize)",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
command: `server_secure { action: 'secure-setup', server: '${server.name}' }`,
|
|
102
|
+
reason: "Harden SSH security + install fail2ban",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
command: `server_secure { action: 'firewall-setup', server: '${server.name}' }`,
|
|
106
|
+
reason: "Setup UFW firewall with Coolify ports",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
command: `server_info { action: 'status', server: '${server.name}' }`,
|
|
110
|
+
reason: "Check cloud provider status",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
}),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
return {
|
|
120
|
+
content: [{ type: "text", text: JSON.stringify({ error: getErrorMessage(error) }) }],
|
|
121
|
+
isError: true,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=serverProvision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverProvision.js","sourceRoot":"","sources":["../../../src/mcp/tools/serverProvision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,gFAAgF;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SACpD,QAAQ,CAAC,oCAAoC,CAAC;IACjD,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,iJAAiJ,CAClJ;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,mHAAmH,CACpH;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CACP,uHAAuH,CACxH;IACH,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;SACtC,OAAO,CAAC,SAAS,CAAC;SAClB,QAAQ,CACP,+KAA+K,CAChL;CACJ,CAAC;AAEF,gFAAgF;AAEhF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAM3C;IACC,kBAAkB;IAClB,IAAI,UAAU,EAAE,EAAE,CAAC;QACjB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE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AC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const serverSecureSchema: {
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
"secure-setup": "secure-setup";
|
|
5
|
+
"secure-audit": "secure-audit";
|
|
6
|
+
"firewall-setup": "firewall-setup";
|
|
7
|
+
"firewall-add": "firewall-add";
|
|
8
|
+
"firewall-remove": "firewall-remove";
|
|
9
|
+
"firewall-status": "firewall-status";
|
|
10
|
+
"domain-set": "domain-set";
|
|
11
|
+
"domain-remove": "domain-remove";
|
|
12
|
+
"domain-check": "domain-check";
|
|
13
|
+
"domain-info": "domain-info";
|
|
14
|
+
}>;
|
|
15
|
+
server: z.ZodOptional<z.ZodString>;
|
|
16
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
protocol: z.ZodDefault<z.ZodEnum<{
|
|
18
|
+
tcp: "tcp";
|
|
19
|
+
udp: "udp";
|
|
20
|
+
}>>;
|
|
21
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
22
|
+
ssl: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
};
|
|
24
|
+
type Action = z.infer<typeof serverSecureSchema.action>;
|
|
25
|
+
export declare function handleServerSecure(params: {
|
|
26
|
+
action: Action;
|
|
27
|
+
server?: string;
|
|
28
|
+
port?: number;
|
|
29
|
+
protocol?: "tcp" | "udp";
|
|
30
|
+
domain?: string;
|
|
31
|
+
ssl?: boolean;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
content: Array<{
|
|
34
|
+
type: "text";
|
|
35
|
+
text: string;
|
|
36
|
+
}>;
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=serverSecure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSecure.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/serverSecure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAuB9B,CAAC;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAYxD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAoZjF"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getServers, findServer } from "../../utils/config.js";
|
|
3
|
+
import { applySecureSetup, runSecureAudit, } from "../../core/secure.js";
|
|
4
|
+
import { setupFirewall, addFirewallRule, removeFirewallRule, getFirewallStatus, COOLIFY_PORTS, } from "../../core/firewall.js";
|
|
5
|
+
import { setDomain, removeDomain, getDomain, checkDns, } from "../../core/domain.js";
|
|
6
|
+
import { getErrorMessage } from "../../utils/errorMapper.js";
|
|
7
|
+
export const serverSecureSchema = {
|
|
8
|
+
action: z.enum([
|
|
9
|
+
"secure-setup", "secure-audit",
|
|
10
|
+
"firewall-setup", "firewall-add", "firewall-remove", "firewall-status",
|
|
11
|
+
"domain-set", "domain-remove", "domain-check", "domain-info",
|
|
12
|
+
]).describe("Action: Secure: 'secure-setup' hardens SSH + installs fail2ban, 'secure-audit' runs security audit with score. Firewall: 'firewall-setup' installs UFW, 'firewall-add'/'firewall-remove' manage port rules, 'firewall-status' shows rules. Domain: 'domain-set'/'domain-remove' manage FQDN, 'domain-check' verifies DNS, 'domain-info' shows current FQDN."),
|
|
13
|
+
server: z.string().optional().describe("Server name or IP. Auto-selected if only one server exists."),
|
|
14
|
+
port: z.number().min(1).max(65535).optional().describe("Port number. Required for firewall-add/remove. Optional SSH port for secure-setup."),
|
|
15
|
+
protocol: z.enum(["tcp", "udp"]).default("tcp").describe("Protocol for firewall rules. Default: tcp."),
|
|
16
|
+
domain: z.string().optional().describe("Domain name. Required for domain-set and domain-check."),
|
|
17
|
+
ssl: z.boolean().default(true).describe("Enable SSL (https) for domain. Default: true."),
|
|
18
|
+
};
|
|
19
|
+
function resolveServer(params, servers) {
|
|
20
|
+
if (params.server) {
|
|
21
|
+
return findServer(params.server);
|
|
22
|
+
}
|
|
23
|
+
if (servers.length === 1) {
|
|
24
|
+
return servers[0];
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
export async function handleServerSecure(params) {
|
|
29
|
+
try {
|
|
30
|
+
const servers = getServers();
|
|
31
|
+
if (servers.length === 0) {
|
|
32
|
+
return {
|
|
33
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
34
|
+
error: "No servers found",
|
|
35
|
+
suggested_actions: [{ command: "quicklify init", reason: "Deploy a server first" }],
|
|
36
|
+
}) }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const server = resolveServer(params, servers);
|
|
41
|
+
if (!server) {
|
|
42
|
+
if (params.server) {
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
45
|
+
error: `Server not found: ${params.server}`,
|
|
46
|
+
available_servers: servers.map((s) => s.name),
|
|
47
|
+
}) }],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
53
|
+
error: "Multiple servers found. Specify which server to use.",
|
|
54
|
+
available_servers: servers.map((s) => ({ name: s.name, ip: s.ip })),
|
|
55
|
+
}) }],
|
|
56
|
+
isError: true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
switch (params.action) {
|
|
60
|
+
case "secure-setup": {
|
|
61
|
+
const result = await applySecureSetup(server.ip, params.port ? { port: params.port } : undefined);
|
|
62
|
+
if (!result.success) {
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
65
|
+
server: server.name,
|
|
66
|
+
ip: server.ip,
|
|
67
|
+
error: result.error,
|
|
68
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
69
|
+
suggested_actions: [
|
|
70
|
+
{ command: `server_info { action: 'health', server: '${server.name}' }`, reason: "Check if server is reachable" },
|
|
71
|
+
],
|
|
72
|
+
}) }],
|
|
73
|
+
isError: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const message = result.fail2ban
|
|
77
|
+
? "Security setup complete: SSH hardened + fail2ban active"
|
|
78
|
+
: "Security setup partially complete: SSH hardened, fail2ban failed";
|
|
79
|
+
return {
|
|
80
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
81
|
+
success: true,
|
|
82
|
+
server: server.name,
|
|
83
|
+
ip: server.ip,
|
|
84
|
+
message,
|
|
85
|
+
sshHardening: result.sshHardening,
|
|
86
|
+
fail2ban: result.fail2ban,
|
|
87
|
+
sshKeyCount: result.sshKeyCount,
|
|
88
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
89
|
+
suggested_actions: [
|
|
90
|
+
{ command: `server_secure { action: 'secure-audit', server: '${server.name}' }`, reason: "Verify security configuration" },
|
|
91
|
+
],
|
|
92
|
+
}) }],
|
|
93
|
+
...(!result.fail2ban ? { isError: true } : {}),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
case "secure-audit": {
|
|
97
|
+
const result = await runSecureAudit(server.ip);
|
|
98
|
+
if (result.error) {
|
|
99
|
+
return {
|
|
100
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
101
|
+
server: server.name,
|
|
102
|
+
ip: server.ip,
|
|
103
|
+
error: result.error,
|
|
104
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
105
|
+
}) }],
|
|
106
|
+
isError: true,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const suggestedActions = result.score < 100
|
|
110
|
+
? [{ command: `server_secure { action: 'secure-setup', server: '${server.name}' }`, reason: "Improve security score" }]
|
|
111
|
+
: [{ command: `server_secure { action: 'firewall-status', server: '${server.name}' }`, reason: "Check firewall configuration" }];
|
|
112
|
+
return {
|
|
113
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
114
|
+
server: server.name,
|
|
115
|
+
ip: server.ip,
|
|
116
|
+
score: result.score,
|
|
117
|
+
maxScore: 100,
|
|
118
|
+
checks: {
|
|
119
|
+
passwordAuth: result.audit.passwordAuth,
|
|
120
|
+
rootLogin: result.audit.rootLogin,
|
|
121
|
+
fail2ban: result.audit.fail2ban,
|
|
122
|
+
sshPort: result.audit.sshPort,
|
|
123
|
+
},
|
|
124
|
+
suggested_actions: suggestedActions,
|
|
125
|
+
}) }],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
case "firewall-setup": {
|
|
129
|
+
const result = await setupFirewall(server.ip);
|
|
130
|
+
if (!result.success) {
|
|
131
|
+
return {
|
|
132
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
133
|
+
server: server.name,
|
|
134
|
+
ip: server.ip,
|
|
135
|
+
error: result.error,
|
|
136
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
137
|
+
}) }],
|
|
138
|
+
isError: true,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
143
|
+
success: true,
|
|
144
|
+
server: server.name,
|
|
145
|
+
ip: server.ip,
|
|
146
|
+
message: `UFW enabled with Coolify ports (${COOLIFY_PORTS.join(", ")}) + SSH (22)`,
|
|
147
|
+
suggested_actions: [
|
|
148
|
+
{ command: `server_secure { action: 'firewall-status', server: '${server.name}' }`, reason: "Verify firewall rules" },
|
|
149
|
+
],
|
|
150
|
+
}) }],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
case "firewall-add": {
|
|
154
|
+
if (params.port === undefined) {
|
|
155
|
+
return {
|
|
156
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
157
|
+
error: "Port is required for firewall-add action",
|
|
158
|
+
hint: "Specify a port number (1-65535)",
|
|
159
|
+
}) }],
|
|
160
|
+
isError: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const result = await addFirewallRule(server.ip, params.port, params.protocol || "tcp");
|
|
164
|
+
if (!result.success) {
|
|
165
|
+
return {
|
|
166
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
167
|
+
server: server.name,
|
|
168
|
+
ip: server.ip,
|
|
169
|
+
error: result.error,
|
|
170
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
171
|
+
}) }],
|
|
172
|
+
isError: true,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
177
|
+
success: true,
|
|
178
|
+
server: server.name,
|
|
179
|
+
ip: server.ip,
|
|
180
|
+
message: `Port ${params.port}/${params.protocol || "tcp"} opened`,
|
|
181
|
+
suggested_actions: [
|
|
182
|
+
{ command: `server_secure { action: 'firewall-status', server: '${server.name}' }`, reason: "Verify firewall rules" },
|
|
183
|
+
],
|
|
184
|
+
}) }],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
case "firewall-remove": {
|
|
188
|
+
if (params.port === undefined) {
|
|
189
|
+
return {
|
|
190
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
191
|
+
error: "Port is required for firewall-remove action",
|
|
192
|
+
hint: "Specify a port number (1-65535)",
|
|
193
|
+
}) }],
|
|
194
|
+
isError: true,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const result = await removeFirewallRule(server.ip, params.port, params.protocol || "tcp");
|
|
198
|
+
if (!result.success) {
|
|
199
|
+
return {
|
|
200
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
201
|
+
server: server.name,
|
|
202
|
+
ip: server.ip,
|
|
203
|
+
error: result.error,
|
|
204
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
205
|
+
...(result.warning ? { warning: result.warning } : {}),
|
|
206
|
+
}) }],
|
|
207
|
+
isError: true,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
212
|
+
success: true,
|
|
213
|
+
server: server.name,
|
|
214
|
+
ip: server.ip,
|
|
215
|
+
message: `Port ${params.port}/${params.protocol || "tcp"} closed`,
|
|
216
|
+
...(result.warning ? { warning: result.warning } : {}),
|
|
217
|
+
suggested_actions: [
|
|
218
|
+
{ command: `server_secure { action: 'firewall-status', server: '${server.name}' }`, reason: "Verify firewall rules" },
|
|
219
|
+
],
|
|
220
|
+
}) }],
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
case "firewall-status": {
|
|
224
|
+
const result = await getFirewallStatus(server.ip);
|
|
225
|
+
if (result.error) {
|
|
226
|
+
return {
|
|
227
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
228
|
+
server: server.name,
|
|
229
|
+
ip: server.ip,
|
|
230
|
+
error: result.error,
|
|
231
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
232
|
+
}) }],
|
|
233
|
+
isError: true,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
const suggestedActions = !result.status.active
|
|
237
|
+
? [{ command: `server_secure { action: 'firewall-setup', server: '${server.name}' }`, reason: "Enable firewall" }]
|
|
238
|
+
: [{ command: `server_secure { action: 'firewall-add', server: '${server.name}', port: 3000 }`, reason: "Open additional ports if needed" }];
|
|
239
|
+
return {
|
|
240
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
241
|
+
server: server.name,
|
|
242
|
+
ip: server.ip,
|
|
243
|
+
active: result.status.active,
|
|
244
|
+
rules: result.status.rules,
|
|
245
|
+
ruleCount: result.status.rules.length,
|
|
246
|
+
suggested_actions: suggestedActions,
|
|
247
|
+
}) }],
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
case "domain-set": {
|
|
251
|
+
if (!params.domain) {
|
|
252
|
+
return {
|
|
253
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
254
|
+
error: "Domain is required for domain-set action",
|
|
255
|
+
hint: "Specify a domain name (e.g., coolify.example.com)",
|
|
256
|
+
}) }],
|
|
257
|
+
isError: true,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const result = await setDomain(server.ip, params.domain, params.ssl ?? true);
|
|
261
|
+
if (!result.success) {
|
|
262
|
+
return {
|
|
263
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
264
|
+
server: server.name,
|
|
265
|
+
ip: server.ip,
|
|
266
|
+
error: result.error,
|
|
267
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
268
|
+
}) }],
|
|
269
|
+
isError: true,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
const protocol = (params.ssl ?? true) ? "https" : "http";
|
|
273
|
+
return {
|
|
274
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
275
|
+
success: true,
|
|
276
|
+
server: server.name,
|
|
277
|
+
ip: server.ip,
|
|
278
|
+
message: `Domain set to ${params.domain}`,
|
|
279
|
+
url: `${protocol}://${params.domain}`,
|
|
280
|
+
suggested_actions: [
|
|
281
|
+
{ command: `server_secure { action: 'domain-check', server: '${server.name}', domain: '${params.domain}' }`, reason: "Verify DNS points to this server" },
|
|
282
|
+
{ command: `server_info { action: 'health', server: '${server.name}' }`, reason: "Verify Coolify is accessible" },
|
|
283
|
+
],
|
|
284
|
+
}) }],
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
case "domain-remove": {
|
|
288
|
+
const result = await removeDomain(server.ip);
|
|
289
|
+
if (!result.success) {
|
|
290
|
+
return {
|
|
291
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
292
|
+
server: server.name,
|
|
293
|
+
ip: server.ip,
|
|
294
|
+
error: result.error,
|
|
295
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
296
|
+
}) }],
|
|
297
|
+
isError: true,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
302
|
+
success: true,
|
|
303
|
+
server: server.name,
|
|
304
|
+
ip: server.ip,
|
|
305
|
+
message: "Domain removed. Coolify reset to default.",
|
|
306
|
+
url: `http://${server.ip}:8000`,
|
|
307
|
+
suggested_actions: [
|
|
308
|
+
{ command: `server_info { action: 'health', server: '${server.name}' }`, reason: "Verify Coolify is accessible" },
|
|
309
|
+
],
|
|
310
|
+
}) }],
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
case "domain-check": {
|
|
314
|
+
if (!params.domain) {
|
|
315
|
+
return {
|
|
316
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
317
|
+
error: "Domain is required for domain-check action",
|
|
318
|
+
hint: "Specify a domain name to check DNS for",
|
|
319
|
+
}) }],
|
|
320
|
+
isError: true,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
const result = await checkDns(server.ip, params.domain);
|
|
324
|
+
if (result.error) {
|
|
325
|
+
return {
|
|
326
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
327
|
+
server: server.name,
|
|
328
|
+
ip: server.ip,
|
|
329
|
+
domain: params.domain,
|
|
330
|
+
error: result.error,
|
|
331
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
332
|
+
}) }],
|
|
333
|
+
isError: true,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
338
|
+
server: server.name,
|
|
339
|
+
ip: server.ip,
|
|
340
|
+
domain: params.domain,
|
|
341
|
+
resolvedIp: result.resolvedIp,
|
|
342
|
+
match: result.match,
|
|
343
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
344
|
+
suggested_actions: result.match
|
|
345
|
+
? [{ command: `server_secure { action: 'domain-set', server: '${server.name}', domain: '${params.domain}' }`, reason: "Set this domain as Coolify FQDN" }]
|
|
346
|
+
: [{ command: `server_secure { action: 'domain-info', server: '${server.name}' }`, reason: "Check current domain setting" }],
|
|
347
|
+
}) }],
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
case "domain-info": {
|
|
351
|
+
const result = await getDomain(server.ip);
|
|
352
|
+
if (result.error) {
|
|
353
|
+
return {
|
|
354
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
355
|
+
server: server.name,
|
|
356
|
+
ip: server.ip,
|
|
357
|
+
error: result.error,
|
|
358
|
+
...(result.hint ? { hint: result.hint } : {}),
|
|
359
|
+
}) }],
|
|
360
|
+
isError: true,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
const domainSuggestedActions = [];
|
|
364
|
+
if (result.fqdn) {
|
|
365
|
+
const cleanFqdn = result.fqdn.replace(/^https?:\/\//, "");
|
|
366
|
+
domainSuggestedActions.push({
|
|
367
|
+
command: `server_secure { action: 'domain-check', server: '${server.name}', domain: '${cleanFqdn}' }`,
|
|
368
|
+
reason: "Verify DNS",
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
domainSuggestedActions.push({
|
|
373
|
+
command: `server_secure { action: 'domain-set', server: '${server.name}', domain: 'coolify.example.com' }`,
|
|
374
|
+
reason: "Set a custom domain",
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
return {
|
|
378
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
379
|
+
server: server.name,
|
|
380
|
+
ip: server.ip,
|
|
381
|
+
fqdn: result.fqdn,
|
|
382
|
+
message: result.fqdn ? `Current domain: ${result.fqdn}` : `No custom domain set. Default: http://${server.ip}:8000`,
|
|
383
|
+
suggested_actions: domainSuggestedActions,
|
|
384
|
+
}) }],
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
return {
|
|
391
|
+
content: [{ type: "text", text: JSON.stringify({ error: getErrorMessage(error) }) }],
|
|
392
|
+
isError: true,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=serverSecure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSecure.js","sourceRoot":"","sources":["../../../src/mcp/tools/serverSecure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC;QACb,cAAc,EAAE,cAAc;QAC9B,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB;QACtE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa;KAC7D,CAAC,CAAC,QAAQ,CACT,6VAA6V,CAC9V;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpC,6DAA6D,CAC9D;IACD,IAA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C,MAAM,EAAE,CAAC;IAkB1C,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IA6BhE,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCrE,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAkCxD,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBjD,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAqBjE"}
|
package/dist/providers/vultr.js
CHANGED
|
@@ -106,7 +106,13 @@ export class VultrProvider {
|
|
|
106
106
|
const response = await axios.get(`${this.baseUrl}/instances/${serverId}`, {
|
|
107
107
|
headers: { Authorization: `Bearer ${this.apiToken}` },
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
const inst = response.data.instance;
|
|
110
|
+
// Vultr reports power_status=running before server is fully provisioned.
|
|
111
|
+
// server_status progresses: none → locked → installingbooting → ok
|
|
112
|
+
if (inst.power_status === "running" && inst.server_status != null && inst.server_status !== "ok") {
|
|
113
|
+
return "provisioning";
|
|
114
|
+
}
|
|
115
|
+
return inst.power_status;
|
|
110
116
|
}
|
|
111
117
|
catch (error) {
|
|
112
118
|
stripSensitiveData(error);
|