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

Function isRunningAsMCPServer

pkg/cli/update_check.go:75–78  ·  view source on GitHub ↗

isRunningAsMCPServer detects if we're running as a subprocess of mcp-server This is a heuristic - we can't reliably detect this, so we're conservative

()

Source from the content-addressed store, hash-verified

73// isRunningAsMCPServer detects if we're running as a subprocess of mcp-server
74// This is a heuristic - we can't reliably detect this, so we're conservative
75func isRunningAsMCPServer() bool {
76 // Check for MCP_SERVER environment variable that could be set by the MCP server
77 return os.Getenv("GH_AW_MCP_SERVER") != ""
78}
79
80var (
81 // getLastCheckFilePathFunc allows overriding in tests

Callers 3

TestIsRunningAsMCPServerFunction · 0.85
shouldCheckForUpdateFunction · 0.85

Calls 1

GetenvMethod · 0.80

Tested by 1

TestIsRunningAsMCPServerFunction · 0.68