@tmhs/homelab-mcp 0.17.1 → 0.17.2
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
CHANGED
|
@@ -56,7 +56,7 @@ import { registerResources } from "./resources.js";
|
|
|
56
56
|
import { registerPrompts } from "./prompts.js";
|
|
57
57
|
const server = new McpServer({
|
|
58
58
|
name: "homelab-mcp",
|
|
59
|
-
version: "0.17.
|
|
59
|
+
version: "0.17.2",
|
|
60
60
|
});
|
|
61
61
|
registerPiStatus(server);
|
|
62
62
|
registerPiReboot(server);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceHealth.d.ts","sourceRoot":"","sources":["../../src/tools/serviceHealth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"serviceHealth.d.ts","sourceRoot":"","sources":["../../src/tools/serviceHealth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmBzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2ChD"}
|
|
@@ -8,18 +8,33 @@ const inputSchema = {
|
|
|
8
8
|
.optional()
|
|
9
9
|
.describe("Specific container name to check, or omit for all"),
|
|
10
10
|
};
|
|
11
|
+
const containerSchema = z.object({
|
|
12
|
+
Names: z.string(),
|
|
13
|
+
State: z.string(),
|
|
14
|
+
Status: z.string(),
|
|
15
|
+
Ports: z.string(),
|
|
16
|
+
});
|
|
11
17
|
export function register(server) {
|
|
12
18
|
server.tool("homelab_serviceHealth", "Check Docker container health status on the Pi", inputSchema, async (args) => {
|
|
13
19
|
try {
|
|
14
|
-
const filter = args.service ? `--filter
|
|
15
|
-
const ps = await execSSH(`docker ps ${filter} --format
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const filter = args.service ? `--filter 'name=${args.service.replace(/'/g, "'\\''")}'` : "";
|
|
21
|
+
const ps = await execSSH(`docker ps -a ${filter} --format '{{json .}}'`, args.node);
|
|
22
|
+
if (ps.startsWith("[dry-run]")) {
|
|
23
|
+
return { content: [{ type: "text", text: ps }] };
|
|
24
|
+
}
|
|
25
|
+
const containers = ps.trim() ? ps.trim().split("\n").map((line) => containerSchema.parse(JSON.parse(line))) : [];
|
|
26
|
+
if (containers.length === 0) {
|
|
27
|
+
const text = args.service ? `No containers matched "${args.service}".` : "No containers found.";
|
|
28
|
+
return { content: [{ type: "text", text }] };
|
|
29
|
+
}
|
|
30
|
+
// Use one snapshot so the table and its summary describe the same set.
|
|
31
|
+
const problems = containers.filter((c) => c.State !== "running" || /\((unhealthy|health: starting)\)/.test(c.Status));
|
|
32
|
+
let text = ["NAMES\tSTATUS\tPORTS", ...containers.map((c) => `${c.Names}\t${c.Status}\t${c.Ports}`)].join("\n");
|
|
33
|
+
if (problems.length > 0) {
|
|
34
|
+
text += `\n\nContainers needing attention: ${problems.map((c) => c.Names).join(", ")}`;
|
|
20
35
|
}
|
|
21
36
|
else {
|
|
22
|
-
text += "\n\
|
|
37
|
+
text += "\n\nNo container problems detected.";
|
|
23
38
|
}
|
|
24
39
|
return { content: [{ type: "text", text }] };
|
|
25
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceHealth.js","sourceRoot":"","sources":["../../src/tools/serviceHealth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,GAAG;IAClB,GAAG,SAAS;IACZ,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mDAAmD,CAAC;CACjE,CAAC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IAAI,CAAC,IAAI,CAAC,CAAC;YACd,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,IAAI,IAAI,qCAAqC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACzF,CAAC;iBAAM,CAAC;gBACN,IAAI,IAAI,qCAAqC,CAAC;YAChD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmhs/homelab-mcp",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "MCP server for home lab operations via SSH - 51 tools for system status, Docker Compose management, service health, monitoring, DNS, reverse proxy, networking, backups, disaster recovery, security auditing, logs, notifications, OS management, certificates, multi-node, diagnostics, and administration on a Raspberry Pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|