Skip to content

LaunchAgent server has no node on PATH, so the MCP server (and other plugins) can't run the bb CLI #5807

Closed

Description

@colton-jang

Summary

On an npm install started by the host-daemon LaunchAgent, the server process has no node on PATH. Anything on the server that spawns the bb CLI fails with env: node: No such file or directory. Today that makes the new MCP server plugin unusable: search/read report a missing command index and run exits 127. I expected the MCP tools to work right after bb plugin enable bb--mcp.

Versions and environment

  • bb 0.46.1, npm install (BB_APP_INSTALL_KIND=npm), run by LaunchAgent app.getbb.host-daemon.<host>; macOS 27, Mac mini M2
  • Node 24.21.0 from nvm only (no /usr/local or Homebrew node on the default PATH)
  • bb Connect paired; this machine is the server; server previously moved here with bb server move

Steps to reproduce

  1. Install Node only through nvm, and run bb from the LaunchAgent it writes (ProgramArguments call node by absolute path; EnvironmentVariables has no PATH).
  2. bb plugin enable bb--mcp
  3. Call the local endpoint:
    curl -s -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream'
    http://127.0.0.1:38886/api/v1/plugins/bb--mcp/http/mcp
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"run","arguments":{"code":"const r = await bb.cli(["--version"]); return r"}}}'
    Also reproduces without MCP: env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin "$BB_CLI" --version

Expected vs actual

Actual (run tool):     {"exitCode": 127, "stdout": "", "stderr": "env: node: No such file or directory\n"}
Actual (search/read):  Error: The bb CLI on this bb server did not return its command index (`bb guide commands --json`), so the `read` and `search` tools are unavailable. Update bb on that machine.

Expected: the MCP tools run bb commands. The "Update bb on that machine" hint is misleading; bb is current.

Evidence

Server process environment (ps eww, bb 0.46.1):
PATH=/usr/bin:/bin:/usr/sbin:/sbin
BB_CLI=/bb-app/host-daemon/dist/bb (first line: #!/usr/bin/env node)
BB_CLI_LAUNCHER=/bin/bb (runs node by absolute path; works)
The MCP plugin's CLI lookup (builtin-plugins/mcp/dist/server.js, bbBinaryCandidates) tries BB_CLI, BB_CLI_DIR/bb, PATH, /opt/homebrew/bin/bb, /usr/local/bin/bb. It never tries BB_CLI_LAUNCHER and never runs the CLI with process.execPath.
Same root cause hit the Talk to BB plugin on 0.44.0 right after a server move.

What you ruled out

  • Related to Packaged Nightly plugin processes lose PATH for node and gh #2343 (packaged Nightly from the GUI loses PATH); this is the npm + LaunchAgent install, and it still happens on 0.46.1 release.
  • Not a stale CLI: bb guide commands --json returns a valid index (232 commands) when node is on PATH.
  • Fixed locally by adding EnvironmentVariables:PATH (with the nvm bin dir) to the LaunchAgent and reloading it; MCP search/read then work.

AGENT GENERATED — written by Claude Code from a bb session on the affected machine.

Suggested priority and effort (optional)

Medium: breaks MCP and any server-side plugin that shells out to bb on nvm installs; workaround is a manual plist edit that an update may overwrite. Effort probably low (add dirname(process.execPath) to the LaunchAgent PATH, or prefer BB_CLI_LAUNCHER).

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

Activity

  1. added theissue type on Oct 19, 2026
  2. added
    hostHost daemon, process lifecycle, memory, event loop
    pluginsPlugin SDK, runtime, marketplace
    confirmed-reproBug reproduced again from a clean trusted checkout; see linked report
    on Oct 19, 2026
  3. bb-slop-cop commented on Oct 20, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Low · areas host, plugins.
    • Report: Reproduction and root-cause evidence.
    • Verdict: REPRODUCED · root-cause confidence high · reproduction label confirmed-repro.
    • Root cause: MCP selects the Node-shebang BB_CLI and ignores the runtime-pinned BB_CLI_LAUNCHER. Without Node on PATH, execution exits 127; the command-index loader masks this with the update hint.
    • Verification: The real CLI/production runner diagnostic reproduced both failures in two clean trusted-main checkouts. Selecting the pinned launcher succeeds and loads 232 commands; all 125 existing MCP tests pass. The macOS LaunchAgent lifecycle itself was not exercised.
    • No PR: A complete repair changes service packaging/runtime setup, outside this rule’s simple-fix scope; an MCP-only workaround would leave other server-side plugins affected.

    AGENT GENERATED

  4. SawyerHood commented on Oct 20, 2026

    @SawyerHood
    Collaborator

    Backlog comparison: related to #2343 and #5292, but retain this issue separately.

    #2343 concerns packaged-GUI shell PATH acquisition; #5292 includes the daemon restoring a stale startup PATH after managed-environment changes. This report adds npm/LaunchAgent service startup and the server-side CLI consumer selecting the Node-shebang BB_CLI rather than the runtime-pinned BB_CLI_LAUNCHER. Its runner reproduction succeeds when the pinned launcher is selected.

    Coordinate runtime/launcher ownership across the three trackers, and test server plugin execution as well as provider detection. A shell-probe-only fix is not sufficient evidence that this report is resolved.

    AGENT GENERATED

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

    confirmed-reproBug reproduced again from a clean trusted checkout; see linked reporthostHost daemon, process lifecycle, memory, event looppluginsPlugin SDK, runtime, marketplace

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions