@neoline/hostbridge 0.2.0 → 0.2.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/bin/hostbridge.js CHANGED
@@ -19,6 +19,8 @@ if (!existsSync(moduleDir)) {
19
19
 
20
20
  const env = { ...process.env };
21
21
  env.PYTHONPATH = env.PYTHONPATH ? `${bundledSrc}${delimiter}${env.PYTHONPATH}` : bundledSrc;
22
+ env.HOSTBRIDGE_DEFAULT_MCP_COMMAND = env.HOSTBRIDGE_DEFAULT_MCP_COMMAND || 'npx';
23
+ env.HOSTBRIDGE_DEFAULT_MCP_ARGS = env.HOSTBRIDGE_DEFAULT_MCP_ARGS || JSON.stringify(['-y', '@neoline/hostbridge']);
22
24
 
23
25
  const child = spawn(pythonPath, ['-m', 'server_control_mcp', ...process.argv.slice(2)], {
24
26
  stdio: 'inherit',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoline/hostbridge",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "HostBridge MCP server for persistent allowlisted SSH and shell sessions.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hostbridge"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "HostBridge MCP server for persistent allowlisted SSH and shell sessions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -6,7 +6,7 @@ import sys
6
6
  from typing import NoReturn
7
7
 
8
8
  __all__ = ["__version__", "ensure_runtime"]
9
- __version__ = "0.2.0"
9
+ __version__ = "0.2.1"
10
10
 
11
11
  # (import_name, pip_name) pairs for runtime dependency probing.
12
12
  _REQUIRED_DEPENDENCIES = (
@@ -228,12 +228,23 @@ def _looks_like_shell_script(command: str, args: list[str]) -> bool:
228
228
 
229
229
 
230
230
  def _default_mcp_command_args() -> tuple[str, list[str]]:
231
+ env_command = os.environ.get("HOSTBRIDGE_DEFAULT_MCP_COMMAND")
232
+ if env_command:
233
+ raw_args = os.environ.get("HOSTBRIDGE_DEFAULT_MCP_ARGS", "[]")
234
+ try:
235
+ parsed_args = json.loads(raw_args)
236
+ except json.JSONDecodeError:
237
+ parsed_args = []
238
+ if not isinstance(parsed_args, list) or not all(isinstance(arg, str) for arg in parsed_args):
239
+ parsed_args = []
240
+ return env_command, parsed_args
241
+
231
242
  repo_root = Path(__file__).resolve().parents[2]
232
243
  run_server = repo_root / "run_server.py"
233
244
  if run_server.exists():
234
245
  return "python3", [str(run_server)]
235
246
  command = Path(sys.argv[0]).name or PUBLIC_NAME
236
- if command in (LEGACY_PUBLIC_NAME, LEGACY_PACKAGE_NAME):
247
+ if command in (LEGACY_PUBLIC_NAME, LEGACY_PACKAGE_NAME, "__main__.py"):
237
248
  command = PUBLIC_NAME
238
249
  return command, []
239
250