@moor-sh/mcp 0.5.1 → 0.6.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/package.json +1 -1
- package/src/index.ts +54 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -572,6 +572,21 @@ server.registerTool(
|
|
|
572
572
|
.enum(["no", "on-failure", "always", "unless-stopped"])
|
|
573
573
|
.optional()
|
|
574
574
|
.describe("Docker restart policy (default: unless-stopped)"),
|
|
575
|
+
memory_limit_mb: z
|
|
576
|
+
.number()
|
|
577
|
+
.int()
|
|
578
|
+
.min(6)
|
|
579
|
+
.optional()
|
|
580
|
+
.describe(
|
|
581
|
+
"Max RAM in MB (also caps swap to the same value so the container can't burn through host swap). Min 6 (Docker's floor), max host total memory. Omit for unbounded. Takes effect on container recreate (next moor_rebuild / moor_restart / moor_deploy / moor_project run).",
|
|
582
|
+
),
|
|
583
|
+
cpus: z
|
|
584
|
+
.number()
|
|
585
|
+
.positive()
|
|
586
|
+
.optional()
|
|
587
|
+
.describe(
|
|
588
|
+
"Max CPU cores. Fractional values OK (e.g. 0.5 = half a core). Min 0.001 (anything smaller rounds to Docker NanoCpus=0, which means unlimited — use omit for that). Max host core count. Takes effect on container recreate.",
|
|
589
|
+
),
|
|
575
590
|
}),
|
|
576
591
|
},
|
|
577
592
|
async (input) => {
|
|
@@ -593,7 +608,7 @@ server.registerTool(
|
|
|
593
608
|
{
|
|
594
609
|
title: "Update Project",
|
|
595
610
|
description:
|
|
596
|
-
"Updates project metadata. Does NOT rebuild or restart the container. Domain or domain_port changes apply to Caddy immediately.",
|
|
611
|
+
"Updates project metadata. Does NOT rebuild or restart the container. Domain or domain_port changes apply to Caddy immediately. Resource-limit changes (memory_limit_mb, cpus) take effect on the next container recreate (moor_rebuild / moor_restart / moor_deploy / moor_project run) — an already-running container keeps its existing limits.",
|
|
597
612
|
inputSchema: z.object({
|
|
598
613
|
project: z.string().describe("Project name or ID to update"),
|
|
599
614
|
name: z
|
|
@@ -610,6 +625,23 @@ server.registerTool(
|
|
|
610
625
|
domain: z.string().optional(),
|
|
611
626
|
domain_port: z.number().int().positive().optional(),
|
|
612
627
|
restart_policy: z.enum(["no", "on-failure", "always", "unless-stopped"]).optional(),
|
|
628
|
+
memory_limit_mb: z
|
|
629
|
+
.number()
|
|
630
|
+
.int()
|
|
631
|
+
.min(6)
|
|
632
|
+
.nullable()
|
|
633
|
+
.optional()
|
|
634
|
+
.describe(
|
|
635
|
+
"Max RAM in MB. Pass null to clear (return to unbounded). Min 6, max host total memory. Takes effect on container recreate.",
|
|
636
|
+
),
|
|
637
|
+
cpus: z
|
|
638
|
+
.number()
|
|
639
|
+
.positive()
|
|
640
|
+
.nullable()
|
|
641
|
+
.optional()
|
|
642
|
+
.describe(
|
|
643
|
+
"Max CPU cores (fractional OK; min 0.001). Pass null to clear. Max host core count. Takes effect on container recreate.",
|
|
644
|
+
),
|
|
613
645
|
}),
|
|
614
646
|
},
|
|
615
647
|
async (input) => {
|
|
@@ -888,6 +920,23 @@ server.registerTool(
|
|
|
888
920
|
.enum(["no", "on-failure", "always", "unless-stopped"])
|
|
889
921
|
.optional()
|
|
890
922
|
.describe("Docker restart policy (API default: unless-stopped)"),
|
|
923
|
+
memory_limit_mb: z
|
|
924
|
+
.number()
|
|
925
|
+
.int()
|
|
926
|
+
.min(6)
|
|
927
|
+
.nullable()
|
|
928
|
+
.optional()
|
|
929
|
+
.describe(
|
|
930
|
+
"Max RAM in MB (also caps swap to the same value). Min 6, max host total memory. Pass null on update to clear. Limits apply on container recreate, which deploy always does when run: true.",
|
|
931
|
+
),
|
|
932
|
+
cpus: z
|
|
933
|
+
.number()
|
|
934
|
+
.positive()
|
|
935
|
+
.nullable()
|
|
936
|
+
.optional()
|
|
937
|
+
.describe(
|
|
938
|
+
"Max CPU cores. Fractional OK (e.g. 0.5; min 0.001). Max host core count. Pass null on update to clear.",
|
|
939
|
+
),
|
|
891
940
|
env: z
|
|
892
941
|
.record(z.string(), z.string())
|
|
893
942
|
.optional()
|
|
@@ -965,6 +1014,8 @@ server.registerTool(
|
|
|
965
1014
|
domain: normalizedDomain,
|
|
966
1015
|
domain_port: input.domain_port,
|
|
967
1016
|
restart_policy: input.restart_policy,
|
|
1017
|
+
memory_limit_mb: input.memory_limit_mb,
|
|
1018
|
+
cpus: input.cpus,
|
|
968
1019
|
};
|
|
969
1020
|
const res = await apiPost("/api/projects", createBody);
|
|
970
1021
|
if (!res.ok) throw new Error(`[create] ${await res.text()}`);
|
|
@@ -982,6 +1033,8 @@ server.registerTool(
|
|
|
982
1033
|
if (normalizedDomain !== undefined) updateBody.domain = normalizedDomain;
|
|
983
1034
|
if (input.domain_port !== undefined) updateBody.domain_port = input.domain_port;
|
|
984
1035
|
if (input.restart_policy !== undefined) updateBody.restart_policy = input.restart_policy;
|
|
1036
|
+
if (input.memory_limit_mb !== undefined) updateBody.memory_limit_mb = input.memory_limit_mb;
|
|
1037
|
+
if (input.cpus !== undefined) updateBody.cpus = input.cpus;
|
|
985
1038
|
|
|
986
1039
|
if (Object.keys(updateBody).length > 0) {
|
|
987
1040
|
const res = await apiPut(`/api/projects/${existing.id}`, updateBody);
|