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

Function detectFromMCPConfigs

pkg/workflow/runtime_detection.go:194–219  ·  view source on GitHub ↗

detectFromMCPConfigs scans MCP server configurations for runtime commands

(tools *ToolsConfig, requirements map[string]*RuntimeRequirement)

Source from the content-addressed store, hash-verified

192
193// detectFromMCPConfigs scans MCP server configurations for runtime commands
194func detectFromMCPConfigs(tools *ToolsConfig, requirements map[string]*RuntimeRequirement) {
195 if tools == nil {
196 return
197 }
198
199 allTools := tools.ToMap()
200 workflowLog.Printf("Scanning %d MCP configurations for runtime commands", len(allTools))
201
202 // Scan custom MCP tools for runtime commands
203 // Skip containerized MCP servers as they don't need host runtime setup
204 for _, tool := range tools.Custom {
205 // Skip if the MCP server is containerized (has Container field set or Type is "docker")
206 if tool.Container != "" || tool.Type == "docker" {
207 runtimeSetupLog.Printf("Skipping runtime detection for containerized MCP server (container=%s, type=%s)", tool.Container, tool.Type)
208 continue
209 }
210
211 // For non-containerized custom MCP servers, check the Command field
212 if tool.Command != "" {
213 if runtime, found := commandToRuntime[tool.Command]; found {
214 updateRequiredRuntime(runtime, "", requirements)
215 }
216 }
217
218 }
219}
220
221// detectFromMCPScripts scans mcp-scripts tool definitions for language runtimes.
222func detectFromMCPScripts(mcpScripts *MCPScriptsConfig, requirements map[string]*RuntimeRequirement) {

Callers 2

TestDetectFromMCPConfigsFunction · 0.85

Calls 3

updateRequiredRuntimeFunction · 0.85
ToMapMethod · 0.45
PrintfMethod · 0.45

Tested by 1

TestDetectFromMCPConfigsFunction · 0.68