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

Function detectFromMCPScripts

pkg/workflow/runtime_detection.go:222–243  ·  view source on GitHub ↗

detectFromMCPScripts scans mcp-scripts tool definitions for language runtimes.

(mcpScripts *MCPScriptsConfig, requirements map[string]*RuntimeRequirement)

Source from the content-addressed store, hash-verified

220
221// detectFromMCPScripts scans mcp-scripts tool definitions for language runtimes.
222func detectFromMCPScripts(mcpScripts *MCPScriptsConfig, requirements map[string]*RuntimeRequirement) {
223 if mcpScripts == nil {
224 return
225 }
226
227 for _, tool := range mcpScripts.Tools {
228 switch {
229 case tool.Script != "":
230 if runtime := findRuntimeByID("node"); runtime != nil {
231 updateRequiredRuntime(runtime, "", requirements)
232 }
233 case tool.Py != "":
234 if runtime := findRuntimeByID("python"); runtime != nil {
235 updateRequiredRuntime(runtime, "", requirements)
236 }
237 case tool.Go != "":
238 if runtime := findRuntimeByID("go"); runtime != nil {
239 updateRequiredRuntime(runtime, "", requirements)
240 }
241 }
242 }
243}
244
245// detectFromLSPServers adds runtime requirements for the runtimes needed by configured
246// LSP servers. Each entry in lspInstallSpecs declares the runtime ID it needs (e.g.

Callers 2

TestDetectFromMCPScriptsFunction · 0.85

Calls 2

findRuntimeByIDFunction · 0.85
updateRequiredRuntimeFunction · 0.85

Tested by 1

TestDetectFromMCPScriptsFunction · 0.68