Skip to content

[cli-tools-test] MCP compile tool fails npm validation due to restricted PATH (mcp-inspector.md compiles directly but fails via MCP) #17791

@github-actions

Description

@github-actions

Problem Description

The compile MCP tool (agenticworkflows-compile) reports a false-positive compilation failure for mcp-inspector.md with the error exec: "npm": executable file not found in $PATH, while running ./gh-aw compile .github/workflows/mcp-inspector.md directly succeeds without any errors.

Tool

  • Tool: compile (agenticworkflows MCP server)
  • Workflow: mcp-inspector.md

Steps to Reproduce

  1. Verify npm is available: which npm/usr/local/bin/npm
  2. Run directly: ./gh-aw compile .github/workflows/mcp-inspector.md → ✅ Compiles successfully
  3. Run via MCP: Use agenticworkflows-compile with workflows: ["mcp-inspector"] → ❌ Fails

Expected Behavior

The MCP compile tool should compile mcp-inspector.md successfully, just like the direct CLI invocation.

Actual Behavior

The MCP compile tool returns:

error: runtime package validation failed
Underlying error: exec: "npm": executable file not found in $PATH

Root Cause Analysis

The gh-aw MCP server appears to start with a restricted PATH that does not include /usr/local/bin (or wherever npm is installed). When the MCP server spawns the compilation subprocess, it cannot locate the npm binary, even though it is available in the user's shell environment.

The direct CLI invocation inherits the full shell PATH and can find npm.

Environment

  • Repository: github/gh-aw
  • Run ID: 22288022720
  • Date: 2026-02-22
  • npm location: /usr/local/bin/npm (Node.js v20)
  • gh-aw version: 0.0.414

Impact

  • Severity: High
  • Frequency: Always (reproducible 100%)
  • Effect: mcp-inspector.md always shows as invalid when compiling via MCP, giving a false-positive failure. This breaks the daily compile check which reports mcp-inspector.md as invalid.

Workaround

Run GH_AW_SKIP_NPX_VALIDATION=true gh-aw compile directly. The MCP compile tool does not support this environment variable override.

Suggested Fix

Ensure the MCP server inherits a full PATH when starting, or explicitly add common binary paths (like /usr/local/bin) to the subprocess environment used for compilation.

Generated by Daily CLI Tools Exploratory Tester

  • expires on Mar 1, 2026, 11:55 PM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions