@moor-sh/mcp 0.24.0 → 0.26.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 +9 -6
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -574,7 +574,7 @@ server.registerTool(
|
|
|
574
574
|
{
|
|
575
575
|
title: "Server Stats",
|
|
576
576
|
description:
|
|
577
|
-
"Get server resource usage: load, memory,
|
|
577
|
+
"Get server resource usage: load, memory, per-filesystem disk usage (the filesystems the moor container can see, plus any operator-configured monitored host disks via MOOR_MONITORED_DISKS), Docker disk by category (images/containers/volumes/build cache) with reclaimable bytes, and container counts. Note: cpu.percent is load-derived (load avg ÷ cores), not instantaneous CPU; use the `load` field for the same signal with explicit naming.",
|
|
578
578
|
},
|
|
579
579
|
async () => {
|
|
580
580
|
const res = await apiGet("/api/server/stats");
|
|
@@ -587,6 +587,7 @@ server.registerTool(
|
|
|
587
587
|
load?: { one_min: number; cores: number; normalized_percent: number };
|
|
588
588
|
memory: { total: string; used: string; percent: number };
|
|
589
589
|
disk: { total: string; used: string; percent: number };
|
|
590
|
+
disks?: { mount: string; total: string; used: string; percent: number; label?: string }[];
|
|
590
591
|
containers: { running: number; total: number };
|
|
591
592
|
docker?: {
|
|
592
593
|
images: { bytes: number; reclaimable_bytes: number; count: number; unused_count: number };
|
|
@@ -611,11 +612,13 @@ server.registerTool(
|
|
|
611
612
|
`Load (1m): ${s.load.one_min.toFixed(2)} on ${s.load.cores} cores (${s.load.normalized_percent}%)`,
|
|
612
613
|
);
|
|
613
614
|
}
|
|
614
|
-
lines.push(
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
lines.push(`Memory: ${s.memory.used} / ${s.memory.total} (${s.memory.percent}%)`);
|
|
616
|
+
const disks = s.disks?.length ? s.disks : [{ mount: "/", ...s.disk }];
|
|
617
|
+
for (const d of disks) {
|
|
618
|
+
const name = d.label ? `${d.label} (${d.mount})` : `Disk ${d.mount}`;
|
|
619
|
+
lines.push(`${name}: ${d.used} / ${d.total} (${d.percent}%)`);
|
|
620
|
+
}
|
|
621
|
+
lines.push(`Containers: ${s.containers.running} running / ${s.containers.total} total`);
|
|
619
622
|
if (s.docker) {
|
|
620
623
|
const d = s.docker;
|
|
621
624
|
lines.push(
|