Fix MCP compile tool false-positive npm PATH error#17795
Closed
Fix MCP compile tool false-positive npm PATH error#17795
Conversation
- Implement GH_AW_SKIP_NPX_VALIDATION env var in npm_validation.go - Augment PATH in MCP subprocess creation to include common binary dirs - Add unit tests for augmentEnvPath and GH_AW_SKIP_NPX_VALIDATION Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix MCP compile tool validation issues due to PATH restrictions
Fix MCP compile tool false-positive npm PATH error
Feb 23, 2026
Contributor
|
@copilot only add |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
agenticworkflows-compileMCP tool fails withexec: "npm": executable file not found in $PATHwhen compiling workflows that use npx packages (e.g.mcp-inspector.md), even though direct CLI invocation succeeds. The MCP server starts with a restricted PATH from its client, so subprocesses it spawns can't find npm at/usr/local/bin.Changes
pkg/cli/mcp_server_path_unix.go—augmentEnvPath()(Unix only,//go:build !windows) appends/usr/local/binto PATH if not already present; applied to every subprocess spawned viaexecCmd, so all MCP tools benefit.pkg/cli/mcp_server_path_windows.go— No-op implementation for Windows; PATH augmentation is not needed on Windows.pkg/workflow/npm_validation.go— ImplementGH_AW_SKIP_NPX_VALIDATION=truesupport, which was already referenced in error messages as a workaround but never actually checked.pkg/cli/mcp_server_path_test.go— Unit tests foraugmentEnvPath(Unix only): nil env, existing PATH augmentation, duplicate prevention.pkg/workflow/npm_validation_test.go— Unit tests for skip-env-var fast path and empty package list.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.