mcp-ssh-manager 4.0.0 → 4.0.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.
@@ -19,8 +19,8 @@ release check.
19
19
 
20
20
  1. Merge the release changes through a pull request. Keep the existing required
21
21
  `lint`, `test (18.x)` and `test (20.x)` checks; also require the interface jobs
22
- before release. They build/typecheck the UI, compare it with committed
23
- `dist/ui`, run browser flows, and exercise an upgrade from the real npm 3.8.5.
22
+ before release. They build/typecheck the UI into the generated
23
+ `dist/ui` (and check nothing generated is tracked), run browser flows, and exercise an upgrade from the real npm 3.8.5.
24
24
  2. Update root/desktop package manifests and lockfiles, plus both version fields
25
25
  in `server.json`. `scripts/release-version.mjs` checks their agreement.
26
26
  3. For a candidate, use a version such as `4.0.0-beta.1` and its exact
package/docs/MIGRATION.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Upgrading from 3.8 to 4.0
2
2
 
3
- **4.0.0 is released, on npm and as a desktop application** ([release](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.0.0)).
3
+ **4.0 is released, on npm and as a desktop application**; the latest is 4.0.2 ([release](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.0.2)).
4
4
  The last 3.8 release is 3.8.7, for anyone who pins the 3.8 line.
5
5
 
6
6
  The upgrade path preserves headless npm/CLI use. The application, vault import
@@ -27,10 +27,12 @@ cd ..
27
27
  npm run test:published-upgrade # needs network: actual npm 3.8.5 → V4 → 3.8.5
28
28
  ```
29
29
 
30
- `dist/ui` is committed and shipped in the npm tarball. Rebuild after a UI edit;
31
- CI rejects a build that differs from the committed interface. Browser tests
32
- exercise that compiled interface against the real local ControlPlane HTTP/SSE
33
- server. Playwright reports, traces and failure screenshots are retained in CI.
30
+ `dist/ui` is generated, not committed: `prepack` builds it into the npm tarball
31
+ (`npm run build:ui` does the same by hand), and the desktop app builds it when it
32
+ is assembled. CI builds it on three systems, fails if anything generated is
33
+ tracked by git, and release.yml refuses a tarball that does not carry it. Browser
34
+ tests exercise that compiled interface against the real local ControlPlane
35
+ HTTP/SSE server. Playwright reports, traces and failure screenshots are retained in CI.
34
36
 
35
37
  For focused work, run `npm run test:migration`, `test:security`, `test:hostkeys`,
36
38
  `test:proxy`, `test:working-directory`, `test:groups-persistence`, `test:release`,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "mcp-ssh-manager",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "mcpName": "io.github.bvisible/mcp-ssh-manager",
5
- "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
+ "description": "MCP server for SSH: let AI agents (Claude Code, Codex, any MCP client) run commands, transfer files and manage servers over SSH, with human approval, an encrypted vault and a live audit trail.",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "mcp-ssh-manager": "src/index.js",
@@ -14,7 +14,7 @@
14
14
  "setup": "npm install && pip install -r tools/requirements.txt",
15
15
  "configure": "python tools/server-manager.py",
16
16
  "test-connection": "python tools/test-connection.py",
17
- "test": "npm run test:lockfile && npm run test:sudostdin && npm run test:vault && npm run test:recovery && npm run test:upgrade && npm run test:notify && npm run test:commands && npm run test:commandlog && npm run test:portability && npm run test:approval && npm run test:controlplane && npm run test:terminal && npm run test:files && npm run test:livestream && npm run test:skills && npm run test:redaction && npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy && npm run test:policynames && npm run test:ping && npm run test:config && npm run test:fieldnames && npm run test:groups && npm run test:agentforward && npm run test:certpath && npm run test:agentannounce && npm run test:autherrors && npm run test:envchoice && npm run test:lifecycle && npm run test:tunnel && npm run test:sync && npm run test:sync-path && npm run test:dbquoting && npm run test:dbinjection && npm run test:backupinjection && npm run test:dbrowcount && npm run test:migration && npm run test:security && npm run test:hostkeys && npm run test:proxy && npm run test:working-directory && npm run test:groups-persistence && npm run test:release && npm run test:cli-experience && npm run test:desktop-install && npm run test:agent-clients && npm run test:preview && npm run test:desktop-smoke && npm run test:cli-edit",
17
+ "test": "npm run test:lockfile && npm run test:sudostdin && npm run test:vault && npm run test:recovery && npm run test:upgrade && npm run test:notify && npm run test:commands && npm run test:commandlog && npm run test:portability && npm run test:approval && npm run test:controlplane && npm run test:terminal && npm run test:files && npm run test:livestream && npm run test:skills && npm run test:redaction && npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy && npm run test:policynames && npm run test:ping && npm run test:config && npm run test:fieldnames && npm run test:groups && npm run test:agentforward && npm run test:certpath && npm run test:agentannounce && npm run test:autherrors && npm run test:envchoice && npm run test:lifecycle && npm run test:tunnel && npm run test:sync && npm run test:sync-path && npm run test:dbquoting && npm run test:dbinjection && npm run test:quoteprops && npm run test:backupinjection && npm run test:dbrowcount && npm run test:migration && npm run test:security && npm run test:hostkeys && npm run test:proxy && npm run test:working-directory && npm run test:groups-persistence && npm run test:release && npm run test:cli-experience && npm run test:desktop-install && npm run test:agent-clients && npm run test:appupdate && npm run test:preview && npm run test:desktop-smoke && npm run test:local-shell && npm run test:cli-edit && npm run test:timeoutwrap",
18
18
  "test:lockfile": "node tests/test-lockfile.js",
19
19
  "test:sudostdin": "node tests/test-sudo-stdin.js",
20
20
  "test:vault": "node tests/test-secret-store.js",
@@ -43,8 +43,10 @@
43
43
  "test:sync-path": "node tests/test-rsync-path.js",
44
44
  "test:dbquoting": "node tests/test-database-query-quoting.js",
45
45
  "test:dbinjection": "node tests/test-database-injection.js",
46
+ "test:quoteprops": "node tests/test-shell-quote-properties.js",
46
47
  "test:backupinjection": "node tests/test-backup-monitor-injection.js",
47
48
  "test:dbrowcount": "node tests/test-database-row-count.js",
49
+ "test:timeoutwrap": "node tests/test-timeout-wrapper.js",
48
50
  "test:cli-edit": "node tests/test-cli-edit-server.js",
49
51
  "test:all": "npm test && npm run typecheck && ./scripts/validate.sh",
50
52
  "validate": "./scripts/validate.sh",
@@ -53,7 +55,9 @@
53
55
  "format": "prettier --write 'src/**/*.js' 'tests/**/*.js'",
54
56
  "test:terminal": "node tests/test-terminal.js",
55
57
  "test:files": "node tests/test-files.js",
56
- "build:ui": "cd ui && npm ci && npm run build",
58
+ "build:ui": "node scripts/build-interface.mjs",
59
+ "brand:social": "node scripts/render-social-preview.mjs",
60
+ "prepack": "node scripts/build-interface.mjs",
57
61
  "test:recovery": "node tests/test-vault-recovery.js",
58
62
  "test:upgrade": "node tests/test-upgrade.js",
59
63
  "test:notify": "node tests/test-notify.js",
@@ -69,51 +73,49 @@
69
73
  "test:release": "node tests/test-release.js",
70
74
  "test:cli-experience": "node tests/test-cli-experience.js",
71
75
  "test:agent-clients": "node tests/test-agent-clients.js",
76
+ "test:appupdate": "node tests/test-app-update.js",
72
77
  "test:desktop-install": "node tests/test-desktop-install.js",
73
78
  "test:published-upgrade": "node scripts/test-upgrade-from-published.mjs",
74
79
  "test:ui": "npm --prefix ui run test:e2e",
75
80
  "test:preview": "node tests/test-preview-candidate.js",
76
81
  "test:desktop-smoke": "node tests/test-desktop-smoke.js",
82
+ "test:local-shell": "node tests/test-local-shell.js",
77
83
  "test:policynames": "node tests/test-policy-name-resolution.js"
78
84
  },
79
85
  "keywords": [
80
86
  "mcp",
87
+ "mcp-server",
88
+ "model-context-protocol",
81
89
  "ssh",
82
- "mcp-ssh",
83
- "mcp ssh",
84
90
  "ssh-mcp",
85
- "ssh mcp",
86
- "model-context-protocol-ssh",
87
- "mcp-server",
88
- "mcp server ssh",
91
+ "mcp-ssh",
92
+ "sftp",
93
+ "ssh-client",
89
94
  "claude-code",
90
- "claude-ssh",
91
- "claude-code-ssh",
95
+ "claude-desktop",
92
96
  "openai-codex",
93
97
  "codex",
94
- "model-context-protocol",
98
+ "ai-agents",
99
+ "agentic-ai",
100
+ "llm-tools",
101
+ "ai-assistant",
102
+ "devops",
95
103
  "remote-server",
104
+ "server-management",
105
+ "remote-access",
106
+ "human-in-the-loop",
107
+ "approval",
108
+ "audit-log",
109
+ "security",
110
+ "backup",
111
+ "database",
112
+ "health-monitoring",
96
113
  "ssh-manager",
97
- "ssh manager mcp",
98
- "remote-ssh",
99
114
  "ssh-automation",
100
115
  "deployment",
101
- "devops",
102
- "automation",
103
- "backup",
104
- "restore",
105
- "health-monitoring",
106
- "database",
107
116
  "mysql",
108
117
  "postgresql",
109
- "mongodb",
110
- "profiles",
111
- "hooks",
112
- "aliases",
113
- "toml",
114
- "ai-assistant",
115
- "ai-tools",
116
- "llm-tools"
118
+ "mongodb"
117
119
  ],
118
120
  "author": "MCP SSH Manager Contributors",
119
121
  "license": "MIT",
@@ -128,13 +130,14 @@
128
130
  "dependencies": {
129
131
  "@iarna/toml": "^2.2.5",
130
132
  "@modelcontextprotocol/sdk": "^1.32.1",
131
- "dotenv": "^16.4.5",
133
+ "dotenv": "^18.0.9",
132
134
  "ssh2": "^1.17.0",
133
135
  "zod": "^4.6.7"
134
136
  },
135
137
  "devDependencies": {
136
138
  "@types/node": "^26.6.4",
137
139
  "eslint": "^8.56.0",
140
+ "fast-check": "^4.10.2",
138
141
  "knip": "^6.40.0",
139
142
  "prettier": "^3.2.4",
140
143
  "typescript": "^6.0.3"
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ // Builds the control plane interface into dist/ui.
3
+ //
4
+ // dist/ui is generated, never committed: it is built when the npm package is
5
+ // made (`prepack`), when the desktop app is assembled (prepare-engine) and by
6
+ // hand with `npm run build:ui`. What a user installs is unchanged: the package
7
+ // and the app carry the built interface, so nothing compiles on their machine.
8
+ //
9
+ // The interface sources live in ui/ and are not part of the package, so a tree
10
+ // without ui/ (an unpacked tarball) keeps the dist/ui it already has.
11
+ import { execFileSync } from 'node:child_process';
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
17
+ const ui = path.join(root, 'ui');
18
+ const out = path.join(root, 'dist', 'ui');
19
+ const REQUIRED = ['index.html', 'app.js', 'app.css'];
20
+
21
+ /** What is missing from a build, empty when it is complete. */
22
+ function missingFrom(dir) {
23
+ return REQUIRED.filter(name => {
24
+ try { return fs.statSync(path.join(dir, name)).size === 0; } catch { return true; }
25
+ });
26
+ }
27
+
28
+ /**
29
+ * Run npm without a shell. `npm_execpath` is npm's own script when this file is
30
+ * started by `npm run`; Windows has no `npm` binary, only `npm.cmd`, which Node
31
+ * will not spawn without a shell.
32
+ * @param {string[]} args
33
+ */
34
+ function npm(args) {
35
+ const cli = process.env.npm_execpath;
36
+ // Everything is written to stderr: as `prepack` this runs inside `npm pack`,
37
+ // whose stdout may be machine-read (`npm pack --json`) and must stay clean.
38
+ const stdio = ['ignore', process.stderr.fd, process.stderr.fd];
39
+ if (cli && cli.endsWith('.js')) {
40
+ execFileSync(process.execPath, [cli, ...args], { cwd: root, stdio });
41
+ } else {
42
+ execFileSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, { cwd: root, stdio, shell: process.platform === 'win32' });
43
+ }
44
+ }
45
+
46
+ if (!fs.existsSync(path.join(ui, 'package.json'))) {
47
+ const missing = missingFrom(out);
48
+ if (missing.length) {
49
+ console.error(`The interface sources (ui/) are not here and dist/ui is incomplete (missing: ${missing.join(', ')}).`);
50
+ process.exit(1);
51
+ }
52
+ console.error('No interface sources here; keeping the dist/ui that comes with this tree.');
53
+ process.exit(0);
54
+ }
55
+
56
+ // A pack from a fresh checkout has no ui/node_modules yet; the lockfile decides
57
+ // what gets installed, exactly as in CI.
58
+ if (!fs.existsSync(path.join(ui, 'node_modules'))) {
59
+ console.error('Installing the interface dependencies from ui/package-lock.json…');
60
+ npm(['ci', '--prefix', 'ui', '--no-audit', '--no-fund']);
61
+ }
62
+
63
+ // Never ship a stale or half-written build: start from nothing.
64
+ fs.rmSync(out, { recursive: true, force: true });
65
+ console.error('Building the interface into dist/ui…');
66
+ npm(['run', 'build', '--prefix', 'ui']);
67
+
68
+ const missing = missingFrom(out);
69
+ if (missing.length) {
70
+ console.error(`The interface build did not produce: ${missing.join(', ')}`);
71
+ process.exit(1);
72
+ }
73
+ console.error('dist/ui is ready.');
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ // Renders brand/social-preview.html into the GitHub social preview image
3
+ // (docs/images/social-preview.png at 1280x640, and @2x). Needs the built interface
4
+ // for its fonts (npm run build:ui) and Playwright from ui/ (npm ci --prefix ui).
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import { createRequire } from 'node:module';
8
+ import { fileURLToPath, pathToFileURL } from 'node:url';
9
+
10
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
11
+ if (!fs.existsSync(path.join(root, 'dist', 'ui', 'assets', 'Karla-Variable.woff2'))) {
12
+ console.error('The fonts come from the built interface: run `npm run build:ui` first.');
13
+ process.exit(1);
14
+ }
15
+ let chromium;
16
+ try {
17
+ ({ chromium } = createRequire(path.join(root, 'ui', 'package.json'))('@playwright/test'));
18
+ } catch {
19
+ console.error('Playwright is not installed in ui/: run `npm ci --prefix ui` first.');
20
+ process.exit(1);
21
+ }
22
+ const html = pathToFileURL(path.join(root, 'brand', 'social-preview.html')).href;
23
+ const browser = await chromium.launch();
24
+ try {
25
+ for (const [scale, name] of [[1, 'social-preview.png'], [2, 'social-preview@2x.png']]) {
26
+ const page = await browser.newPage({ viewport: { width: 1280, height: 640 }, deviceScaleFactor: scale });
27
+ await page.goto(html);
28
+ await page.evaluate(() => document.fonts.ready);
29
+ await page.waitForTimeout(300);
30
+ await page.screenshot({ path: path.join(root, 'docs', 'images', name) });
31
+ await page.close();
32
+ console.log(`docs/images/${name}`);
33
+ }
34
+ } finally {
35
+ await browser.close();
36
+ }
@@ -0,0 +1,12 @@
1
+ # Python tools for the pre-commit hooks (scripts/setup-hooks.sh). The hashed
2
+ # lock, requirements-dev.txt, is generated from this file; floors only, the lock
3
+ # holds the exact versions. Python 3.11 and later: 3.10 reaches end of life this month, and the
4
+ # fixed releases of black, filelock, requests and urllib3 do not support older ones.
5
+ # uv pip compile scripts/requirements-dev.in --generate-hashes --universal --python-version 3.11 -o scripts/requirements-dev.txt
6
+ # Check the result against OSV before committing: a lock of pinned versions is
7
+ # read by OpenSSF Scorecard, and an affected version there is a standing alert.
8
+ pre-commit>=4.0.1
9
+ black>=26.3.1
10
+ flake8>=7.1.1
11
+ isort>=5.13.2
12
+ detect-secrets>=1.5.0