homebutler-mcp 0.7.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/LICENSE +21 -0
- package/README.md +63 -0
- package/install.js +133 -0
- package/package.json +31 -0
- package/run.js +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanghee Son (Higangssh)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# homebutler-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for homelab management. Manage servers, Docker containers, ports, alerts, and more — from any AI tool.
|
|
4
|
+
|
|
5
|
+
This is an npm wrapper for [homebutler](https://github.com/Higangssh/homebutler). It downloads the correct binary for your platform automatically.
|
|
6
|
+
|
|
7
|
+
## Quick Setup
|
|
8
|
+
|
|
9
|
+
Add to your MCP client config (Claude Code, Cursor, Claude Desktop, ChatGPT Desktop):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"homebutler": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "homebutler-mcp"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
That's it. No manual installation needed.
|
|
23
|
+
|
|
24
|
+
## Try Without Real Servers
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"homebutler": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "homebutler-mcp", "--demo"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Demo mode returns realistic fake data — perfect for trying it out.
|
|
38
|
+
|
|
39
|
+
## Available Tools
|
|
40
|
+
|
|
41
|
+
| Tool | Description |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `system_status` | CPU, memory, disk, uptime |
|
|
44
|
+
| `docker_list` | List containers |
|
|
45
|
+
| `docker_restart` | Restart a container |
|
|
46
|
+
| `docker_stop` | Stop a container |
|
|
47
|
+
| `docker_logs` | Container log output |
|
|
48
|
+
| `wake` | Wake-on-LAN magic packet |
|
|
49
|
+
| `open_ports` | Open ports with process info |
|
|
50
|
+
| `network_scan` | Discover LAN devices |
|
|
51
|
+
| `alerts` | Resource threshold alerts |
|
|
52
|
+
|
|
53
|
+
All tools support an optional `server` parameter for multi-server management via SSH.
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- [GitHub](https://github.com/Higangssh/homebutler)
|
|
58
|
+
- [Full documentation](https://github.com/Higangssh/homebutler#mcp-server)
|
|
59
|
+
- [Report issues](https://github.com/Higangssh/homebutler/issues)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/install.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const https = require("https");
|
|
8
|
+
const { createWriteStream } = require("fs");
|
|
9
|
+
const { pipeline } = require("stream/promises");
|
|
10
|
+
|
|
11
|
+
const REPO = "Higangssh/homebutler";
|
|
12
|
+
const BIN_NAME = process.platform === "win32" ? "homebutler.exe" : "homebutler";
|
|
13
|
+
const BIN_DIR = path.join(__dirname, "bin");
|
|
14
|
+
const BIN_PATH = path.join(BIN_DIR, BIN_NAME);
|
|
15
|
+
|
|
16
|
+
function getPlatform() {
|
|
17
|
+
const platform = process.platform;
|
|
18
|
+
const arch = process.arch;
|
|
19
|
+
|
|
20
|
+
const osMap = { linux: "linux", darwin: "darwin", win32: "windows" };
|
|
21
|
+
const archMap = { x64: "amd64", arm64: "arm64" };
|
|
22
|
+
|
|
23
|
+
const os = osMap[platform];
|
|
24
|
+
const cpu = archMap[arch];
|
|
25
|
+
|
|
26
|
+
if (!os || !cpu) {
|
|
27
|
+
throw new Error(`Unsupported platform: ${platform}/${arch}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return { os, cpu };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getVersion() {
|
|
34
|
+
const pkg = require("./package.json");
|
|
35
|
+
return pkg.version;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function fetch(url) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
https.get(url, { headers: { "User-Agent": "homebutler-mcp" } }, (res) => {
|
|
41
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
42
|
+
return fetch(res.headers.location).then(resolve, reject);
|
|
43
|
+
}
|
|
44
|
+
if (res.statusCode !== 200) {
|
|
45
|
+
return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
|
|
46
|
+
}
|
|
47
|
+
resolve(res);
|
|
48
|
+
}).on("error", reject);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function downloadAndExtract() {
|
|
53
|
+
const { os, cpu } = getPlatform();
|
|
54
|
+
const version = getVersion();
|
|
55
|
+
const tag = `v${version}`;
|
|
56
|
+
|
|
57
|
+
const ext = os === "windows" ? "zip" : "tar.gz";
|
|
58
|
+
const assetName = `homebutler_${version}_${os}_${cpu}.${ext}`;
|
|
59
|
+
const url = `https://github.com/${REPO}/releases/download/${tag}/${assetName}`;
|
|
60
|
+
|
|
61
|
+
console.log(`Downloading homebutler ${tag} for ${os}/${cpu}...`);
|
|
62
|
+
|
|
63
|
+
fs.mkdirSync(BIN_DIR, { recursive: true });
|
|
64
|
+
|
|
65
|
+
const tmpFile = path.join(BIN_DIR, assetName);
|
|
66
|
+
const stream = createWriteStream(tmpFile);
|
|
67
|
+
const res = await fetch(url);
|
|
68
|
+
await pipeline(res, stream);
|
|
69
|
+
|
|
70
|
+
console.log("Extracting...");
|
|
71
|
+
|
|
72
|
+
if (ext === "tar.gz") {
|
|
73
|
+
execSync(`tar -xzf "${tmpFile}" -C "${BIN_DIR}"`, { stdio: "inherit" });
|
|
74
|
+
} else {
|
|
75
|
+
execSync(`unzip -o "${tmpFile}" -d "${BIN_DIR}"`, { stdio: "inherit" });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Find the binary (goreleaser puts it inside a directory or at root)
|
|
79
|
+
if (!fs.existsSync(BIN_PATH)) {
|
|
80
|
+
// Search recursively
|
|
81
|
+
const found = findFile(BIN_DIR, BIN_NAME);
|
|
82
|
+
if (found && found !== BIN_PATH) {
|
|
83
|
+
fs.renameSync(found, BIN_PATH);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!fs.existsSync(BIN_PATH)) {
|
|
88
|
+
throw new Error(`Binary not found after extraction: ${BIN_PATH}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
fs.chmodSync(BIN_PATH, 0o755);
|
|
92
|
+
|
|
93
|
+
// Cleanup archive
|
|
94
|
+
fs.unlinkSync(tmpFile);
|
|
95
|
+
|
|
96
|
+
// Cleanup extracted directories
|
|
97
|
+
for (const entry of fs.readdirSync(BIN_DIR)) {
|
|
98
|
+
const full = path.join(BIN_DIR, entry);
|
|
99
|
+
if (fs.statSync(full).isDirectory()) {
|
|
100
|
+
fs.rmSync(full, { recursive: true });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
console.log(`homebutler ${tag} installed successfully.`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function findFile(dir, name) {
|
|
108
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
109
|
+
const full = path.join(dir, entry.name);
|
|
110
|
+
if (entry.isFile() && entry.name === name) return full;
|
|
111
|
+
if (entry.isDirectory()) {
|
|
112
|
+
const found = findFile(full, name);
|
|
113
|
+
if (found) return found;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Skip if binary already exists and is correct version
|
|
120
|
+
if (fs.existsSync(BIN_PATH)) {
|
|
121
|
+
try {
|
|
122
|
+
const out = execSync(`"${BIN_PATH}" version`, { encoding: "utf8" });
|
|
123
|
+
if (out.includes(getVersion())) {
|
|
124
|
+
console.log(`homebutler ${getVersion()} already installed.`);
|
|
125
|
+
process.exit(0);
|
|
126
|
+
}
|
|
127
|
+
} catch {}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
downloadAndExtract().catch((err) => {
|
|
131
|
+
console.error("Failed to install homebutler:", err.message);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "homebutler-mcp",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "MCP server for homelab management — manage servers, Docker, ports, alerts via AI",
|
|
5
|
+
"keywords": ["mcp", "homelab", "server", "docker", "claude", "ai", "devops", "monitoring"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Higangssh",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Higangssh/homebutler"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Higangssh/homebutler#mcp-server",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Higangssh/homebutler/issues"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"homebutler-mcp": "run.js"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"postinstall": "node install.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"install.js",
|
|
24
|
+
"run.js",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=16"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/run.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const BIN_NAME = process.platform === "win32" ? "homebutler.exe" : "homebutler";
|
|
9
|
+
const BIN_PATH = path.join(__dirname, "bin", BIN_NAME);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(BIN_PATH)) {
|
|
12
|
+
console.error(
|
|
13
|
+
"homebutler binary not found. Run: npm rebuild homebutler-mcp"
|
|
14
|
+
);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const args = ["mcp", ...process.argv.slice(2)];
|
|
19
|
+
|
|
20
|
+
const child = spawn(BIN_PATH, args, {
|
|
21
|
+
stdio: ["inherit", "inherit", "inherit"],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
25
|
+
child.on("error", (err) => {
|
|
26
|
+
console.error("Failed to start homebutler:", err.message);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|