ssh-mcp 2.0.1 → 2.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.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/ssh-mcp)](https://www.npmjs.com/package/ssh-mcp)
4
4
  [![Downloads](https://img.shields.io/npm/dm/ssh-mcp)](https://www.npmjs.com/package/ssh-mcp)
5
+ [![CI](https://github.com/tufantunc/ssh-mcp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/tufantunc/ssh-mcp/actions/workflows/ci.yml)
6
+ [![codecov](https://codecov.io/gh/tufantunc/ssh-mcp/branch/main/graph/badge.svg)](https://codecov.io/gh/tufantunc/ssh-mcp)
5
7
  [![License](https://img.shields.io/github/license/tufantunc/ssh-mcp)](./LICENSE)
6
8
  [![GitHub issues](https://img.shields.io/github/issues/tufantunc/ssh-mcp)](https://github.com/tufantunc/ssh-mcp/issues)
7
9
 
@@ -91,6 +91,16 @@ function normalizeConfig(raw) {
91
91
  export function getProfile(config, name) {
92
92
  const targetName = name || config.defaults.defaultProfile;
93
93
  if (!targetName) {
94
+ // Falling back to profiles[0] meant that with several hosts configured and
95
+ // no default chosen, a command with no profile argument ran against
96
+ // whichever host happened to be listed first — silently, and typically the
97
+ // one written down first, which tends to be production. One profile is
98
+ // unambiguous; more than one is a question the caller has to answer.
99
+ if (config.profiles.length > 1) {
100
+ const names = config.profiles.map((p) => p.name).join(', ');
101
+ throw new Error(`No profile selected and no default configured, but ${config.profiles.length} profiles exist: ${names}. ` +
102
+ `Pass a "profile" argument, or set defaults.defaultProfile in the config.`);
103
+ }
94
104
  return config.profiles[0];
95
105
  }
96
106
  const profile = config.profiles.find((p) => p.name === targetName);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ssh-mcp",
3
3
  "license": "MIT",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "description": "MCP server exposing policy-gated, audited SSH access for Linux and Windows hosts via the Model Context Protocol.",
6
6
  "type": "module",
7
7
  "bin": {
@@ -43,6 +43,7 @@
43
43
  "@changesets/cli": "^2.31.0",
44
44
  "@types/node": "^24.5.2",
45
45
  "@types/ssh2": "^1.15.5",
46
+ "@vitest/coverage-v8": "^3.2.7",
46
47
  "cross-env": "^7.0.3",
47
48
  "fast-check": "^3.23.2",
48
49
  "shx": "^0.4.0",