Skip to content

fix(mcp): resolve npx stdio connection failures - #1291

Merged
teknium1 merged 1 commit into
mainfrom
salvage/pr-977-mcp-stdio
Mar 14, 2026
Merged

fix(mcp): resolve npx stdio connection failures#1291
teknium1 merged 1 commit into
mainfrom
salvage/pr-977-mcp-stdio

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

  • salvage the MCP stdio startup fix from PR fix: resolve MCP npx stdio connection failures #977 onto current main
  • resolve bare stdio commands against the actual filtered subprocess PATH
  • add targeted fallback resolution for npx / npm / node in Hermes-managed install locations
  • prepend the resolved command directory back into subprocess PATH so #!/usr/bin/env node chains resolve reliably
  • improve MCP discovery warnings by surfacing the actionable missing executable instead of raw ExceptionGroup noise
  • add deterministic regression tests for the issue-948 npx / node startup path cases

Why salvage instead of merging the old branch directly

  • PR fix: resolve MCP npx stdio connection failures #977 is stale against current main
  • the original bugfix is valid, but one of the new tests was environment-dependent when npx already existed on the host PATH
  • this salvage keeps the useful fix while making the regression coverage deterministic on current main

Test plan

  • source /home/teknium/.hermes/hermes-agent/.venv/bin/activate && python -m pytest -o addopts='' tests/tools/test_mcp_tool.py tests/tools/test_mcp_tool_issue_948.py tests/test_model_tools.py -n0 -q

Credit

Salvaged from PR #977 onto current main.
Preserves the MCP stdio command resolution and improved error diagnostics,
with deterministic regression tests for the npx/node PATH cases.
@teknium1
teknium1 merged commit b646440 into main Mar 14, 2026
1 check passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Salvaged from PR NousResearch#977 onto current main.
Preserves the MCP stdio command resolution and improved error diagnostics,
with deterministic regression tests for the npx/node PATH cases.

Co-authored-by: kshitij <82637225+kshitijk4poor@users.noreply.github.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Salvaged from PR NousResearch#977 onto current main.
Preserves the MCP stdio command resolution and improved error diagnostics,
with deterministic regression tests for the npx/node PATH cases.

Co-authored-by: kshitij <82637225+kshitijk4poor@users.noreply.github.com>
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Salvaged from PR NousResearch#977 onto current main.
Preserves the MCP stdio command resolution and improved error diagnostics,
with deterministic regression tests for the npx/node PATH cases.

Co-authored-by: kshitij <82637225+kshitijk4poor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants