mcp-ssh-manager 3.1.2 → 3.1.4
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/CLAUDE.md +2 -0
- package/README.md +13 -7
- package/package.json +1 -1
- package/src/config-loader.js +4 -0
- package/src/index.js +17 -9
package/CLAUDE.md
CHANGED
|
@@ -153,6 +153,7 @@ SSH_SERVER_[NAME]_KEYPATH=~/.ssh/key # For SSH key auth
|
|
|
153
153
|
SSH_SERVER_[NAME]_PORT=22 # Optional
|
|
154
154
|
SSH_SERVER_[NAME]_DEFAULT_DIR=/path # Optional default working directory
|
|
155
155
|
SSH_SERVER_[NAME]_SUDO_PASSWORD=pass # Optional for automated sudo
|
|
156
|
+
SSH_SERVER_[NAME]_PLATFORM=windows # Optional: "linux" (default) or "windows"
|
|
156
157
|
```
|
|
157
158
|
|
|
158
159
|
### TOML Format
|
|
@@ -165,6 +166,7 @@ key_path = "~/.ssh/key" # For SSH key auth
|
|
|
165
166
|
port = 22 # Optional
|
|
166
167
|
default_dir = "/path" # Optional default working directory
|
|
167
168
|
sudo_password = "pass" # Optional for automated sudo
|
|
169
|
+
platform = "windows" # Optional: "linux" (default) or "windows"
|
|
168
170
|
```
|
|
169
171
|
|
|
170
172
|
## Key Implementation Details
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ A powerful Model Context Protocol (MCP) server that enables **Claude Code** and
|
|
|
12
12
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
13
13
|
[](https://github.com/bvisible/mcp-ssh-manager)
|
|
14
14
|
[](https://modelcontextprotocol.io)
|
|
15
|
-
[](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v3.1.2)
|
|
16
16
|
[](https://claude.ai/code)
|
|
17
17
|
[](https://openai.com/codex)
|
|
18
18
|
[](https://modelcontextprotocol.io)
|
|
@@ -32,9 +32,18 @@ A powerful Model Context Protocol (MCP) server that enables **Claude Code** and
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
## 🎉 What's New in v3.1.
|
|
35
|
+
## 🎉 What's New in v3.1.2
|
|
36
36
|
|
|
37
|
-
**
|
|
37
|
+
**Windows Compatibility Fix** (Released: February 9, 2026)
|
|
38
|
+
|
|
39
|
+
- **🪟 Windows support**: Fixed crash on Windows where `process.env.HOME` is undefined ([#8](https://github.com/bvisible/mcp-ssh-manager/issues/8))
|
|
40
|
+
- Now uses `os.homedir()` for cross-platform compatibility (Linux, macOS, Windows)
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Previous Releases
|
|
45
|
+
|
|
46
|
+
### v3.1.0 - Tool Activation System (November 15, 2025)
|
|
38
47
|
|
|
39
48
|
### 🎯 Context Usage Optimization
|
|
40
49
|
- **92% context reduction**: Enable only the tools you need (minimal mode: 5 tools vs all 37)
|
|
@@ -42,10 +51,6 @@ A powerful Model Context Protocol (MCP) server that enables **Claude Code** and
|
|
|
42
51
|
- **6 tool groups**: Core, Sessions, Monitoring, Backup, Database, Advanced
|
|
43
52
|
- **Auto-approval export**: Generate Claude Code auto-approval configs
|
|
44
53
|
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Previous Releases
|
|
48
|
-
|
|
49
54
|
### v3.0.0 - Enterprise DevOps Platform (October 1, 2025)
|
|
50
55
|
|
|
51
56
|
This release adds **12 new MCP tools** transforming SSH Manager into a comprehensive DevOps automation platform:
|
|
@@ -189,6 +194,7 @@ This is **the** MCP SSH Manager you've been searching for! 🎯
|
|
|
189
194
|
|
|
190
195
|
- Node.js (v18 or higher)
|
|
191
196
|
- npm (comes with Node.js)
|
|
197
|
+
- **Platforms**: Linux, macOS, Windows
|
|
192
198
|
- **For Claude Code**: Claude Code CLI installed
|
|
193
199
|
- **For OpenAI Codex**: Codex CLI configured
|
|
194
200
|
- Bash 4.0+ (for CLI management tools)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-ssh-manager",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "MCP SSH Manager: Model Context Protocol server for SSH remote server management. Control SSH connections from Claude Code and OpenAI Codex - execute commands, transfer files, database operations, backups, health monitoring, and DevOps automation. NEW: Tool activation system reduces context usage by 92%",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
package/src/config-loader.js
CHANGED
|
@@ -91,6 +91,7 @@ export class ConfigLoader {
|
|
|
91
91
|
defaultDir: serverConfig.default_dir || serverConfig.default_directory || serverConfig.cwd,
|
|
92
92
|
sudoPassword: serverConfig.sudo_password,
|
|
93
93
|
description: serverConfig.description,
|
|
94
|
+
platform: serverConfig.platform ? serverConfig.platform.toLowerCase() : undefined,
|
|
94
95
|
source: 'toml'
|
|
95
96
|
});
|
|
96
97
|
}
|
|
@@ -137,6 +138,7 @@ export class ConfigLoader {
|
|
|
137
138
|
defaultDir: env[`SSH_SERVER_${match[1]}_DEFAULT_DIR`],
|
|
138
139
|
sudoPassword: env[`SSH_SERVER_${match[1]}_SUDO_PASSWORD`],
|
|
139
140
|
description: env[`SSH_SERVER_${match[1]}_DESCRIPTION`],
|
|
141
|
+
platform: (env[`SSH_SERVER_${match[1]}_PLATFORM`] || '').toLowerCase() || undefined,
|
|
140
142
|
source: 'env'
|
|
141
143
|
};
|
|
142
144
|
|
|
@@ -187,6 +189,7 @@ export class ConfigLoader {
|
|
|
187
189
|
if (server.defaultDir) serverConfig.default_dir = server.defaultDir;
|
|
188
190
|
if (server.sudoPassword) serverConfig.sudo_password = server.sudoPassword;
|
|
189
191
|
if (server.description) serverConfig.description = server.description;
|
|
192
|
+
if (server.platform) serverConfig.platform = server.platform;
|
|
190
193
|
|
|
191
194
|
config.ssh_servers[name] = serverConfig;
|
|
192
195
|
}
|
|
@@ -213,6 +216,7 @@ export class ConfigLoader {
|
|
|
213
216
|
if (server.defaultDir) lines.push(`SSH_SERVER_${upperName}_DEFAULT_DIR=${server.defaultDir}`);
|
|
214
217
|
if (server.sudoPassword) lines.push(`SSH_SERVER_${upperName}_SUDO_PASSWORD="${server.sudoPassword}"`);
|
|
215
218
|
if (server.description) lines.push(`SSH_SERVER_${upperName}_DESCRIPTION="${server.description}"`);
|
|
219
|
+
if (server.platform) lines.push(`SSH_SERVER_${upperName}_PLATFORM=${server.platform}`);
|
|
216
220
|
lines.push('');
|
|
217
221
|
}
|
|
218
222
|
|
package/src/index.js
CHANGED
|
@@ -233,11 +233,13 @@ function loadServerConfig() {
|
|
|
233
233
|
|
|
234
234
|
// Execute command with timeout - using child_process timeout for real kill
|
|
235
235
|
async function execCommandWithTimeout(ssh, command, options = {}, timeoutMs = 30000) {
|
|
236
|
-
// Pass through rawCommand if specified
|
|
237
|
-
const { rawCommand, ...otherOptions } = options;
|
|
236
|
+
// Pass through rawCommand and platform if specified
|
|
237
|
+
const { rawCommand, platform, ...otherOptions } = options;
|
|
238
|
+
const isWindows = platform === 'windows';
|
|
238
239
|
|
|
239
240
|
// For commands that might hang, use the system's timeout command if available
|
|
240
|
-
|
|
241
|
+
// Skip for Windows hosts where the Linux timeout/sh commands don't exist
|
|
242
|
+
const useSystemTimeout = timeoutMs > 0 && timeoutMs < 300000 && !rawCommand && !isWindows; // Max 5 minutes, not for raw/Windows commands
|
|
241
243
|
|
|
242
244
|
if (useSystemTimeout) {
|
|
243
245
|
// Wrap command with timeout command (works on Linux/Mac)
|
|
@@ -482,7 +484,7 @@ registerToolConditional(
|
|
|
482
484
|
// Log command execution
|
|
483
485
|
const startTime = logger.logCommand(serverName, fullCommand, workingDir);
|
|
484
486
|
|
|
485
|
-
const result = await execCommandWithTimeout(ssh, fullCommand, {}, cappedTimeout);
|
|
487
|
+
const result = await execCommandWithTimeout(ssh, fullCommand, { platform: serverConfig?.platform }, cappedTimeout);
|
|
486
488
|
|
|
487
489
|
// Log command result
|
|
488
490
|
logger.logCommandResult(serverName, fullCommand, startTime, result);
|
|
@@ -1045,7 +1047,9 @@ registerToolConditional(
|
|
|
1045
1047
|
};
|
|
1046
1048
|
} else {
|
|
1047
1049
|
// Non-follow mode - just get the output
|
|
1048
|
-
const
|
|
1050
|
+
const tailServers = loadServerConfig();
|
|
1051
|
+
const tailServerConfig = tailServers[serverName.toLowerCase()];
|
|
1052
|
+
const result = await execCommandWithTimeout(ssh, command, { platform: tailServerConfig?.platform }, 15000);
|
|
1049
1053
|
|
|
1050
1054
|
if (result.code !== 0) {
|
|
1051
1055
|
throw new Error(result.stderr || 'Failed to tail file');
|
|
@@ -1152,10 +1156,12 @@ registerToolConditional(
|
|
|
1152
1156
|
|
|
1153
1157
|
// Execute all monitoring commands
|
|
1154
1158
|
const startTime = Date.now();
|
|
1159
|
+
const monServers = loadServerConfig();
|
|
1160
|
+
const monServerConfig = monServers[serverName.toLowerCase()];
|
|
1155
1161
|
|
|
1156
1162
|
for (const [key, cmd] of Object.entries(commands)) {
|
|
1157
1163
|
try {
|
|
1158
|
-
const result = await execCommandWithTimeout(ssh, cmd, {}, 10000);
|
|
1164
|
+
const result = await execCommandWithTimeout(ssh, cmd, { platform: monServerConfig?.platform }, 10000);
|
|
1159
1165
|
if (result.code === 0) {
|
|
1160
1166
|
output[key] = result.stdout.trim();
|
|
1161
1167
|
} else {
|
|
@@ -1658,7 +1664,7 @@ registerToolConditional(
|
|
|
1658
1664
|
const workingDir = cwd || serverConfig?.default_dir;
|
|
1659
1665
|
const fullCommand = workingDir ? `cd ${workingDir} && ${command}` : command;
|
|
1660
1666
|
|
|
1661
|
-
const execResult = await execCommandWithTimeout(ssh, fullCommand, {}, 30000);
|
|
1667
|
+
const execResult = await execCommandWithTimeout(ssh, fullCommand, { platform: serverConfig?.platform }, 30000);
|
|
1662
1668
|
|
|
1663
1669
|
return {
|
|
1664
1670
|
stdout: execResult.stdout,
|
|
@@ -1950,10 +1956,12 @@ registerToolConditional(
|
|
|
1950
1956
|
results.push(`✅ Uploaded ${path.basename(file.local)} to temp location`);
|
|
1951
1957
|
|
|
1952
1958
|
// Execute deployment strategy
|
|
1959
|
+
const deployServers = loadServerConfig();
|
|
1960
|
+
const deployServerConfig = deployServers[server.toLowerCase()];
|
|
1953
1961
|
for (const step of strategy.steps) {
|
|
1954
1962
|
const command = step.command.replace('{{tempFile}}', tempFile);
|
|
1955
1963
|
|
|
1956
|
-
const result = await execCommandWithTimeout(ssh, command, {}, 15000);
|
|
1964
|
+
const result = await execCommandWithTimeout(ssh, command, { platform: deployServerConfig?.platform }, 15000);
|
|
1957
1965
|
|
|
1958
1966
|
if (result.code !== 0 && step.type !== 'backup') {
|
|
1959
1967
|
throw new Error(`${step.type} failed: ${result.stderr}`);
|
|
@@ -2042,7 +2050,7 @@ registerToolConditional(
|
|
|
2042
2050
|
fullCommand = `cd ${serverConfig.default_dir} && ${fullCommand}`;
|
|
2043
2051
|
}
|
|
2044
2052
|
|
|
2045
|
-
const result = await execCommandWithTimeout(ssh, fullCommand, {}, timeout);
|
|
2053
|
+
const result = await execCommandWithTimeout(ssh, fullCommand, { platform: serverConfig?.platform }, timeout);
|
|
2046
2054
|
|
|
2047
2055
|
// Mask password in output for security
|
|
2048
2056
|
const maskedCommand = fullCommand.replace(/echo "[^"]+" \| sudo -S/, 'sudo');
|