fix(mcp): resolve uv and uvx under filtered PATH - #67178
Conversation
Add uv and uvx to the MCP stdio command resolver so local MCP servers that start with uv or uvx work even when PATH does not include their installation folder (e.g. when Hermes is launched from a macOS GUI app). The resolver already searched common locations for Node commands (npx, npm, node). This extends the same fallback to uv and uvx, checking: 1. The configured PATH 2. $HERMES_HOME/bin (uv managed) 3. ~/.local/bin 4. /opt/homebrew/bin (Apple Silicon Homebrew) 5. /usr/local/bin (Intel Homebrew, Linux, Docker) Adds 60 parameterized and targeted tests covering fallback order, filtered-PATH hits, and command exclusion. Closes NousResearch#67125
Duplicate of #67125: the current live patch is byte-equivalent, including the uv/uvx resolver behavior and regression tests. |
|
Thanks for the focused MCP resolver fix. Current main still restricts fallback resolution to The patch preserves configured-PATH precedence, retains the existing allowlisted-fallback design, and uses the managed uv location established by Automated hermes-sweeper review. |
SummaryEight PRs were checked across three linked MCP stdio-resolution issues. #37665, #67125, and #67178 address the remaining uv/uvx GUI-PATH cause of #37589; #56537/#56594 address Windows PATHEXT handling, #61153 addresses the managed Studio launcher, #8305 addresses WSL cwd warnings, and #67873 adds Node-version-manager lookup roots. Related pull requests
Duplicates#67178 is a functional duplicate of #67125, while #37665 targets the same #37589 cause but is superseded by #67125's managed-profile lookup and broader tests. #56594 overlaps #56537 on #56536 and remains closed, with #56537 providing the broader implementation. Suggested consolidationKeep #67125 open with a salvage path as the recorded best existing fix for #37589, and close #67178 as a duplicate of #67125 despite its keep_open verdict because its diff adds no distinct resolver behavior; close #37665 as a duplicate of #67125 despite its keep_open review because the managed-uv gap identified there is implemented and tested in #67125. Keep #61153 open with its marker-gated Studio-launcher salvage path, keep #56537 open after correcting the contributor-identified fixture mismatch, and keep #8305 and #67873 open only for their distinct WSL-cwd and Node-version-manager salvage paths; #56594 remains closed as superseded by #56537. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I37589(["issue #37589 (open)"])
subgraph Dup37665 ["PRs duplicating each other"]
P37665["PR #37665 (open)"]
P67125["PR #67125 (open)"]
P67178["PR #67178 (open)"]
end
P67178 -->|fixes| I37589
class I37589 open
class P37665 open
class P67125 open
class P67178 open
class P67125 best
class P67178 target
click I37589 "https://github.com/NousResearch/hermes-agent/issues/37589"
click P37665 "https://github.com/NousResearch/hermes-agent/pull/37665"
click P67125 "https://github.com/NousResearch/hermes-agent/pull/67125"
click P67178 "https://github.com/NousResearch/hermes-agent/pull/67178"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 8 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 59 kB of PR diffs, 24 kB of issue/PR text, 16 kB of discussion (20 comments), 9 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
What does this PR do?
Fixes local MCP servers that start with
uvoruvxwhen PATH does not include their installation folder. This often happens when Hermes is launched from a macOS GUI app.For example, the Blender MCP server starts with
uvx blender-mcp, so it can fail before connecting.Hermes already searches common locations for Node commands. This change adds the same support for
uvanduvx. Hermes checks these locations in order:$HERMES_HOME/bin~/.local/bin/opt/homebrew/bin/usr/local/binOnly existing executable files are used. Other commands are not affected.
Related prior work: #37665
Changes
tools/mcp_tool.py: Addeduvanduvxto the set of commands that get PATH-fallback resolution in_resolve_stdio_command. Differentiates managed bin paths for Node ($HERMES_HOME/node/bin) vs uv ($HERMES_HOME/bin). Added/opt/homebrew/bincandidate for Apple Silicon Homebrew.tests/tools/test_mcp_tool_issue_948.py: Added 60 parameterized and targeted tests covering uv/uvx fallback order, filtered-PATH hits, and command exclusion.Type of Change
Closes #67125