Skip to content

Per-service config ignores the node param; sshTest reports the wrong host #106

Closed

Description

@TMHSDigital

Summary

Every tool accepts a node parameter, but per-service settings are global:

  • compose dir
  • restic repo
  • service ports
  • service credentials

When a tool targets a second node, it silently uses the primary Pi's paths and credentials. Separately, homelab_sshTest prints the default host even when another node is targeted.

Where

  • mcp-server/src/utils/ssh-api.ts:32-36 (NodeConfig holds only host, username, keyPath)
  • mcp-server/src/tools/composeUp.ts:7 and the other compose tools (HOMELAB_COMPOSE_DIR)
  • mcp-server/src/tools/backupRestore.ts:36 and the other backup tools (HOMELAB_BACKUP_REPO)
  • Service port and credential getters in the adguard, npm, grafana, and other HTTP tools
  • mcp-server/src/tools/sshTest.ts:12-13,22: the label is built from HOMELAB_PI_HOST/HOMELAB_PI_USER, but the command runs on args.node

Steps to reproduce

  1. Set HOMELAB_NODES to {"nas":{"host":"nas.local"}}.
  2. Call homelab_sshTest {node: "nas"}.
  3. The output says SSH connection to [email protected]: OK.

Suggested fix

  • sshTest (quick): use getNodeConfig(args.node) for the displayed user and host.
  • Allow optional per-node overrides in HOMELAB_NODES entries (composeDir, backupRepo, service ports) and resolve them through one getNodeSetting(node, key) helper that falls back to the global env.
  • Document the per-node keys in .env.example.

Acceptance criteria

  • sshTest reports the targeted node's host
  • Per-node overrides are honored by the compose, backup, and HTTP tools
  • Tests cover override and fallback

Getting started

  • Relevant files: mcp-server/src/utils/ssh-api.ts, mcp-server/src/tools/sshTest.ts, compose and backup tools
  • How to run tests: cd mcp-server && npm test

Filed by repo-audit/full-audit at 9cfe5e3. Severity: medium. Effort: M. audit-key: bug|mcp-server/src/tools/sshTest.ts|host-label

Activity

  1. added
    bug
    severity: medium
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions