mcp-ssh-manager 3.5.0 → 3.5.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/CHANGELOG.md +10 -0
- package/README.md +29 -12
- package/package.json +3 -2
- package/src/ssh-manager.js +22 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to MCP SSH Manager will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.5.1] - 2026-05-26
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Healthy Windows/OpenSSH sessions wrongly reported as `Dead`** ([#39](https://github.com/bvisible/mcp-ssh-manager/pull/39) — thanks @username77)
|
|
13
|
+
- `ssh_connection_status` ran `echo "ping"` and compared the output with a strict `=== 'ping'`. On `cmd.exe` the surrounding quotes are echoed literally (output `"ping"`), so the check failed and a live pooled connection was torn down and rebuilt for nothing.
|
|
14
|
+
- The probe now runs `echo ping` (no quotes), which emits a bare `ping` consistently across bash, `cmd.exe` and PowerShell — fixing the root cause rather than only the symptom.
|
|
15
|
+
- Output parsing moved to a new exported helper `isPingAlive(stdout)` that normalizes CRLF, stray quotes/backslashes and case before matching, and is null/undefined-safe. `includes('ping')` (rather than strict equality) is intentional: a liveness probe should err toward "alive" — a false positive just lets the next real command reconnect, whereas a false negative needlessly drops a healthy connection.
|
|
16
|
+
- **New test suite** `tests/test-ssh-ping.js` (wired into `npm test` as `test:ping`) covering the quoted/escaped/CRLF/case variants and the null/undefined paths. Validated against a real Windows/OpenSSH host.
|
|
17
|
+
|
|
8
18
|
## [3.5.0] - 2026-05-18
|
|
9
19
|
|
|
10
20
|
### Added
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A Model Context Protocol (MCP) server that enables **Claude Code** and **OpenAI
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
8
8
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
9
|
-
[](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v3.5.1)
|
|
10
10
|
[](https://claude.ai/code)
|
|
11
11
|
[](https://openai.com/codex)
|
|
12
12
|
[](https://modelcontextprotocol.io)
|
|
@@ -20,25 +20,42 @@ A Model Context Protocol (MCP) server that enables **Claude Code** and **OpenAI
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
## 🎉 What's New in v3.
|
|
23
|
+
## 🎉 What's New in v3.5.1
|
|
24
24
|
|
|
25
|
-
**
|
|
25
|
+
**Robust SSH ping health-check on Windows/OpenSSH** (Released: May 26, 2026)
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- **Cipher**: added `aes128-gcm@openssh.com` and `aes256-gcm@openssh.com` (preferred GCM variants on modern servers)
|
|
32
|
-
- **HMAC**: added `hmac-sha2-256-etm@openssh.com`, `hmac-sha2-512-etm@openssh.com`, `hmac-sha1-etm@openssh.com` (encrypt-then-MAC — both faster and cryptographically stronger than encrypt-and-MAC)
|
|
33
|
-
- **Backward-compatible by design** — all legacy algorithms (`diffie-hellman-group14-sha1`, `ssh-rsa`, CBC ciphers, plain `hmac-sha*`) are preserved at lower preference, so older servers (CentOS 7, Debian 10…) keep working unchanged
|
|
34
|
-
- Thanks [@YoungHong1992](https://github.com/YoungHong1992) for the well-scoped, well-ordered patch
|
|
27
|
+
- **🪟 Healthy Windows sessions are no longer reported as `Dead`** ([#39](https://github.com/bvisible/mcp-ssh-manager/pull/39) — thanks [@username77](https://github.com/username77))
|
|
28
|
+
- `ssh_connection_status` ran `echo "ping"` and compared the output with a strict `=== 'ping'`. On `cmd.exe` the surrounding quotes are echoed literally (output `"ping"`), so the check failed and a live pooled connection was torn down and rebuilt for nothing.
|
|
29
|
+
- The probe now runs `echo ping` (no quotes) — a bare `ping` across bash, `cmd.exe` and PowerShell — fixing the root cause rather than only the symptom.
|
|
30
|
+
- Output parsing moved to an exported, null-safe `isPingAlive(stdout)` helper (CRLF / quote / case-normalized). `includes('ping')` is intentional: a liveness probe should err toward "alive". New `tests/test-ssh-ping.js` is wired into `npm test`. Validated against a real Windows/OpenSSH host.
|
|
35
31
|
|
|
36
|
-
[Read full changelog →](CHANGELOG.md#
|
|
32
|
+
[Read full changelog →](CHANGELOG.md#351---2026-05-26)
|
|
37
33
|
|
|
38
34
|
---
|
|
39
35
|
|
|
40
36
|
## Previous Releases
|
|
41
37
|
|
|
38
|
+
### v3.5.0 - Per-server security modes — `readonly` / `restricted` + audit log (May 18, 2026)
|
|
39
|
+
|
|
40
|
+
A second authorization layer that filters tool invocations **inside the MCP server**, complementing the existing client-side `autoApprove`. Useful when sharing the MCP with a third-party agent, a CI bot, or any client where `ssh_execute` shouldn't be unconditionally trusted.
|
|
41
|
+
|
|
42
|
+
- **🔒 Three modes, opt-in per server** (no `MODE` field = identical to v3.4.x):
|
|
43
|
+
- **`unrestricted`** (default) — strict no-op. `evaluatePolicy()` early-returns on the first line, zero overhead.
|
|
44
|
+
- **`readonly`** — blocks mutating tools (`ssh_upload`, `ssh_deploy`, `ssh_sync`, `ssh_execute_sudo`, `ssh_backup_*`, `ssh_db_import/dump`, plus action-gated `ssh_key_manage accept|remove`, `ssh_alert_setup set`, `ssh_process_manager kill`) AND applies a built-in denylist on `ssh_execute` (rm, mv, dd, mkfs, chmod, chown, sudo, systemctl restart/stop, docker rm/stop, pipe-to-sh, redirect outside `/tmp`, curl|sh, etc.).
|
|
45
|
+
- **`restricted`** — every command must match at least one `ALLOW_PATTERNS` regex AND no `DENY_PATTERNS` regex. **DENY wins**. With no `ALLOW_PATTERNS` everything is refused (fail-closed).
|
|
46
|
+
- **📝 Audit log** — opt-in JSONL per server (`SSH_SERVER_<N>_AUDIT_LOG=/path/to/audit.jsonl`). Records `ts`, `server`, `tool`, args, `allowed`, `reason` on denial, `exitCode`/`success` on execution. Sensitive arg fields (`password`, `passphrase`, `sudoPassword`, `token`, `secret`, `apikey`) are replaced with `***`.
|
|
47
|
+
- **🪄 Command aliases expanded BEFORE policy evaluation** — a `DENY` pattern can't be bypassed via an alias.
|
|
48
|
+
- **♻️ Backward-compatible by design** — a v3.4.x `.env` or TOML loads identically. No `MODE` field → zero behavior change. The interactive wizard (`ssh-manager server add`) defaults all three new prompts to skip. All 13 pre-existing tests pass unmodified. New `tests/test-policy.js` adds 26 tests covering modes, DENY > ALLOW precedence, invalid-regex handling, redaction, and the backward-compat fast path. [Full reference →](docs/SECURITY_MODES.md)
|
|
49
|
+
|
|
50
|
+
### v3.4.1 - Modern OpenSSH 9.x compatibility (May 16, 2026)
|
|
51
|
+
|
|
52
|
+
- **🔐 Expanded SSH algorithm list — handshake against OpenSSH 9.x out of the box** ([#32](https://github.com/bvisible/mcp-ssh-manager/pull/32))
|
|
53
|
+
- **KEX**: `curve25519-sha256` (+`@libssh.org`), `diffie-hellman-group15-sha512`, `diffie-hellman-group16-sha512`
|
|
54
|
+
- **Server host key**: `rsa-sha2-512`, `rsa-sha2-256` (RFC 8332)
|
|
55
|
+
- **Cipher**: `aes128-gcm@openssh.com`, `aes256-gcm@openssh.com`
|
|
56
|
+
- **HMAC**: `hmac-sha2-256-etm@openssh.com`, `hmac-sha2-512-etm@openssh.com`, `hmac-sha1-etm@openssh.com`
|
|
57
|
+
- Backward-compatible — legacy algorithms preserved at lower preference, older servers (CentOS 7, Debian 10) keep working. Thanks [@YoungHong1992](https://github.com/YoungHong1992).
|
|
58
|
+
|
|
42
59
|
### v3.4.0 - Windows OpenSSH support + shell-agnostic session sync (May 7, 2026)
|
|
43
60
|
|
|
44
61
|
- **🪟 Windows OpenSSH encoding & syntax fixes** — UTF-16LE base64 PowerShell payloads (Ansible-style) + `Set-Location` replacing `cd && ` ([#31](https://github.com/bvisible/mcp-ssh-manager/pull/31), thanks [@WenKingSu](https://github.com/WenKingSu))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-ssh-manager",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
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
|
"bin": {
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
"setup": "npm install && pip install -r tools/requirements.txt",
|
|
14
14
|
"configure": "python tools/server-manager.py",
|
|
15
15
|
"test-connection": "python tools/test-connection.py",
|
|
16
|
-
"test": "npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy",
|
|
16
|
+
"test": "npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy && npm run test:ping",
|
|
17
17
|
"test:profiles": "node tests/test-profiles.js",
|
|
18
18
|
"test:aliases": "node tests/test-command-aliases.js",
|
|
19
19
|
"test:hooks": "node tests/test-hooks.js",
|
|
20
20
|
"test:tools": "node tests/test-tool-registry.js",
|
|
21
21
|
"test:policy": "node tests/test-policy.js",
|
|
22
|
+
"test:ping": "node tests/test-ssh-ping.js",
|
|
22
23
|
"test:all": "npm test && ./scripts/validate.sh",
|
|
23
24
|
"validate": "./scripts/validate.sh",
|
|
24
25
|
"lint": "eslint src/*.js",
|
package/src/ssh-manager.js
CHANGED
|
@@ -7,6 +7,22 @@ import { isHostKnown, getCurrentHostKey, addHostKey, updateHostKey } from './ssh
|
|
|
7
7
|
import { configLoader } from './config-loader.js';
|
|
8
8
|
import { logger } from './logger.js';
|
|
9
9
|
|
|
10
|
+
// Validate liveness-probe output across shells (bash, cmd.exe, PowerShell).
|
|
11
|
+
// Normalize CRLF, stray quotes/backslashes and case before matching so quoted
|
|
12
|
+
// or escaped variants (e.g. `"ping"`, `\"ping\"\r\n`) still count as alive.
|
|
13
|
+
// `includes` (not strict `===`) is deliberate: a liveness probe should err
|
|
14
|
+
// toward "alive" — a false positive merely lets the next real command
|
|
15
|
+
// reconnect, whereas a false negative needlessly tears down a healthy pooled
|
|
16
|
+
// connection.
|
|
17
|
+
export function isPingAlive(stdout) {
|
|
18
|
+
const normalized = (stdout || '')
|
|
19
|
+
.replace(/[\r\n]+/g, ' ')
|
|
20
|
+
.replace(/["'`\\]/g, '')
|
|
21
|
+
.trim()
|
|
22
|
+
.toLowerCase();
|
|
23
|
+
return normalized.includes('ping');
|
|
24
|
+
}
|
|
25
|
+
|
|
10
26
|
class SSHManager {
|
|
11
27
|
constructor(config) {
|
|
12
28
|
this.config = config;
|
|
@@ -509,8 +525,12 @@ class SSHManager {
|
|
|
509
525
|
|
|
510
526
|
async ping() {
|
|
511
527
|
try {
|
|
512
|
-
|
|
513
|
-
|
|
528
|
+
// Use `echo ping` WITHOUT quotes: cmd.exe echoes surrounding quotes
|
|
529
|
+
// literally (outputs `"ping"`), which broke the strict equality check and
|
|
530
|
+
// marked healthy Windows/OpenSSH sessions as dead. Output handling lives
|
|
531
|
+
// in isPingAlive() so it can be unit-tested without a live connection.
|
|
532
|
+
const result = await this.execCommand('echo ping', { timeout: 5000 });
|
|
533
|
+
return isPingAlive(result.stdout);
|
|
514
534
|
} catch (error) {
|
|
515
535
|
return false;
|
|
516
536
|
}
|