MCPcopy Create free account
hub / github.com/github/gh-aw / GetMCPCLIPathSetup

Function GetMCPCLIPathSetup

pkg/workflow/mcp_cli_mount.go:293–298  ·  view source on GitHub ↗

GetMCPCLIPathSetup returns a shell command that adds the MCP CLI bin directory to PATH inside the AWF container. This ensures CLI-mounted MCP servers are accessible as shell commands even though sudo's secure_path may strip the core.addPath() additions from $GITHUB_PATH. Returns an empty string if

(data *WorkflowData)

Source from the content-addressed store, hash-verified

291// Returns an empty string if no MCP CLIs are configured, so callers can safely
292// chain it with && without introducing empty commands.
293func GetMCPCLIPathSetup(data *WorkflowData) string {
294 if getMCPCLIServerNames(data) == nil {
295 return ""
296 }
297 return `export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH"`
298}
299
300// buildMCPCLIPromptSection returns a PromptSection describing the CLI tools available
301// to the agent, or nil if there are no servers to mount.

Callers 7

GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85

Calls 1

getMCPCLIServerNamesFunction · 0.85

Tested by

no test coverage detected