Skip to content

Extend node "all" fan-out to more read-only tools #158

Closed

Description

@TMHSDigital

Summary

forNodes works for any read-only tool, but only nodeStatus, piStatus and serviceHealth use it.

Where

  • mcp-server/src/utils/fan-out.ts:24-61
  • mcp-server/src/prompts.ts:20

Details

Fleet questions ("which nodes have pending upgrades, stale backups, expiring certs, full disks") still need one call per node. The morning-health-check prompt walks one node.

Impact

Multi-node users get fleet views for three tools only.

Suggested fix

Switch nodeParam to nodeOrAllParam and wrap with forNodes in backupStatus, aptUpgradable, certList, diskUsage, ufwStatus, kernelInfo and healthCheck. Give the morning-health-check prompt an all-nodes variant. Add a registration test that every fan-out tool accepts all.

Open question: cap concurrency for larger fleets (today Promise.allSettled is unbounded)?

Acceptance criteria

  • Listed tools accept node: "all"
  • Registration test covers fan-out tools

Related: #129

Getting started

  • Relevant files: mcp-server/src/utils/fan-out.ts, mcp-server/src/tools/backupStatus.ts, mcp-server/src/prompts.ts
  • How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
  • Conventions: see CLAUDE.md and CONTRIBUTING.md

Filed by repo-audit/full-audit at 636fefb. Severity: medium. Effort: S. audit-key: enhancement|mcp-server/src/utils/fan-out.ts|forNodes

Activity

  1. added
    enhancement
    good first issue
    severity: medium
    on Nov 18, 2026
  2. TMHSDigital commented on Nov 19, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 729248c: new fanOut() helper wraps each tool's existing single-node handler (single node unchanged, so tool-specific error hints stay; "all" gives one section per node, isError counts as failed). backupStatus, aptUpgradable, certList, diskUsage, ufwStatus, kernelInfo and healthCheck use it; morning-health-check has a fleet variant for node "all"; a registration test checks that exactly the read-only fan-out tools offer "all". The concurrency cap stays out of scope (still Promise.allSettled). Verified with handler tests (mixed and all-failed fleet, named-node passthrough), the prompt test and the registration test; build, typecheck, Vitest and structure tests pass.

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

    enhancementgood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions